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

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

#include <mlMatrix6.h>

Inheritance diagram for ml::Tmat6< DT >:
ml::FloatingPointMatrix< Tvec6< DT >, 6 >

Public Types

typedef DT ComponentType
 A typedef to "export" the type of components. More...
 
- Public Types inherited from ml::FloatingPointMatrix< Tvec6< DT >, 6 >
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 Tvec6< DT > VectorType
 A typedef to "export" the type of component vector. More...
 

Public Member Functions

bool operator< (const Tmat6< DT > &) const
 Dummy "lesser than operator" which always returns false. More...
 
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)
 Initializes all matrix elements explicitly with scalars, filling it row by row. More...
 
void setValues (const float m[36])
 Copies the contents from float array m into *this. More...
 
void getValues (float m[36]) const
 Copies the contents of *this into float array m. More...
 
void setValues (const double m[36])
 Copies the contents of m into *this, where m must provide at least 36 accessible entries. More...
 
void getValues (double m[36]) const
 Copies the contents of *this into m, where m must provide at least 36 accessible entries. More...
 
void setScaleMatrix (const DT scale)
 Sets the diagonal matrix with scale on diagonal. More...
 
- Public Member Functions inherited from ml::FloatingPointMatrix< Tvec6< DT >, 6 >
const Tvec6< DT > & operator[] (const size_t i) const
 
Tvec6< 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...
 

Constructors, set and get functionality.

 Tmat6 ()
 Builds a 6x6 matrix from 36 0 elements. More...
 
 Tmat6 (const DT diagValue)
 
 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)
 Builds a matrix of the six row vectors row0, ..., row5. More...
 
 Tmat6 (const Tmat6< DT > &m)
 Copy constructor from the Tmat6 mat. More...
 
 Tmat6 (const float mat[36])
 Constructor from 36 floats given as array mat. More...
 
 Tmat6 (const double mat[36])
 Constructor from 36 doubles given as array mat. More...
 
void set (const DT val)
 Sets all values to val. More...
 
const Tmat6< DT > & operator= (const Tmat6< DT > &m)
 Assignment of a Tmat6. More...
 
const Tmat6< DT > & operator+= (const Tmat6< DT > &m)
 Adds component wise by a Tmat6. More...
 
const Tmat6< DT > & operator-= (const Tmat6< DT > &m)
 Subtracts component wise by a Tmat6. More...
 
const Tmat6< DT > & operator*= (const DT d)
 Multiplies by a constant. More...
 
const Tmat6< DT > & operator/= (const DT d)
 Divides by a constant. Division by zero is not handled and must be avoided by caller. More...
 
static Tmat6< DT > getMat (const double val)
 Returns a matrix filled with values val. More...
 

Special Functions

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

Additional Inherited Members

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

Detailed Description

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

A six by six matrix class of six row vectors.

Definition at line 36 of file mlMatrix6.h.

Member Typedef Documentation

◆ ComponentType

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

A typedef to "export" the type of components.

Definition at line 41 of file mlMatrix6.h.

Constructor & Destructor Documentation

◆ Tmat6() [1/7]

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

Builds a 6x6 matrix from 36 0 elements.

Definition at line 156 of file mlMatrix6.h.

◆ Tmat6() [2/7]

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

Definition at line 163 of file mlMatrix6.h.

◆ Tmat6() [3/7]

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

Builds a matrix of the six row vectors row0, ..., row5.

Definition at line 172 of file mlMatrix6.h.

◆ Tmat6() [4/7]

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

Copy constructor from the Tmat6 mat.

Definition at line 185 of file mlMatrix6.h.

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

◆ Tmat6() [5/7]

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

Constructor from 36 floats given as array mat.

Definition at line 197 of file mlMatrix6.h.

◆ Tmat6() [6/7]

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

Constructor from 36 doubles given as array mat.

Definition at line 204 of file mlMatrix6.h.

◆ Tmat6() [7/7]

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 
)

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

Definition at line 364 of file mlMatrix6.h.

References DCMTree::DT.

Member Function Documentation

◆ apply()

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

Applies the function fct to each component.

Definition at line 548 of file mlMatrix6.h.

◆ det()

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

Returns the determinant of this matrix.

Definition at line 481 of file mlMatrix6.h.

◆ determinantLower5()

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

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

Definition at line 467 of file mlMatrix6.h.

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

◆ getIdentity()

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

Returns the identity matrix.

Definition at line 534 of file mlMatrix6.h.

◆ getMat()

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

Returns a matrix filled with values val.

Definition at line 211 of file mlMatrix6.h.

◆ getValues() [1/2]

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

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

Definition at line 432 of file mlMatrix6.h.

◆ getValues() [2/2]

template<class DT >
void ml::Tmat6< DT >::getValues ( float  m[36]) 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 36 accessible entries.

Definition at line 402 of file mlMatrix6.h.

◆ inverse()

template<class DT >
Tmat6< DT > ml::Tmat6< 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 501 of file mlMatrix6.h.

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

◆ operator*=()

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

Multiplies by a constant.

Definition at line 274 of file mlMatrix6.h.

◆ operator+=()

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

Adds component wise by a Tmat6.

Definition at line 246 of file mlMatrix6.h.

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

◆ operator-=()

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

Subtracts component wise by a Tmat6.

Definition at line 260 of file mlMatrix6.h.

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

◆ operator/=()

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

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

Definition at line 288 of file mlMatrix6.h.

References ML_CHECK_THROW, and MLValueIs0WOM().

◆ operator<()

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 100 of file mlMatrix6.h.

◆ operator=()

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

Assignment of a Tmat6.

Definition at line 230 of file mlMatrix6.h.

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

◆ set()

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

Sets all values to val.

Definition at line 223 of file mlMatrix6.h.

◆ setScaleMatrix()

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

Sets the diagonal matrix with scale on diagonal.

Definition at line 447 of file mlMatrix6.h.

◆ setValues() [1/2]

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

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

Definition at line 417 of file mlMatrix6.h.

References DCMTree::DT.

◆ setValues() [2/2]

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

Copies the contents from float array m into *this.

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

Definition at line 385 of file mlMatrix6.h.

References DCMTree::DT.

◆ transpose()

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

Returns the transposed of this matrix.

Definition at line 520 of file mlMatrix6.h.

Referenced by ml::operator*().


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