ltl::FVector< T, N, S > Class Template Reference
[The classes ltl::FVector and ltl::FMatrix]

Vector whose length is known at compile time. More...

Inherits ltl::FVMemory< T, N, S >.

List of all members.

Public Types

Public Member Functions



Static Public Member Functions

Protected Attributes

Friends


Detailed Description

template<class T, int N, int S = 0>
class ltl::FVector< T, N, S >

Vector whose length is known at compile time.

Can either have its own memory region or reference foreign memory, for example when representing a column-vector of a matrix

The template parameter S is a 'stride' for the foreign memory: when we reference a column vector we need a stride of M (if the matrix is MxN). Memory handling is encapsulated in the class FVMemory. To make life easier for the compiler/optimizer, there is a specialization of FVMemory with _no_ stride at all and an own new embedded block of memory. This is indicated by S=0, which is also the default case.

FVector does not require more memory than is necessary to store the N elements of the vector if S=0. If S>0, the size is exactly sizeof(T*).

FVector provides operator() for 1-based access and operator[] for 0-based access. A full expression-templated engine for evaluating expressions involving ltl::FVectors is provided, as well as dot products between ltl::FVector and ltl::FMatrix objects, and scalar-valued reductions.

STL-compatible iterators and types.


Member Typedef Documentation

template<class T, int N, int S = 0>
typedef T ltl::FVector< T, N, S >::value_type

STL-compatible type definitions.

template<class T, int N, int S = 0>
typedef FVIter<T,N,S> ltl::FVector< T, N, S >::iterator
template<class T, int N, int S = 0>
typedef FVIterConst<T,N,S> ltl::FVector< T, N, S >::const_iterator
template<class T, int N, int S = 0>
typedef T* ltl::FVector< T, N, S >::pointer
template<class T, int N, int S = 0>
typedef const T* ltl::FVector< T, N, S >::const_pointer
template<class T, int N, int S = 0>
typedef T& ltl::FVector< T, N, S >::reference
template<class T, int N, int S = 0>
typedef const T& ltl::FVector< T, N, S >::const_reference
template<class T, int N, int S = 0>
typedef std::size_t ltl::FVector< T, N, S >::size_type
template<class T, int N, int S = 0>
typedef std::ptrdiff_t ltl::FVector< T, N, S >::difference_type

Member Enumeration Documentation

template<class T, int N, int S = 0>
anonymous enum

Used by expression engine to decide which loops to unroll.

Enumerator:
static_size 

Constructor & Destructor Documentation

template<class T, int N, int S = 0>
ltl::FVector< T, N, S >::FVector (  )  [inline]

default constructor

template<class T, int N, int S = 0>
ltl::FVector< T, N, S >::~FVector (  )  [inline]

destructor

template<class T, int N, int S = 0>
ltl::FVector< T, N, S >::FVector ( const FVector< T, N, S > &  other  ) 

copy constructor

template<class T, int N, int S = 0>
ltl::FVector< T, N, S >::FVector ( T *const   a  ) 

constructor taking a pointer to foreign memory. If S==0, copy, else reference the foreign memory.

template<class T, int N, int S = 0>
ltl::FVector< T, N, S >::FVector ( const T  t  ) 

fill with value t.

template<class T, int N, int S = 0>
template<class Expr >
ltl::FVector< T, N, S >::FVector ( const FVExprNode< Expr, N > &  e  )  [inline]

construct from expression


Member Function Documentation

template<class T, int N, int S = 0>
static size_type ltl::FVector< T, N, S >::size (  )  [inline, static]

STL return the length of the vector.

Functions needed for STL container conformance

template<class T, int N, int S = 0>
static bool ltl::FVector< T, N, S >::empty (  )  [inline, static]

STL empty(). Always false.

template<class T, int N, int S = 0>
static size_type ltl::FVector< T, N, S >::max_size (  )  [inline, static]

STL: Maximum capacity. Always ==size().

template<class T, int N, int S = 0>
ListInitializationSwitch< FVector<T,N,S> > ltl::FVector< T, N, S >::operator= ( x  )  [inline]

Initialize with list of values or single value.

Assign values through initialization list. A bit more comlicated since we have to discriminate between A = 3; and A = 1, 2, 3, 4; which is done using ListInitializationSwitch which either calls ListInitializer or FVector::fill().

template<class T, int N, int S = 0>
static int ltl::FVector< T, N, S >::length (  )  [inline, static]

return length of vector.

operator[] and operator() inherited from FVMemory

template<class T, int N, int S = 0>
static int ltl::FVector< T, N, S >::minIndex (  )  [inline, static]

lowest possible index, always one.

template<class T, int N, int S = 0>
static int ltl::FVector< T, N, S >::maxIndex (  )  [inline, static]

highest possible index, always N.

template<class T, int N, int S = 0>
iterator ltl::FVector< T, N, S >::begin (  )  [inline]

return an iterator pointing to the first element.

template<class T, int N, int S = 0>
const_iterator ltl::FVector< T, N, S >::begin (  )  const [inline]

return a const iterator pointing to the first element.

template<class T, int N, int S = 0>
iterator ltl::FVector< T, N, S >::end (  )  [inline]

return an iterator pointing past the last element.

template<class T, int N, int S = 0>
const_iterator ltl::FVector< T, N, S >::end (  )  const [inline]

return a const iterator pointing past the last element.

template<class T, int N, int S = 0>
void ltl::FVector< T, N, S >::fill ( const T  x  ) 

fill with value x.

template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator= ( const FVExprNode< Expr, N > &  e  )  [inline]

operatorX= for expression rhs.

template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator+= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator-= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator*= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator/= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator%= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator^= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator&= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator|= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator<<= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class Expr >
FVector<T,N,S>& ltl::FVector< T, N, S >::operator>>= ( const FVExprNode< Expr, N > &  e  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator= ( const FVector< T2, N, S2 > &  v  )  [inline]

operatorX for FVector rhs.

template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator= ( const FVector< T, N, S > &  v  ) 
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator+= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator-= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator*= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator/= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator%= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator^= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator&= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator|= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator<<= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
template<class T2 , int S2>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator>>= ( const FVector< T2, N, S2 > &  v  )  [inline]
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator+= ( const T  t  ) 

operatorX= for scalar rhs.

template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator-= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator*= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator/= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator%= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator^= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator&= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator|= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator<<= ( const T  t  ) 
template<class T, int N, int S = 0>
FVector<T,N,S>& ltl::FVector< T, N, S >::operator>>= ( const T  t  ) 
template<class T, int N, int S = 0>
template<class T2 , int S2>
void ltl::FVector< T, N, S >::swap ( FVector< T2, N, S2 > &  other  )  [inline]

swap values with other.

template<class T, int N, int S>
T ltl::FVMemory< T, N, S >::operator[] ( const int  i  )  const [inline, inherited]

Access elements with zero-based index i.

template<class T, int N, int S>
T& ltl::FVMemory< T, N, S >::operator[] ( const int  i  )  [inline, inherited]

Access elements with zero-based index i.

template<class T, int N, int S>
T ltl::FVMemory< T, N, S >::operator() ( const int  i  )  const [inline, inherited]

Access elements with one-based index i.

template<class T, int N, int S>
T& ltl::FVMemory< T, N, S >::operator() ( const int  i  )  [inline, inherited]

Access elements with one-based index i.

template<class T, int N, int S>
T* ltl::FVMemory< T, N, S >::data (  )  [inline, inherited]

Return a pointer to the data.

template<class T, int N, int S>
T* ltl::FVMemory< T, N, S >::data (  )  const [inline, inherited]

Return a const pointer to the data.


Friends And Related Function Documentation

template<class T, int N, int S = 0>
friend class FVIter< T, N, S > [friend]
template<class T, int N, int S = 0>
friend class FVIterConst< T, N, S > [friend]
template<class T, int N, int S = 0>
friend class ListInitializationSwitch< FVector< T, N, S > > [friend]

Member Data Documentation

template<class T, int N, int S>
T* ltl::FVMemory< T, N, S >::__data_ [protected, inherited]

Generated on 19 Feb 2015 for LTL by  doxygen 1.6.1