MeVisLab Toolbox Reference
ml::Tmat5< DT > Class Template Reference

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

#include <mlMatrix5.h>

Inheritance diagram for ml::Tmat5< DT >:
ml::FloatingPointMatrix< Tvec5< DT >, 5 >

Public Types

typedef DT ComponentType
 A typedef to "export" the type of components. More...
 
- Public Types inherited from ml::FloatingPointMatrix< Tvec5< DT >, 5 >
enum  
 This enum grants access to the row count during compile time, e.g. More...
 
enum  
 This enum grants access to the row count during compile time, e.g. More...
 
enum  
 This enum grants access to the number of values in the matrix, e.g. More...
 
typedef VectorT::ComponentType ComponentType
 A typedef to "export" the type of sub-components. More...
 
typedef Tvec5< DT > VectorType
 A typedef to "export" the type of component vector. More...
 

Public Member Functions

 Tmat5 ()
 Builds a 5x5 matrix from 25 0 elements. More...
 
 Tmat5 (const DT diagValue)
 
 Tmat5 (const Tvec5< DT > &row0, const Tvec5< DT > &row1, const Tvec5< DT > &row2, const Tvec5< DT > &row3, const Tvec5< DT > &row4)
 Builds a matrix of the five row vectors row0, ..., row4. More...
 
 Tmat5 (const Tmat5< DT > &mat)
 Copy constructor from the Tmat5 mat. More...
 
 Tmat5 (const float mat[25])
 Constructor from 25 floats given as array mat, row by row. More...
 
 Tmat5 (const double mat[25])
 Constructor from 25 doubles given as array mat, row by row. More...
 
 Tmat5 (const double in00, const double in01, const double in02, const double in03, const double in04, const double in10, const double in11, const double in12, const double in13, const double in14, const double in20, const double in21, const double in22, const double in23, const double in24, const double in30, const double in31, const double in32, const double in33, const double in34, const double in40, const double in41, const double in42, const double in43, const double in44)
 Initializes all matrix elements explicitly with scalars, filling it row by row. More...
 
void setValues (const float m[25])
 Copies the contents from float array m into *this. More...
 
void getValues (float m[25]) const
 Copies the contents of *this into float array m. More...
 
void setValues (const double m[25])
 Copies the contents of m into *this, where m must provide at least 25 accessible entries, row by row. More...
 
void getValues (double m[25]) const
 Copies the contents of *this into m, where m must provide at least 25 accessible entries, row by row. More...
 
void setScaleMatrix (const DT scale)
 Sets the diagonal matrix with scale on diagonal. More...
 
void set (const DT val)
 Sets all values to val. More...
 
bool operator< (const Tmat5< DT > &) const
 Dummy "lesser than operator" which always returns false. More...
 
const Tmat5< DT > & operator= (const Tmat5< DT > &m)
 Assigns by a Tmat5. More...
 
const Tmat5< DT > & operator+= (const Tmat5< DT > &m)
 Adds component wise by a Tmat5. More...
 
const Tmat5< DT > & operator-= (const Tmat5< DT > &m)
 Subtracts component wise by a Tmat5. More...
 
const Tmat5< DT > & operator*= (const DT d)
 Multiplies by a constant. More...
 
const Tmat5< DT > & operator/= (const DT d)
 Divide by a constant. Division by zero is not handled and must be avoided by caller. More...
 
- Public Member Functions inherited from ml::FloatingPointMatrix< Tvec5< DT >, 5 >
const Tvec5< DT > & operator[] (const size_t i) const
 
Tvec5< DT > & operator[] (const size_t i)
 
ComponentTypelinearIndexed (const size_t idx)
 
ComponentType linearIndexedConst (const size_t idx) const
 
ComponentType compAbsSum () const
 
void setValuesFromPtr (const ComponentType *const values)
 Copies contents from array mat into *this, row by row; type and size must match. More...
 
void getValuesToPtr (ComponentType *values) const
 Copies contents of *this into array mat, row by row; type and size must match. More...
 

Static Public Member Functions

static Tmat5< DT > getMat (const double val)
 Returns a matrix filled with values val, row by row. More...
 

Special Functions

DT determinantLower4 (const int col1, const int col2, const int col3, const int col4) const
 Determines the (sub)determinant of columns given by col1, col2, col3 and col4. More...
 
DT det () const
 Returns the determinant of this matrix. More...
 
Tmat5< DT > inverse (bool *isInvertible=nullptr) const
 Returns the inverse. More...
 
Tmat5 transpose () const
 Returns the transposed of this matrix. More...
 
const Tmat5< DT > & apply (MLDblFuncPtr fct)
 Applies the function fct to each component. More...
 
static Tmat5 getIdentity ()
 Returns the identity matrix. More...
 

Additional Inherited Members

- Protected Attributes inherited from ml::FloatingPointMatrix< Tvec5< DT >, 5 >
Tvec5< DT > v [size]
 The rows constituting the matrix. More...
 

Detailed Description

template<class DT>
class ml::Tmat5< DT >

A five by five matrix class of five row vectors.

Definition at line 48 of file mlMatrix5.h.

Member Typedef Documentation

◆ ComponentType

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

A typedef to "export" the type of components.

Definition at line 53 of file mlMatrix5.h.

Constructor & Destructor Documentation

◆ Tmat5() [1/7]

template<class DT >
ml::Tmat5< DT >::Tmat5
inline

Builds a 5x5 matrix from 25 0 elements.

Definition at line 166 of file mlMatrix5.h.

◆ Tmat5() [2/7]

template<class DT >
ml::Tmat5< DT >::Tmat5 ( const DT  diagValue)
inline

Definition at line 173 of file mlMatrix5.h.

◆ Tmat5() [3/7]

template<class DT >
ml::Tmat5< DT >::Tmat5 ( const Tvec5< DT > &  row0,
const Tvec5< DT > &  row1,
const Tvec5< DT > &  row2,
const Tvec5< DT > &  row3,
const Tvec5< DT > &  row4 
)
inline

Builds a matrix of the five row vectors row0, ..., row4.

Definition at line 183 of file mlMatrix5.h.

◆ Tmat5() [4/7]

template<class DT >
ml::Tmat5< DT >::Tmat5 ( const Tmat5< DT > &  mat)
inline

Copy constructor from the Tmat5 mat.

Definition at line 195 of file mlMatrix5.h.

References ml::FloatingPointMatrix< VectorT, size >::v.

◆ Tmat5() [5/7]

template<class DT >
ml::Tmat5< DT >::Tmat5 ( const float  mat[25])
inline

Constructor from 25 floats given as array mat, row by row.

Definition at line 206 of file mlMatrix5.h.

◆ Tmat5() [6/7]

template<class DT >
ml::Tmat5< DT >::Tmat5 ( const double  mat[25])
inline

Constructor from 25 doubles given as array mat, row by row.

Definition at line 213 of file mlMatrix5.h.

◆ Tmat5() [7/7]

template<class DT >
ml::Tmat5< DT >::Tmat5 ( const double  in00,
const double  in01,
const double  in02,
const double  in03,
const double  in04,
const double  in10,
const double  in11,
const double  in12,
const double  in13,
const double  in14,
const double  in20,
const double  in21,
const double  in22,
const double  in23,
const double  in24,
const double  in30,
const double  in31,
const double  in32,
const double  in33,
const double  in34,
const double  in40,
const double  in41,
const double  in42,
const double  in43,
const double  in44 
)

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

Definition at line 366 of file mlMatrix5.h.

References DCMTree::DT.

Member Function Documentation

◆ apply()

template<class DT >
const Tmat5< DT > & ml::Tmat5< DT >::apply ( MLDblFuncPtr  fct)

Applies the function fct to each component.

Definition at line 637 of file mlMatrix5.h.

◆ det()

template<class DT >
DT ml::Tmat5< DT >::det

Returns the determinant of this matrix.

Definition at line 573 of file mlMatrix5.h.

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

◆ determinantLower4()

template<class DT >
DT ml::Tmat5< DT >::determinantLower4 ( const int  col1,
const int  col2,
const int  col3,
const int  col4 
) const
inline

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

Definition at line 560 of file mlMatrix5.h.

References ml::Tmat4< DT >::det().

◆ getIdentity()

template<class DT >
Tmat5< DT > ml::Tmat5< DT >::getIdentity
inlinestatic

Returns the identity matrix.

Definition at line 624 of file mlMatrix5.h.

◆ getMat()

template<class DT >
Tmat5< DT > ml::Tmat5< DT >::getMat ( const double  val)
inlinestatic

Returns a matrix filled with values val, row by row.

Definition at line 220 of file mlMatrix5.h.

◆ getValues() [1/2]

template<class DT >
void ml::Tmat5< DT >::getValues ( double  m[25]) const

Copies the contents of *this into m, where m must provide at least 25 accessible entries, row by row.

Definition at line 501 of file mlMatrix5.h.

◆ getValues() [2/2]

template<class DT >
void ml::Tmat5< DT >::getValues ( float  m[25]) const

Copies the 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 25 accessible entries, row by row.

Definition at line 425 of file mlMatrix5.h.

◆ inverse()

template<class DT >
Tmat5< DT > ml::Tmat5< DT >::inverse ( bool *  isInvertible = nullptr) 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 592 of file mlMatrix5.h.

References DCMTree::DT, and ml::MLInverseMatHelper().

◆ operator*=()

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

Multiplies by a constant.

Definition at line 279 of file mlMatrix5.h.

◆ operator+=()

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

Adds component wise by a Tmat5.

Definition at line 253 of file mlMatrix5.h.

References ml::FloatingPointMatrix< VectorT, size >::v.

◆ operator-=()

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

Subtracts component wise by a Tmat5.

Definition at line 266 of file mlMatrix5.h.

References ml::FloatingPointMatrix< VectorT, size >::v.

◆ operator/=()

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

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

Definition at line 292 of file mlMatrix5.h.

References ML_CHECK_FLOAT_THROW.

◆ operator<()

template<class DT >
bool ml::Tmat5< DT >::operator< ( const Tmat5< 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 111 of file mlMatrix5.h.

◆ operator=()

template<class DT >
const Tmat5< DT > & ml::Tmat5< DT >::operator= ( const Tmat5< DT > &  m)
inline

Assigns by a Tmat5.

Definition at line 238 of file mlMatrix5.h.

References ml::FloatingPointMatrix< VectorT, size >::v.

◆ set()

template<class DT >
void ml::Tmat5< DT >::set ( const DT  val)
inline

Sets all values to val.

Definition at line 231 of file mlMatrix5.h.

◆ setScaleMatrix()

template<class DT >
void ml::Tmat5< DT >::setScaleMatrix ( const DT  scale)

Sets the diagonal matrix with scale on diagonal.

Definition at line 539 of file mlMatrix5.h.

◆ setValues() [1/2]

template<class DT >
void ml::Tmat5< DT >::setValues ( const double  m[25])

Copies the contents of m into *this, where m must provide at least 25 accessible entries, row by row.

Definition at line 463 of file mlMatrix5.h.

References DCMTree::DT.

◆ setValues() [2/2]

template<class DT >
void ml::Tmat5< DT >::setValues ( const float  m[25])

Copies the contents from float array m into *this.

m must point to an array with at least 25 valid entries, row by row.

Definition at line 385 of file mlMatrix5.h.

References DCMTree::DT.

◆ transpose()

template<class DT >
Tmat5< DT > ml::Tmat5< DT >::transpose
inline

Returns the transposed of this matrix.

Definition at line 611 of file mlMatrix5.h.

Referenced by ml::operator*().


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