LTL  2.0.x
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ltl::ltl::FixedVector< T, N > Class Template Reference

Vector with known length at compile time, 1-based, STL-compatible. More...

Public Types

enum  { static_size = N }
 
typedef T value_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef T & reference
 
typedef const T & const_reference
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 

Public Member Functions

 FixedVector ()
 
 FixedVector (const FixedVector< T, N > &other)
 
FixedVector< T, N > & operator= (const FixedVector< T, N > &o)
 
FixedVector< T, N > & operator= (const T &v)
 
int length () const
 
int minIndex () const
 
int maxIndex () const
 
operator() (int i) const
 Access the i-th element. Indexing is 1-based. More...
 
T & operator() (int i)
 Access the i-th element. Indexing is 1-based. More...
 
operator[] (int i) const
 
T & operator[] (int i)
 
const T * data () const
 Direct access to data. More...
 
iterator begin ()
 Return begin iterator. More...
 
const_iterator begin () const
 Return begin const_iterator. More...
 
iterator end ()
 Return end iterator. More...
 
const_iterator end () const
 Return end const_iterator. More...
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 

Static Public Member Functions

static size_type size ()
 
static bool empty ()
 
static size_type max_size ()
 

Protected Attributes

data_ [N+1]
 

Detailed Description

template<class T, int N>
class ltl::ltl::FixedVector< T, N >

Vector with known length at compile time, 1-based, STL-compatible.

This simple class in its T = int instantiation is used to represent the index or indices of a particular element of an ltl::MArray. The second template parameter, namely the length N of the vector then is equal to the rank of the ltl::MArray this index refers to. This class is used to hold lists of indices for referencing arbitrary sets of elements of an ltl::MArray, e.g. the list of elements of a matrix which are ==0.

Member Typedef Documentation

template<class T, int N>
typedef T ltl::ltl::FixedVector< T, N >::value_type
template<class T, int N>
typedef T* ltl::ltl::FixedVector< T, N >::iterator
template<class T, int N>
typedef const T* ltl::ltl::FixedVector< T, N >::const_iterator
template<class T, int N>
typedef T& ltl::ltl::FixedVector< T, N >::reference
template<class T, int N>
typedef const T& ltl::ltl::FixedVector< T, N >::const_reference
template<class T, int N>
typedef std::size_t ltl::ltl::FixedVector< T, N >::size_type
template<class T, int N>
typedef std::ptrdiff_t ltl::ltl::FixedVector< T, N >::difference_type
template<class T, int N>
typedef std::reverse_iterator<iterator> ltl::ltl::FixedVector< T, N >::reverse_iterator
template<class T, int N>
typedef std::reverse_iterator<const_iterator> ltl::ltl::FixedVector< T, N >::const_reverse_iterator

Member Enumeration Documentation

template<class T, int N>
anonymous enum
Enumerator
static_size 

Constructor & Destructor Documentation

template<class T, int N>
ltl::ltl::FixedVector< T, N >::FixedVector ( )
inline
template<class T, int N>
ltl::ltl::FixedVector< T, N >::FixedVector ( const FixedVector< T, N > &  other)
inline

Member Function Documentation

template<class T, int N>
static size_type ltl::ltl::FixedVector< T, N >::size ( )
inlinestatic
template<class T, int N>
static bool ltl::ltl::FixedVector< T, N >::empty ( )
inlinestatic
template<class T, int N>
static size_type ltl::ltl::FixedVector< T, N >::max_size ( )
inlinestatic
template<class T, int N>
FixedVector<T,N>& ltl::ltl::FixedVector< T, N >::operator= ( const FixedVector< T, N > &  o)
inline
template<class T, int N>
FixedVector<T,N>& ltl::ltl::FixedVector< T, N >::operator= ( const T &  v)
inline
template<class T, int N>
int ltl::ltl::FixedVector< T, N >::length ( ) const
inline
template<class T, int N>
int ltl::ltl::FixedVector< T, N >::minIndex ( ) const
inline
template<class T, int N>
int ltl::ltl::FixedVector< T, N >::maxIndex ( ) const
inline
template<class T, int N>
T ltl::ltl::FixedVector< T, N >::operator() ( int  i) const
inline

Access the i-th element. Indexing is 1-based.

template<class T, int N>
T& ltl::ltl::FixedVector< T, N >::operator() ( int  i)
inline

Access the i-th element. Indexing is 1-based.

template<class T, int N>
T ltl::ltl::FixedVector< T, N >::operator[] ( int  i) const
inline
template<class T, int N>
T& ltl::ltl::FixedVector< T, N >::operator[] ( int  i)
inline
template<class T, int N>
const T* ltl::ltl::FixedVector< T, N >::data ( ) const
inline

Direct access to data.

template<class T, int N>
iterator ltl::ltl::FixedVector< T, N >::begin ( )
inline

Return begin iterator.

template<class T, int N>
const_iterator ltl::ltl::FixedVector< T, N >::begin ( ) const
inline

Return begin const_iterator.

template<class T, int N>
iterator ltl::ltl::FixedVector< T, N >::end ( )
inline

Return end iterator.

template<class T, int N>
const_iterator ltl::ltl::FixedVector< T, N >::end ( ) const
inline

Return end const_iterator.

template<class T, int N>
reverse_iterator ltl::ltl::FixedVector< T, N >::rbegin ( )
inline
template<class T, int N>
const_reverse_iterator ltl::ltl::FixedVector< T, N >::rbegin ( ) const
inline
template<class T, int N>
reverse_iterator ltl::ltl::FixedVector< T, N >::rend ( )
inline
template<class T, int N>
const_reverse_iterator ltl::ltl::FixedVector< T, N >::rend ( ) const
inline

Member Data Documentation

template<class T, int N>
T ltl::ltl::FixedVector< T, N >::data_[N+1]
protected