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

A two by two matrix class consisting of 2 row vectors. More...

#include <mlMatrix2.h>

Inheritance diagram for ml::Tmat2< DT >:
ml::FloatingPointMatrix< Tvec2< DT >, 2 >

List of all members.

Public Types

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

Public Member Functions

bool operator< (const Tmat2< DT > &) const
 Dummy "lesser than operator" which always returns false.
Operators and indexing functionality.
const Tmat2< DT > & operator= (const Tmat2< DT > &m)
 Assignment of a Tmat2.
const Tmat2< DT > & operator+= (const Tmat2< DT > &m)
 Incrementation by a Tmat2.
const Tmat2< DT > & operator-= (const Tmat2< DT > &m)
 Decrement by a Tmat2.
const Tmat2< DT > & operator*= (const DT d)
 Multiplication by a constant d.
const Tmat2< DT > & operator/= (const DT d)
 Division by a constant d. Division by zero is not handled and must be avoided by caller.
Special functions for class Tmat2.
DT det () const
 Determinant.
Tmat2< DT > transpose () const
 Transpose.
Tmat2< DT > inverse (bool *isInvertible=NULL) const
const Tmat2< DT > & apply (MLDblFuncPtr fct)
 Apply method fct to all vectors of *this and return the matrix.

Constructors, set and get methods.

 Tmat2 ()
 Construct matrix from 4 zero elements.
 Tmat2 (const DT diagValue)
 Tmat2 (const Tvec2< DT > &row0, const Tvec2< DT > &row1)
 Composes a matrix from the two vectors row0 and row1.
 Tmat2 (const Tmat2< DT > &mat)
 Copy constructor from the Tmat2 mat.
 Tmat2 (const float mat[4])
 Constructor from 4 floating point values in an array given by mat, row by row.
 Tmat2 (const double mat[4])
 Constructor from 4 double values in an array given by mat, row by row.
 Tmat2 (const DT in00, const DT in01, const DT in10, const DT in11)
 Initialize all matrix elements explicitly with scalars, row by row.
void setValues (const float mat[4])
 Copy contents of mat into *this, row by row.
void getValues (float mat[4]) const
 Copy contents of *this into mat, row by row.
void setValues (const double mat[4])
 Copy contents of mat into *this, row by row.
void getValues (double mat[4]) const
 Copy contents of *this into mat, row by row.
void set (const DT val)
 Set all values to val.
void setScaleMatrix (const DT scale)
 Set diagonal matrix with scale on diagonal.
static Tmat2< DT > getMat (const DT val)
 Return a matrix filled with values val.
static Tmat2< DT > getIdentity ()
 Return identity matrix.

Detailed Description

template<class DT>
class ml::Tmat2< DT >

A two by two matrix class consisting of 2 row vectors.

Definition at line 38 of file mlMatrix2.h.


Member Typedef Documentation

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

A typedef to "export" the type of components.

Reimplemented from ml::FloatingPointMatrix< Tvec2< DT >, 2 >.

Definition at line 43 of file mlMatrix2.h.


Constructor & Destructor Documentation

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

Construct matrix from 4 zero elements.

Definition at line 153 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Definition at line 162 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat2< DT >::Tmat2 ( const Tvec2< DT > &  row0,
const Tvec2< DT > &  row1 
) [inline]

Composes a matrix from the two vectors row0 and row1.

Definition at line 173 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Copy constructor from the Tmat2 mat.

Definition at line 184 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec2< DT >, 2 >::v.

template<class DT>
ml::Tmat2< DT >::Tmat2 ( const float  mat[4]) [inline]

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

Definition at line 194 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat2< DT >::Tmat2 ( const double  mat[4]) [inline]

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

Definition at line 203 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT>
ml::Tmat2< DT >::Tmat2 ( const DT  in00,
const DT  in01,
const DT  in10,
const DT  in11 
) [inline]

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

Definition at line 212 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.


Member Function Documentation

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

Apply method fct to all vectors of *this and return the matrix.

Definition at line 344 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Determinant.

Definition at line 325 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Return identity matrix.

Definition at line 298 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Return a matrix filled with values val.

Definition at line 279 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class DT >
void ml::Tmat2< DT >::getValues ( float  mat[4]) 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 251 of file mlMatrix2.h.

References ML_CATCH_RETHROW, ML_TRACE_IN_TIME_CRITICAL, and ML_TRY.

template<class DT >
void ml::Tmat2< DT >::getValues ( double  mat[4]) 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 266 of file mlMatrix2.h.

References ML_CATCH_RETHROW, ML_TRACE_IN_TIME_CRITICAL, and ML_TRY.

template<class DT >
Tmat2< DT > ml::Tmat2< DT >::inverse ( bool *  isInvertible = NULL) const
template<class DT>
const Tmat2< DT > & ml::Tmat2< DT >::operator*= ( const DT  d) [inline]

Multiplication by a constant d.

Definition at line 449 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Incrementation by a Tmat2.

Definition at line 427 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec2< DT >, 2 >::v.

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

Decrement by a Tmat2.

Definition at line 438 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec2< DT >, 2 >::v.

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

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

Definition at line 460 of file mlMatrix2.h.

References ML_CATCH_RETHROW, ML_TRACE_IN_TIME_CRITICAL, and ML_TRY.

template<class DT>
bool ml::Tmat2< DT >::operator< ( const Tmat2< 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 104 of file mlMatrix2.h.

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

Assignment of a Tmat2.

Definition at line 414 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec2< DT >, 2 >::v.

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

Set all values to val.

Definition at line 289 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

Set diagonal matrix with scale on diagonal.

Definition at line 307 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

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

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

Definition at line 236 of file mlMatrix2.h.

References ML_CATCH_RETHROW, ML_TRACE_IN_TIME_CRITICAL, and ML_TRY.

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

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

Definition at line 223 of file mlMatrix2.h.

References ML_CATCH_RETHROW, ML_TRACE_IN_TIME_CRITICAL, and ML_TRY.

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

Transpose.

Definition at line 334 of file mlMatrix2.h.

References ML_TRACE_IN_TIME_CRITICAL.

Referenced by ml::operator*().


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