MeVisLab Toolbox Reference
|
A four by four matrix class consisting of 4 row vectors. More...
#include <mlMatrix4.h>
Public Types | |
typedef DT | ComponentType |
A typedef to "export" the type of components. | |
Public Types inherited from ml::FloatingPointMatrix< Tvec4< DT >, 4 > | |
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. | |
typedef Tvec4< DT > | VectorType |
A typedef to "export" the type of component vector. | |
Public Member Functions | |
Tvec3< DT > | transformPoint (const Tvec3< DT > &sourceVec) const |
Transforms the given sourceVec and returns the result vector. | |
bool | operator< (const Tmat4< DT > &) const |
Dummy "lesser than operator" which always returns false. | |
template<class IDX_TYP > | |
DT | determinantLower3 (const IDX_TYP col1, const IDX_TYP col2, const IDX_TYP col3) const |
Public Member Functions inherited from ml::FloatingPointMatrix< Tvec4< DT >, 4 > | |
const Tvec4< DT > & | operator[] (const size_t i) const |
Tvec4< DT > & | operator[] (const size_t i) |
ComponentType & | linearIndexed (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. | |
void | getValuesToPtr (ComponentType *values) const |
Copies contents of *this into array mat, row by row; type and size must match. | |
Constructors, set and get functionality of class Tmat4. | |
Tmat4 () | |
Constructs a matrix from 16 zero elements. | |
Tmat4 (const DT diagValue) | |
Tmat4 (const Tvec4< DT > &row0, const Tvec4< DT > &row1, const Tvec4< DT > &row2, const Tvec4< DT > &row3) | |
Composes a matrix from the four vectors row0, row1, row2 and row3. | |
Tmat4 (const Tmat4< DT > &mat) | |
Copy constructor from the Tmat4 mat. | |
Tmat4 (const float mat[16]) | |
Constructor from 16 floating point values in an array given by mat, row by row. | |
Tmat4 (const double mat[16]) | |
Constructor from 16 double values in an array given by mat, row by row. | |
Tmat4< DT > | getRotationMatrix () const |
Returns the rotational part of the matrix (removes scaling and translation). | |
void | set (const DT val) |
Sets all values to double val. | |
const Tmat4< DT > & | operator= (const Tmat4< DT > &m) |
Assigns from a Tmat4. | |
const Tmat4< DT > & | operator+= (const Tmat4< DT > &m) |
Increments by a Tmat4. | |
const Tmat4< DT > & | operator-= (const Tmat4< DT > &m) |
Decrements by a Tmat4. | |
const Tmat4< DT > & | operator*= (const DT d) |
Multiplies by an MLdouble constant d. | |
const Tmat4< DT > & | operator/= (const DT d) |
Divides by an MLdouble constant d. Division by zero is not handled and must be avoided by caller. | |
const Tmat4< DT > & | apply (MLDblFuncPtr fct) |
Applies the function fct to all vectors of *this and return the matrix. | |
static Tmat4< DT > | getMat (const double val) |
Returns a matrix filled with values val. | |
Tmat4<DT> member functions | |
Tmat4 (const double in00, const double in01, const double in02, const double in03, const double in10, const double in11, const double in12, const double in13, const double in20, const double in21, const double in22, const double in23, const double in30, const double in31, const double in32, const double in33) | |
Initializes all matrix elements explicitly with scalars, row by row. | |
Tmat4 (const Tvec3< DT > &n0, const Tvec3< DT > &n1, const Tvec3< DT > &n3, const Tvec3< DT > &t) | |
Constructs a matrix from three base vectors and translation (as COLUMN vectors) | |
void | setValues (const float mat[16]) |
Copies the contents of mat into *this, row by row. | |
void | getValues (float mat[16]) const |
Copies the contents of *this into floating point matrix mat, row by row. | |
void | setValues (const double mat[16]) |
Copies the contents of mat into *this, row by row. | |
void | getValues (double mat[16]) const |
Copies the contents of *this into mat, row by row. | |
void | setScaleMatrix (const DT scale) |
Sets a diagonal matrix with scale on diagonal. | |
DT | det3 (DT A, DT B, DT C, DT D, DT E, DT F, DT G, DT H, DT I) const |
Determines the determinant of a 3x3 matrix given by A,B,C,D,E,F,G,H,I. | |
DT | det () const |
Returns the determinant of *this. | |
Tmat4< DT > | transpose () const |
Returns the transposed *this. | |
Tmat4< DT > | inverse (bool *isInvertible=nullptr) const |
Returns the inverse Gauss-Jordan elimination with partial pivoting. | |
static Tmat4< DT > | getIdentity () |
Returns the identity matrix. | |
Additional Inherited Members | |
Protected Attributes inherited from ml::FloatingPointMatrix< Tvec4< DT >, 4 > | |
Tvec4< DT > | v [size] |
The rows constituting the matrix. | |
A four by four matrix class consisting of 4 row vectors.
Definition at line 35 of file mlMatrix4.h.
A typedef to "export" the type of components.
Definition at line 40 of file mlMatrix4.h.
Constructs a matrix from 16 zero elements.
Definition at line 179 of file mlMatrix4.h.
References mlrange_cast().
Definition at line 186 of file mlMatrix4.h.
References mlrange_cast().
|
inline |
Composes a matrix from the four vectors row0, row1, row2 and row3.
Definition at line 195 of file mlMatrix4.h.
References mlrange_cast().
Copy constructor from the Tmat4 mat.
Definition at line 205 of file mlMatrix4.h.
References mlrange_cast(), and ml::FloatingPointMatrix< VectorT, size >::v.
Constructor from 16 floating point values in an array given by mat, row by row.
Definition at line 215 of file mlMatrix4.h.
References mlrange_cast().
Constructor from 16 double values in an array given by mat, row by row.
Definition at line 222 of file mlMatrix4.h.
References mlrange_cast().
ml::Tmat4< DT >::Tmat4 | ( | const double | in00, |
const double | in01, | ||
const double | in02, | ||
const double | in03, | ||
const double | in10, | ||
const double | in11, | ||
const double | in12, | ||
const double | in13, | ||
const double | in20, | ||
const double | in21, | ||
const double | in22, | ||
const double | in23, | ||
const double | in30, | ||
const double | in31, | ||
const double | in32, | ||
const double | in33 ) |
Initializes all matrix elements explicitly with scalars, row by row.
Definition at line 471 of file mlMatrix4.h.
References mlrange_cast().
|
inline |
Constructs a matrix from three base vectors and translation (as COLUMN vectors)
Definition at line 443 of file mlMatrix4.h.
References mlrange_cast().
|
inline |
Applies the function fct to all vectors of *this and return the matrix.
Definition at line 329 of file mlMatrix4.h.
References ml::Tmat4< DT >::apply(), and mlrange_cast().
Referenced by ml::Tmat4< DT >::apply().
Returns the determinant of *this.
Definition at line 560 of file mlMatrix4.h.
|
inline |
Definition at line 140 of file mlMatrix4.h.
References mlrange_cast().
Returns a matrix filled with values val.
Definition at line 229 of file mlMatrix4.h.
References mlrange_cast().
Returns the rotational part of the matrix (removes scaling and translation).
Definition at line 238 of file mlMatrix4.h.
References mlrange_cast().
Copies the contents of *this into mat, row by row.
Note that range and precision of the float values may not be sufficient for long double matrix contents.
Definition at line 526 of file mlMatrix4.h.
References mlrange_cast().
Copies the contents of *this into floating point matrix mat, row by row.
Note that range and precision of the float values may not be sufficient for double or long double matrix contents.
Definition at line 500 of file mlMatrix4.h.
References mlrange_cast().
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 686 of file mlMatrix4.h.
References ml::MLInverseMatHelper(), and mlrange_cast().
Multiplies by an MLdouble constant d.
Definition at line 307 of file mlMatrix4.h.
Increments by a Tmat4.
Definition at line 285 of file mlMatrix4.h.
References mlrange_cast(), and ml::FloatingPointMatrix< VectorT, size >::v.
Decrements by a Tmat4.
Definition at line 296 of file mlMatrix4.h.
References mlrange_cast(), and ml::FloatingPointMatrix< VectorT, size >::v.
Divides by an MLdouble constant d. Division by zero is not handled and must be avoided by caller.
Definition at line 318 of file mlMatrix4.h.
Dummy "lesser than operator" which always returns false.
It is needed to make class work with some STL containers on VC7.
Definition at line 113 of file mlMatrix4.h.
Assigns from a Tmat4.
Definition at line 272 of file mlMatrix4.h.
References mlrange_cast(), and ml::FloatingPointMatrix< VectorT, size >::v.
Sets all values to double val.
Definition at line 265 of file mlMatrix4.h.
References mlrange_cast().
Sets a diagonal matrix with scale on diagonal.
Definition at line 538 of file mlMatrix4.h.
Copies the contents of mat into *this, row by row.
Definition at line 512 of file mlMatrix4.h.
References mlrange_cast().
Copies the contents of mat into *this, row by row.
Definition at line 486 of file mlMatrix4.h.
References mlrange_cast().
|
inline |
Transforms the given sourceVec and returns the result vector.
Definition at line 94 of file mlMatrix4.h.
References mlrange_cast().
Returns the transposed *this.
Definition at line 572 of file mlMatrix4.h.
References mlrange_cast().
Referenced by ml::operator*(), and ml::operator*().