ml::Tmat6< DT > Class Template Reference

A six by six matrix class of six row vectors. More...

#include <mlMatrix6.h>

List of all members.

Public Types

typedef DT ComponentType
 A typedef to "export" the type of components.

Public Member Functions

bool operator< (const Tmat6< DT > &) const
 Dummy "lesser than operator" which always returns false.
Tmat6 constructors, set and get functionality.
 Tmat6 (const double in00, const double in01, const double in02, const double in03, const double in04, const double in05, const double in10, const double in11, const double in12, const double in13, const double in14, const double in15, const double in20, const double in21, const double in22, const double in23, const double in24, const double in25, const double in30, const double in31, const double in32, const double in33, const double in34, const double in35, const double in40, const double in41, const double in42, const double in43, const double in44, const double in45, const double in50, const double in51, const double in52, const double in53, const double in54, const double in55)
 Initialize all matrix elements explicitly with scalars, filling it row by row.
void setValues (const float m[36])
 Copy contents from float array m into *this.
void getValues (float m[36]) const
 Copy contents of *this into float array m.
void setValues (const double m[36])
 Copy contents of m into *this, where m must provide at least 36 accessible entries.
void getValues (double m[36]) const
 Copy contents of *this into m, where m must provide at least 36 accessible entries.
void setScaleMatrix (const DT scale)
 Set diagonal matrix with scale on diagonal.

Protected Attributes

Tvec6< DT > v [6]
 The six vectors (of 6 components) of the matrix.

Constructors, set and get functionality.

 Tmat6 ()
 Build 6x6 matrix from 36 0 elements.
 Tmat6 (const Tvec6< DT > &row0, const Tvec6< DT > &row1, const Tvec6< DT > &row2, const Tvec6< DT > &row3, const Tvec6< DT > &row4, const Tvec6< DT > &row5)
 Build matrix of the six row vectors row0, ..., row5.
 Tmat6 (const Tmat6< DT > &m)
 Copy constructor from the Tmat6 mat.
 Tmat6 (const float mat[36])
 Constructor from 36 floats given as array mat.
 Tmat6 (const double mat[36])
 Constructor from 36 doubles given as array mat.
void set (const DT val)
 Set all values to val.
const Tmat6< DT > & operator= (const Tmat6< DT > &m)
 Assignment of a Tmat6.
const Tmat6< DT > & operator+= (const Tmat6< DT > &m)
 Component wise addition by a Tmat6.
const Tmat6< DT > & operator-= (const Tmat6< DT > &m)
 Component wise subtraction by a Tmat6.
const Tmat6< DT > & operator*= (const DT d)
 Multiplication by a constant.
const Tmat6< DT > & operator/= (const DT d)
 Division by a constant. Division by zero is not handled and must be avoided by caller.
const Tvec6< DT > & operator[] (const size_t i) const
 Constant indexed read access to row vectors, indexes must not exceed [0, 5] or errors will occur and the value for index 0 is returned.
Tvec6< DT > & operator[] (const size_t i)
 Indexed read/write access to row vectors, indexes must not exceed [0, 5] or errors will occur and the value for index 0 is returned.
DT compAbsSum () const
 Return sum of all MLAbs values of all matrix elements.
DT & linearIndexed (const size_t idx)
 Linear read/write access to matrix elements correctly ordered starting with first, second, .
DT linearIndexedConst (const size_t idx) const
 Linear and constant read access to matrix elements correctly ordered starting with first, second, .
static Tmat6< DT > getMat (const double val)
 Return a matrix filled with values val.

Special Functions

DT determinantLower5 (const int col1, const int col2, const int col3, const int col4, const int col5) const
 Determine the (sub)determinant of columns given by col1, col2, col3, col4 and col5.
DT det () const
 Determinant.
Tmat6< DT > inverse (bool *isInvertible=NULL) const
 Returns the inverse.
Tmat6 transpose () const
 Transpose.
const Tmat6< DT > & apply (MLDblFuncPtr fct)
 Apply the function fct to each component.
static Tmat6 getIdentity ()
 Return identity matrix.


Detailed Description

template<class DT>
class ml::Tmat6< DT >

A six by six matrix class of six row vectors.

Definition at line 34 of file mlMatrix6.h.


Member Typedef Documentation

template<class DT>
typedef DT ml::Tmat6< DT >::ComponentType

A typedef to "export" the type of components.

Definition at line 39 of file mlMatrix6.h.


Constructor & Destructor Documentation

template<class DT >
ml::Tmat6< DT >::Tmat6 (  )  [inline]

Build 6x6 matrix from 36 0 elements.

Definition at line 181 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
ml::Tmat6< DT >::Tmat6 ( const Tvec6< DT > &  row0,
const Tvec6< DT > &  row1,
const Tvec6< DT > &  row2,
const Tvec6< DT > &  row3,
const Tvec6< DT > &  row4,
const Tvec6< DT > &  row5 
) [inline]

Build matrix of the six row vectors row0, ..., row5.

Definition at line 190 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
ml::Tmat6< DT >::Tmat6 ( const Tmat6< DT > &  m  )  [inline]

Copy constructor from the Tmat6 mat.

Definition at line 205 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
ml::Tmat6< DT >::Tmat6 ( const float  mat[36]  )  [inline]

Constructor from 36 floats given as array mat.

Definition at line 219 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::setValues().

template<class DT>
ml::Tmat6< DT >::Tmat6 ( const double  mat[36]  )  [inline]

Constructor from 36 doubles given as array mat.

Definition at line 228 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::setValues().

template<class DT>
ml::Tmat6< DT >::Tmat6 ( const double  in00,
const double  in01,
const double  in02,
const double  in03,
const double  in04,
const double  in05,
const double  in10,
const double  in11,
const double  in12,
const double  in13,
const double  in14,
const double  in15,
const double  in20,
const double  in21,
const double  in22,
const double  in23,
const double  in24,
const double  in25,
const double  in30,
const double  in31,
const double  in32,
const double  in33,
const double  in34,
const double  in35,
const double  in40,
const double  in41,
const double  in42,
const double  in43,
const double  in44,
const double  in45,
const double  in50,
const double  in51,
const double  in52,
const double  in53,
const double  in54,
const double  in55 
) [inline]

Initialize all matrix elements explicitly with scalars, filling it row by row.

Definition at line 606 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.


Member Function Documentation

template<class DT >
const Tmat6< DT > & ml::Tmat6< DT >::apply ( MLDblFuncPtr  fct  )  [inline]

Apply the function fct to each component.

Definition at line 848 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.

template<class DT >
DT ml::Tmat6< DT >::compAbsSum (  )  const [inline]

Return sum of all MLAbs values of all matrix elements.

This is useful for testing differences of matrices less than a certain value.

Definition at line 374 of file mlMatrix6.h.

References ML_TRACE_IN, MLAbs(), and ml::Tmat6< DT >::v.

template<class DT >
DT ml::Tmat6< DT >::det (  )  const [inline]

template<class DT >
DT ml::Tmat6< DT >::determinantLower5 ( const int  col1,
const int  col2,
const int  col3,
const int  col4,
const int  col5 
) const [inline]

Determine the (sub)determinant of columns given by col1, col2, col3, col4 and col5.

Definition at line 739 of file mlMatrix6.h.

References ml::Tmat6< DT >::det(), ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.

Referenced by ml::Tmat6< DT >::det().

template<class DT >
Tmat6< DT > ml::Tmat6< DT >::getIdentity (  )  [inline, static]

Return identity matrix.

Definition at line 832 of file mlMatrix6.h.

References ML_TRACE_IN.

Referenced by ml::Tmat6< DT >::inverse().

template<class DT >
Tmat6< DT > ml::Tmat6< DT >::getMat ( const double  val  )  [inline, static]

Return a matrix filled with values val.

Definition at line 237 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT >
void ml::Tmat6< DT >::getValues ( double  m[36]  )  const [inline]

Copy contents of *this into m, where m must provide at least 36 accessible entries.

Definition at line 694 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.

template<class DT >
void ml::Tmat6< DT >::getValues ( float  m[36]  )  const [inline]

Copy contents of *this into float array m.

Note that range and precision of the float values may not be sufficient for higher precision matrix contents. m must point to an array with at least 36 accessible entries.

Definition at line 654 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.

template<class DT >
Tmat6< DT > ml::Tmat6< DT >::inverse ( bool *  isInvertible = NULL  )  const [inline]

Returns the inverse.

Gauss-Jordan elimination with partial pivoting. If a non-NULL Boolean pointer is passed to isInvertible then true is returned in *isInvertible in the case of a successful inversion or false if the inversion is not possible (function return is the identity then). If a NULL pointer is passed as isInvertible the matrix must be invertible, otherwise errors will occur.

Definition at line 789 of file mlMatrix6.h.

References ml::Tmat6< DT >::getIdentity(), ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::MLInverseMatHelper().

template<class DT >
DT & ml::Tmat6< DT >::linearIndexed ( const size_t  idx  )  [inline]

Linear read/write access to matrix elements correctly ordered starting with first, second, .

.. elements of first row up to last element in last row. The first DT may NOT be used as an array base to address all DTs directly in memory since values are organized as vectors and not as an array. idx has to be from 0-35. Other idx values must be avoided by the caller, because they lead to an error post and a the return of value at index 0.

Definition at line 401 of file mlMatrix6.h.

References ML_BAD_INDEX, ML_CATCH_RETHROW, ML_PRINT_ERROR, ML_TRACE_IN_TIME_CRITICAL, ML_TRY, and ml::Tmat6< DT >::v.

template<class DT >
DT ml::Tmat6< DT >::linearIndexedConst ( const size_t  idx  )  const [inline]

Linear and constant read access to matrix elements correctly ordered starting with first, second, .

.. elements of first row up to last element in last row. idx has to be from 0-35. Other idx values must be avoided by the caller, because they lead to an error post and a the return of value at index 0.

Definition at line 463 of file mlMatrix6.h.

References ML_BAD_INDEX, ML_CATCH_RETHROW, ML_PRINT_ERROR, ML_TRACE_IN_TIME_CRITICAL, ML_TRY, and ml::Tmat6< DT >::v.

template<class DT>
const Tmat6< DT > & ml::Tmat6< DT >::operator*= ( const DT  d  )  [inline]

Multiplication by a constant.

Definition at line 310 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
const Tmat6< DT > & ml::Tmat6< DT >::operator+= ( const Tmat6< DT > &  m  )  [inline]

Component wise addition by a Tmat6.

Definition at line 278 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
const Tmat6< DT > & ml::Tmat6< DT >::operator-= ( const Tmat6< DT > &  m  )  [inline]

Component wise subtraction by a Tmat6.

Definition at line 294 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
const Tmat6< DT > & ml::Tmat6< DT >::operator/= ( const DT  d  )  [inline]

Division by a constant. Division by zero is not handled and must be avoided by caller.

Definition at line 326 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_CHECK_THROW, ML_TRACE_IN, ML_TRY, MLValueIs0WOM(), and ml::Tmat6< DT >::v.

template<class DT>
bool ml::Tmat6< DT >::operator< ( const Tmat6< DT > &   )  const [inline]

Dummy "lesser than operator" which always returns false.

It is needed to make class work with some STL containers on VC7.

Definition at line 95 of file mlMatrix6.h.

template<class DT>
const Tmat6< DT > & ml::Tmat6< DT >::operator= ( const Tmat6< DT > &  m  )  [inline]

Assignment of a Tmat6.

Definition at line 260 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT >
Tvec6< DT > & ml::Tmat6< DT >::operator[] ( const size_t  i  )  [inline]

Indexed read/write access to row vectors, indexes must not exceed [0, 5] or errors will occur and the value for index 0 is returned.

Definition at line 360 of file mlMatrix6.h.

References ML_BAD_INDEX, ML_PRINT_ERROR, ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT >
const Tvec6< DT > & ml::Tmat6< DT >::operator[] ( const size_t  i  )  const [inline]

Constant indexed read access to row vectors, indexes must not exceed [0, 5] or errors will occur and the value for index 0 is returned.

Definition at line 346 of file mlMatrix6.h.

References ML_BAD_INDEX, ML_PRINT_ERROR, ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
void ml::Tmat6< DT >::set ( const DT  val  )  [inline]

Set all values to val.

Definition at line 251 of file mlMatrix6.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::Tmat6< DT >::v.

template<class DT>
void ml::Tmat6< DT >::setScaleMatrix ( const DT  scale  )  [inline]

Set diagonal matrix with scale on diagonal.

Definition at line 714 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.

template<class DT >
void ml::Tmat6< DT >::setValues ( const double  m[36]  )  [inline]

Copy contents of m into *this, where m must provide at least 36 accessible entries.

Definition at line 674 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.

template<class DT >
void ml::Tmat6< DT >::setValues ( const float  m[36]  )  [inline]

Copy contents from float array m into *this.

m must point to an array with at least 36 valid entries.

Definition at line 632 of file mlMatrix6.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::Tmat6< DT >::v.

Referenced by ml::Tmat6< DT >::Tmat6().

template<class DT >
Tmat6< DT > ml::Tmat6< DT >::transpose (  )  const [inline]

Transpose.

Definition at line 816 of file mlMatrix6.h.

References ML_TRACE_IN, and ml::Tmat6< DT >::v.

Referenced by ml::operator*().


Member Data Documentation

template<class DT>
Tvec6<DT> ml::Tmat6< DT >::v[6] [protected]


The documentation for this class was generated from the following file:

Generated on Sat Sep 3 18:37:46 2011 for MLReference by  doxygen 1.5.8