ML Reference
ml::Tmat3< DT > Class Template Reference

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

#include <mlMatrix3.h>

Inheritance diagram for ml::Tmat3< DT >:
ml::FloatingPointMatrix< Tvec3< DT >, 3 >

List of all members.

Public Types

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

Public Member Functions

bool operator< (const Tmat3< DT > &) const
 Dummy "lesser than operator" which always returns false.
Tmat3 Constructor, set and get functionality.
 Tmat3 (const double in00, const double in01, const double in02, const double in10, const double in11, const double in12, const double in20, const double in21, const double in22)
 Initialize all matrix elements explicitly with scalars, filling it row by row.
void setValues (const float mat[9])
 Copy contents of mat into *this, row by row.
void getValues (float mat[9]) const
 Copy contents of *this into mat, row by row.
void setValues (const double mat[9])
 Copy contents of mat into *this, row by row.
void getValues (double mat[9]) const
 Copy contents of *this into mat, row by row.
void setScaleMatrix (const DT scale)
 Set diagonal matrix with scale on diagonal.

Constructors, set and get functionality.

 Tmat3 ()
 Build 3x3 matrix from 9 0 elements.
 Tmat3 (const DT diagValue)
 Tmat3 (const Tvec3< DT > &row0, const Tvec3< DT > &row1, const Tvec3< DT > &row2)
 Build matrix of the three row vectors row0, row1, row2.
 Tmat3 (const Tmat3< DT > &mat)
 Copy constructor from the Tmat3 mat.
 Tmat3 (const float mat[9])
 Constructor from 9 floating point values in an array given by mat, row by row.
 Tmat3 (const double mat[9])
 Constructor from 9 double values in an array given by mat, row by row.
void set (DT val)
 Set all values to val.
const Tmat3< DT > & operator= (const Tmat3< DT > &m)
 Assignment of a Tmat3.
const Tmat3< DT > & operator+= (const Tmat3< DT > &m)
 Incrementation by a Tmat3.
const Tmat3< DT > & operator-= (const Tmat3< DT > &m)
 Decrement by a Tmat3.
const Tmat3< DT > & operator*= (const DT d)
 Multiplication by a constant.
const Tmat3< DT > & operator/= (const DT d)
 Division by a constant. Division by zero is not handled and must be avoided by caller.
static Tmat3< DT > getMat (const double val)
 Return a matrix filled with values val.

Special Functions

DT det () const
 Determinant.
Tmat3 transpose () const
 Transpose.
Tmat3 inverse (bool *isInvertible=NULL) const
 Returns the inverse.
const Tmat3< DT > & apply (MLDblFuncPtr fct)
 Apply the function fct to each component.
Tmat3 jacobi (Tvec3< DT > &eVal, int &rots) const
 Calculate Jacobi-Decomposition of 3x3 matrix.
static Tmat3 getIdentity ()
 Return identity matrix.

Detailed Description

template<class DT>
class ml::Tmat3< DT >

A three by three matrix class of three row vectors.

Definition at line 43 of file mlMatrix3.h.


Member Typedef Documentation

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

A typedef to "export" the type of components.

Reimplemented from ml::FloatingPointMatrix< Tvec3< DT >, 3 >.

Definition at line 49 of file mlMatrix3.h.


Constructor & Destructor Documentation

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

Build 3x3 matrix from 9 0 elements.

Definition at line 155 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat3< DT >::Tmat3 ( const DT  diagValue) [inline]

Definition at line 164 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat3< DT >::Tmat3 ( const Tvec3< DT > &  row0,
const Tvec3< DT > &  row1,
const Tvec3< DT > &  row2 
) [inline]

Build matrix of the three row vectors row0, row1, row2.

Definition at line 175 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat3< DT >::Tmat3 ( const Tmat3< DT > &  mat) [inline]

Copy constructor from the Tmat3 mat.

Definition at line 186 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec3< DT >, 3 >::v.

template<class DT>
ml::Tmat3< DT >::Tmat3 ( const float  mat[9]) [inline]

Constructor from 9 floating point values in an array given by mat, row by row.

Definition at line 197 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat3< DT >::Tmat3 ( const double  mat[9]) [inline]

Constructor from 9 double values in an array given by mat, row by row.

Definition at line 206 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat3< DT >::Tmat3 ( const double  in00,
const double  in01,
const double  in02,
const double  in10,
const double  in11,
const double  in12,
const double  in20,
const double  in21,
const double  in22 
) [inline]

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

Definition at line 383 of file mlMatrix3.h.

References ML_TRACE_IN.


Member Function Documentation

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

Apply the function fct to each component.

Definition at line 530 of file mlMatrix3.h.

References ML_CATCH_RETHROW, ML_TRACE_IN_TIME_CRITICAL, and ML_TRY.

template<class DT >
DT ml::Tmat3< DT >::det ( ) const

Determinant.

Definition at line 490 of file mlMatrix3.h.

References DET3, and ML_TRACE_IN.

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

Return identity matrix.

Definition at line 517 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Return a matrix filled with values val.

Definition at line 215 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT >
void ml::Tmat3< DT >::getValues ( double  mat[9]) const [inline]

Copy contents of *this into mat, row by row.

Note that range and precision of the float values may not be sufficient for the double matrix contents.

Definition at line 451 of file mlMatrix3.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.

template<class DT >
void ml::Tmat3< DT >::getValues ( float  mat[9]) const [inline]

Copy contents of *this into mat, row by row.

Note that range and precision of the float values may not be sufficient for the double matrix contents.

Definition at line 417 of file mlMatrix3.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.

template<class DT >
Tmat3< DT > ml::Tmat3< DT >::inverse ( bool *  isInvertible = NULL) const

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 795 of file mlMatrix3.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::MLInverseMatHelper().

template<class DT>
Tmat3< DT > ml::Tmat3< DT >::jacobi ( Tvec3< DT > &  evalues,
int &  rots 
) const

Calculate Jacobi-Decomposition of 3x3 matrix.

The jacobi method is deemed to be an absolutely foolproof method for all real symmetric matrices (however a little bit slower than more sophisticated methods as QR decomposition)

Computes all eigenvalues and eigen vectors of a symmetric 3x3 matrix and returns matrix of normalized eigenvectors. evalues[1,..,3] contains the eigenvalues, rots the number of Jacobi rotations that where required.

evalues[i] <-> (eVec[0][i],eVec[1][i],eVec[2][i])

Definition at line 663 of file mlMatrix3.h.

References ML_ABS, ML_BAD_PARAMETER, ML_CATCH_RETHROW, ML_PRINT_ERROR, ML_TRACE_IN, ML_TRY, and ml::FloatingPointMatrix< Tvec3< DT >, 3 >::v.

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

Multiplication by a constant.

Definition at line 276 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Incrementation by a Tmat3.

Definition at line 250 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec3< DT >, 3 >::v.

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

Decrement by a Tmat3.

Definition at line 263 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec3< DT >, 3 >::v.

template<class DT>
const Tmat3< DT > & ml::Tmat3< 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 289 of file mlMatrix3.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.

template<class DT>
bool ml::Tmat3< DT >::operator< ( const Tmat3< 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 100 of file mlMatrix3.h.

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

Assignment of a Tmat3.

Definition at line 235 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec3< DT >, 3 >::v.

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

Set all values to val.

Definition at line 226 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Set diagonal matrix with scale on diagonal.

Definition at line 468 of file mlMatrix3.h.

References ML_TRACE_IN.

template<class DT >
void ml::Tmat3< DT >::setValues ( const double  mat[9]) [inline]

Copy contents of mat into *this, row by row.

Definition at line 433 of file mlMatrix3.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.

template<class DT >
void ml::Tmat3< DT >::setValues ( const float  mat[9]) [inline]

Copy contents of mat into *this, row by row.

Definition at line 399 of file mlMatrix3.h.

References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.

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

Transpose.

Definition at line 504 of file mlMatrix3.h.

References ML_TRACE_IN_TIME_CRITICAL.

Referenced by ml::operator*().


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