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

Matrix with dimensions known at compile time. More...

Public Types

enum  { static_size = 1 }
 Used by expression engine to decide which loops to unroll. More...
 
typedef T value_type
 STL-compatible type definitions. More...
 
typedef FMIter< T, M, N > iterator
 
typedef FMIterConst< T, M, N > const_iterator
 
typedef T & reference
 
typedef const T & const_reference
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef FVector< T, M, N > ColumnVector
 
typedef FVector< T, N, 1 > RowVector
 
typedef FVector< T, M, N+1 > TraceVector
 

Public Member Functions

 FMatrix ()
 default constructor More...
 
 ~FMatrix ()
 default destructor More...
 
 FMatrix (const FMatrix< T, M, N > &other)
 copy constructor: copy elements of other. More...
 
 FMatrix (const T *t)
 copy contents of memory pointed to by t. More...
 
 FMatrix (const T t)
 fill with value t. More...
 
template<class Expr >
 FMatrix (const FMExprNode< Expr, M, N > &e)
 construct from expression. More...
 
ListInitializationSwitch
< FMatrix< T, M, N > > 
operator= (T x)
 Initialize with list of values or single value. More...
 
int length () const
 return length of container (M*N). More...
 
int nelements () const
 return length of container (M*N). More...
 
int minIndex (const int) const
 return lowest index of dimension dim. Always 1. More...
 
int maxIndex (const int dim) const
 return highest index of dimension dim. Returns M or N. More...
 
ColumnVector col (const int col)
 Return an ltl::FVector object REFERENCEING the column vector col. More...
 
RowVector row (const int row)
 Return an ltl::FVector object REFERENCEING the row vector row. More...
 
TraceVector traceVector ()
 Return an ltl::FVector object REFERENCEING the trace vector. More...
 
T * data ()
 Return a pointer to the data. More...
 
const T * data () const
 Return a const pointer to the data. More...
 
iterator begin ()
 return an iterator pointing to the first element. More...
 
const_iterator begin () const
 return a const iterator pointing to the first element. More...
 
void fill (const T x)
 fill with value x. More...
 
void swapRows (const int row1, const int row2)
 Swap the values in two row vectors. More...
 
void swapCols (const int col1, const int col2)
 Swap the values in two column vectors. More...
 
operator() (const int i, const int j) const
 1-based access to elements. More...
 
T & operator() (const int i, const int j)
 1-based access to elements. More...
 
operator[] (const int i) const
 Direct zero-based access to the (linear) block of memory. More...
 
T & operator[] (const int i)
 Direct zero-based access to the (linear) block of memory. More...
 
template<class Expr >
FMatrix< T, M, N > & operator= (const FMExprNode< Expr, M, N > &e)
 operatorX= for expression rhs. More...
 
template<class Expr >
FMatrix< T, M, N > & operator+= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator-= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator*= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator/= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator%= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator^= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator&= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator|= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator<<= (const FMExprNode< Expr, M, N > &e)
 
template<class Expr >
FMatrix< T, M, N > & operator>>= (const FMExprNode< Expr, M, N > &e)
 
template<class T2 >
FMatrix< T, M, N > & operator= (const FMatrix< T2, M, N > &v)
 operatorX for FMatrix rhs. More...
 
FMatrix< T, M, N > & operator= (const FMatrix< T, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator+= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator-= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator*= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator/= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator%= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator^= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator&= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator|= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator<<= (const FMatrix< T2, M, N > &v)
 
template<class T2 >
FMatrix< T, M, N > & operator>>= (const FMatrix< T2, M, N > &v)
 
FMatrix< T, M, N > & operator+= (const T t)
 operatorX= for scalar rhs. More...
 
FMatrix< T, M, N > & operator-= (const T t)
 
FMatrix< T, M, N > & operator*= (const T t)
 
FMatrix< T, M, N > & operator/= (const T t)
 
FMatrix< T, M, N > & operator%= (const T t)
 
FMatrix< T, M, N > & operator^= (const T t)
 
FMatrix< T, M, N > & operator&= (const T t)
 
FMatrix< T, M, N > & operator|= (const T t)
 
FMatrix< T, M, N > & operator<<= (const T t)
 
FMatrix< T, M, N > & operator>>= (const T t)
 

Static Public Member Functions

static size_type size ()
 STL return M*N. More...
 
static bool empty ()
 STL empty(). Always false. More...
 
static size_type max_size ()
 STL: Maximum capacity. Always ==size() More...
 

Protected Attributes

__data_ [M *N]
 Storage for the matrix elements. More...
 

Friends

class FMIter< T, M, N >
 
class FMIterConst< T, M, N >
 
class ListInitializationSwitch< FMatrix< T, M, N > >
 

Detailed Description

template<class T, int M, int N>
class ltl::ltl::FMatrix< T, M, N >

Matrix with dimensions known at compile time.

Indices are 1-based. The FMatrix does not require more storage than is necessary to hold the MxN elements. STL-compatible iterators and types.