Matrix with dimensions known at compile time.
More...
List of all members.
Public Types
- enum { static_size = 1
}
Used by expression engine to decide which loops to unroll.
More...
Public Member Functions
- FMatrix ()
- default constructor
- ~FMatrix ()
- default destructor
- FMatrix (const FMatrix< T, M, N > &other)
- copy constructor: copy elements of
other
.
- FMatrix (const T *t)
- copy contents of memory pointed to by
t
.
- FMatrix (const T t)
- fill with value
t
.
- template<class Expr > FMatrix (const FMExprNode< Expr, M, N > &e)
- construct from expression.
- ListInitializationSwitch
< FMatrix< T, M, N > > operator= (T x)
- Initialize with list of values or single value.
- int length () const
- return length of container (M*N).
- int minIndex (const int dim) const
- return lowest index of dimension
dim
. Always 1.
- int maxIndex (const int dim) const
- return highest index of dimension
dim
. Returns M or N.
- ColumnVector col (const int col)
- Return an ltl::FVector object REFERENCEING the column vector
col
.
- RowVector row (const int row)
- Return an ltl::FVector object REFERENCEING the row vector
row
.
- TraceVector traceVector ()
- Return an ltl::FVector object REFERENCEING the trace vector.
- T * data ()
- Return a pointer to the data.
- const T * data () const
- Return a const pointer to the data.
- iterator begin ()
- return an iterator pointing to the first element.
- const_iterator begin () const
- return a const iterator pointing to the first element.
- void fill (const T x)
- fill with value
x
.
- void swapRows (const int row1, const int row2)
- Swap the values in two row vectors.
- void swapCols (const int col1, const int col2)
- Swap the values in two column vectors.
Protected Attributes
- T __data_ [M *N]
- Storage for the matrix elements.
Friends
- typedef T value_type
- STL-compatible type definitions.
- 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
- static size_type size ()
- STL return
M*N
.
- static bool empty ()
- STL
empty()
. Always false.
- static size_type max_size ()
- STL: Maximum capacity. Always
==size
().
- T operator() (const int i, const int j) const
- 1-based access to elements.
- T & operator() (const int i, const int j)
- 1-based access to elements.
- T operator[] (const int i) const
- Direct zero-based access to the (linear) block of memory.
- T & operator[] (const int i)
- Direct zero-based access to the (linear) block of memory.
- template<class Expr > FMatrix< T, M, N > & operator= (const FMExprNode< Expr, M, N > &e)
operatorX=
for expression rhs.
- 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.
- 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.
- 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)
Detailed Description
template<class T, int M, int N>
class 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.
Member Typedef Documentation
template<class T, int M, int N>
STL-compatible type definitions.
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
Member Enumeration Documentation
template<class T, int M, int N>
Used by expression engine to decide which loops to unroll.
- Enumerator:
-
Constructor & Destructor Documentation
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
copy constructor: copy elements of other
.
template<class T, int M, int N>
copy contents of memory pointed to by t
.
template<class T, int M, int N>
template<class T, int M, int N>
template<class Expr >
construct from expression.
Member Function Documentation
template<class T, int M, int N>
STL return M*N
.
Functions needed for STL container conformance
template<class T, int M, int N>
static bool ltl::FMatrix< T, M, N >::empty |
( |
|
) |
[inline, static] |
template<class T, int M, int N>
STL: Maximum capacity. Always ==size
().
template<class T, int M, int N>
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 M, int N>
template<class T, int M, int N>
return lowest index of dimension dim
. Always 1.
template<class T, int M, int N>
return highest index of dimension dim
. Returns M or N.
template<class T, int M, int N>
1-based access to elements.
template<class T, int M, int N>
1-based access to elements.
template<class T, int M, int N>
Direct zero-based access to the (linear) block of memory.
template<class T, int M, int N>
Direct zero-based access to the (linear) block of memory.
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
Return a pointer to the data.
template<class T, int M, int N>
Return a const pointer to the data.
template<class T, int M, int N>
return an iterator pointing to the first element.
template<class T, int M, int N>
return a const iterator pointing to the first element.
template<class T, int M, int N>
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
operatorX=
for expression rhs.
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator+= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator-= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator*= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator/= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator%= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator^= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator&= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator|= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator<<= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class Expr >
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator>>= |
( |
const FMExprNode< Expr, M, N > & |
e |
) |
[inline] |
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
template<class T2 >
template<class T, int M, int N>
operatorX= for scalar rhs.
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
template<class T, int M, int N>
Swap the values in two column vectors.
Friends And Related Function Documentation
template<class T, int M, int N>
friend class FMIter< T, M, N > [friend] |
template<class T, int M, int N>
friend class FMIterConst< T, M, N > [friend] |
template<class T, int M, int N>
friend class ListInitializationSwitch< FMatrix< T, M, N > > [friend] |
Member Data Documentation
template<class T, int M, int N>
Storage for the matrix elements.
Referenced by ltl::FMatrix< double, N, N >::col(), ltl::FMatrix< double, N, N >::data(), ltl::FMatrix< double, N, N >::operator()(), ltl::FMatrix< double, N, N >::operator[](), ltl::FMatrix< double, N, N >::row(), and ltl::FMatrix< double, N, N >::traceVector().