LTL
2.0.x
|
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 | minIndex (const int dim) 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... | |
T | 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... | |
T | 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 | |
T | __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 > > |
Related Functions | |
(Note that these are not member functions.) | |
template<class T , int M, int N> | |
ostream & | operator<< (ostream &os, const FMatrix< T, M, N > &A) |
template<class T , int M, int N> | |
istream & | operator>> (istream &is, FMatrix< T, M, N > &A) |
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.
typedef T ltl::FMatrix< T, M, N >::value_type |
STL-compatible type definitions.
typedef FMIter<T,M,N> ltl::FMatrix< T, M, N >::iterator |
typedef FMIterConst<T,M,N> ltl::FMatrix< T, M, N >::const_iterator |
typedef T& ltl::FMatrix< T, M, N >::reference |
typedef const T& ltl::FMatrix< T, M, N >::const_reference |
typedef std::size_t ltl::FMatrix< T, M, N >::size_type |
typedef std::ptrdiff_t ltl::FMatrix< T, M, N >::difference_type |
typedef FVector<T,M,N> ltl::FMatrix< T, M, N >::ColumnVector |
typedef FVector<T,N,1> ltl::FMatrix< T, M, N >::RowVector |
typedef FVector<T,M,N+1> ltl::FMatrix< T, M, N >::TraceVector |
anonymous enum |
|
inline |
default constructor
|
inline |
default destructor
ltl::FMatrix< T, M, N >::FMatrix | ( | const FMatrix< T, M, N > & | other | ) |
copy constructor: copy elements of other
.
ltl::FMatrix< T, M, N >::FMatrix | ( | const T * | t | ) |
copy contents of memory pointed to by t
.
ltl::FMatrix< T, M, N >::FMatrix | ( | const T | t | ) |
fill with value t
.
ltl::FMatrix< T, M, N >::FMatrix | ( | const FMExprNode< Expr, M, N > & | e | ) |
construct from expression.
|
inlinestatic |
STL return M*N
.
Functions needed for STL container conformance
|
inlinestatic |
STL empty()
. Always false.
|
inlinestatic |
STL: Maximum capacity. Always ==size()
|
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()
.
|
inline |
return length of container (M*N).
Referenced by ltl::FMatrix< double, N, N >::operator[]().
|
inline |
return lowest index of dimension dim
. Always 1.
Referenced by ltl::FMatrix< T, M, N >::operator>>().
|
inline |
return highest index of dimension dim
. Returns M or N.
Referenced by ltl::FMatrix< T, M, N >::operator>>().
|
inline |
1-based access to elements.
|
inline |
1-based access to elements.
|
inline |
Direct zero-based access to the (linear) block of memory.
|
inline |
Direct zero-based access to the (linear) block of memory.
|
inline |
Return an ltl::FVector object REFERENCEING the column vector col
.
Referenced by ltl::tMatClearHesseSplit< TPAR, NPAR, true >::eval(), and ltl::LUDecomposition< T, N >::solve().
|
inline |
Return an ltl::FVector object REFERENCEING the row vector row
.
Referenced by ltl::GaussJ< T, N >::divByPiv(), and ltl::tMatClearHesseSplit< TPAR, NPAR, true >::eval().
|
inline |
Return an ltl::FVector object REFERENCEING the trace vector.
Referenced by ltl::LMFit< TFUNC, TPAR, NPAR, Solver >::getErrors(), ltl::Marquardt< TFUNC, TPAR, TDAT, NPAR, NDIM >::getVariance(), ltl::LMFit< TFUNC, TPAR, NPAR, Solver >::getVariance(), and ltl::LUDecomposition< T, N >::invert().
|
inline |
Return a pointer to the data.
|
inline |
Return a const pointer to the data.
|
inline |
return an iterator pointing to the first element.
|
inline |
return a const iterator pointing to the first element.
void ltl::FMatrix< T, M, N >::fill | ( | const T | x | ) |
fill with value x
.
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator= | ( | const FMExprNode< Expr, M, N > & | e | ) |
operatorX=
for expression rhs.
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator+= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator-= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator*= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator/= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator%= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator^= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator&= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator|= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator<<= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator>>= | ( | const FMExprNode< Expr, M, N > & | e | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator= | ( | const FMatrix< T2, M, N > & | v | ) |
operatorX for FMatrix
rhs.
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator= | ( | const FMatrix< T, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator+= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator-= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator*= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator/= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator%= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator^= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator&= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator|= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator<<= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator>>= | ( | const FMatrix< T2, M, N > & | v | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator+= | ( | const T | t | ) |
operatorX= for scalar rhs.
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator-= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator*= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator/= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator%= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator^= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator&= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator|= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator<<= | ( | const T | t | ) |
FMatrix<T,M,N>& ltl::FMatrix< T, M, N >::operator>>= | ( | const T | t | ) |
void ltl::FMatrix< T, M, N >::swapRows | ( | const int | row1, |
const int | row2 | ||
) |
Swap the values in two row vectors.
Referenced by ltl::GaussJ< T, N >::invert(), and ltl::GaussJ< T, N >::swapRows().
void ltl::FMatrix< T, M, N >::swapCols | ( | const int | col1, |
const int | col2 | ||
) |
Swap the values in two column vectors.
|
friend |
Referenced by ltl::FMatrix< double, N, N >::begin().
|
friend |
Referenced by ltl::FMatrix< double, N, N >::begin().
|
friend |
|
related |
Write ltl::FVector to ascii stream. Compatible with opertor>>
.
|
related |
Read ltl::FMatrix from ascii stream. Compatible with operator<<
.
References ltl::FMatrix< T, M, N >::maxIndex(), and ltl::FMatrix< T, M, N >::minIndex().
|
protected |
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().