A 4x4 matrix class implementation for use with the provided vertex types. More...
#include <Matrix4.hpp>
Public Types | |
using | ValueType = typename BaseVecT::CoordType |
Public Member Functions | |
ValueType | at (const int i) const |
Returns the element at the given index. More... | |
ValueType | det () |
Returns the matrix's determinant. More... | |
ValueType * | getData () |
Returns the internal data array. Unsafe. Will probably removed in one of the next versions. More... | |
std::vector< ValueType > | getVector () |
Matrix4< BaseVecT > | inv (bool &success) |
void | loadFromFile (string filename) |
Loads matrix values from a given file. More... | |
Matrix4 () | |
Default constructor. Initializes a identity matrix. More... | |
template<typename T > | |
Matrix4 (T *matrix) | |
Initializes a matrix wit the given data array. Ensure that the array has exactly 16 fields. More... | |
template<typename T > | |
Matrix4 (const Matrix4< T > &other) | |
Copy constructor. More... | |
template<typename T > | |
Matrix4 (T axis, ValueType angle) | |
Constructs a matrix from given axis and angle. Trys to avoid a gimbal lock. More... | |
template<typename T > | |
Matrix4 (const T &position, const T &angles) | |
Matrix4 (string filename) | |
Matrix4< BaseVecT > | operator* (const ValueType &scale) const |
Scales the matrix elemnts by the given factor. More... | |
template<typename T > | |
Matrix4< BaseVecT > | operator* (const Matrix4< T > &other) const |
Matrix-Matrix multiplication. Returns the new matrix. More... | |
template<typename T > | |
Matrix4< BaseVecT > | operator* (const T *&other) const |
Matrix-Matrix multiplication (array based). Mainly implemented for compatibility with other math libs. ensure that the used array has at least 16 elements to avoid memory access violations. More... | |
template<typename T > | |
T | operator* (const T &v) const |
Multiplication of Matrix and Vertex types. More... | |
template<typename T > | |
Normal< T > | operator* (const Normal< T > &v) const |
Multiplication of Matrix and Vertex types. More... | |
template<typename T > | |
void | operator*= (const T scale) |
Matrix scaling with self assignment. More... | |
template<typename T > | |
void | operator*= (const Matrix4< T > &other) |
Matrix-Matrix multiplication with self assigment. More... | |
template<typename T > | |
void | operator*= (const T *other) |
Matrix-Matrix multiplication (array based). See operator*}. More... | |
template<typename T > | |
Matrix4< BaseVecT > | operator+ (const Matrix4< T > &other) const |
Matrix addition operator. Returns a new matrix. More... | |
template<typename T > | |
Matrix4< BaseVecT > | operator+= (const Matrix4< T > &other) |
Matrix addition operator. More... | |
Matrix4 & | operator= (const Eigen::Matrix4d &mat) |
ValueType | operator[] (const int index) const |
Indexed element (reading) access. More... | |
ValueType & | operator[] (const int index) |
Writeable index access. More... | |
void | set (int i, ValueType value) |
Sets the given index of the Matrix's data field to the provided value. More... | |
Eigen::Matrix4d | toEigenMatrix () |
floatArr | toFloatArray () |
void | toPostionAngle (ValueType pose[6]) |
Computes an Euler representation (x, y, z) plus three rotation values in rad. Rotations are with respect to the x, y, z axes. More... | |
void | transpose () |
Transposes the current matrix. More... | |
~Matrix4 () | |
Public Attributes | |
ValueType | m [16] |
Private Member Functions | |
ValueType | det3 (const ValueType *M) |
Calculates the determinant of a 3x3 matrix. More... | |
void | submat (ValueType *submat, int i, int j) |
Returns a sub matrix without row i and column j. More... | |
A 4x4 matrix class implementation for use with the provided vertex types.
Definition at line 64 of file Matrix4.hpp.
using lvr2::Matrix4< BaseVecT >::ValueType = typename BaseVecT::CoordType |
Definition at line 67 of file Matrix4.hpp.
|
inline |
Default constructor. Initializes a identity matrix.
Definition at line 72 of file Matrix4.hpp.
|
inline |
Initializes a matrix wit the given data array. Ensure that the array has exactly 16 fields.
Definition at line 83 of file Matrix4.hpp.
|
inline |
Copy constructor.
Definition at line 92 of file Matrix4.hpp.
|
inline |
Constructs a matrix from given axis and angle. Trys to avoid a gimbal lock.
Definition at line 102 of file Matrix4.hpp.
|
inline |
Definition at line 176 of file Matrix4.hpp.
lvr2::Matrix4< BaseVecT >::Matrix4 | ( | string | filename | ) |
|
inline |
Definition at line 207 of file Matrix4.hpp.
ValueType lvr2::Matrix4< BaseVecT >::at | ( | const int | i | ) | const |
Returns the element at the given index.
|
inline |
Returns the matrix's determinant.
Definition at line 561 of file Matrix4.hpp.
|
inlineprivate |
Calculates the determinant of a 3x3 matrix.
M | input 3x3 matrix |
Definition at line 622 of file Matrix4.hpp.
|
inline |
Returns the internal data array. Unsafe. Will probably removed in one of the next versions.
Definition at line 513 of file Matrix4.hpp.
|
inline |
Definition at line 525 of file Matrix4.hpp.
|
inline |
Definition at line 574 of file Matrix4.hpp.
|
inline |
Loads matrix values from a given file.
Definition at line 470 of file Matrix4.hpp.
|
inline |
Scales the matrix elemnts by the given factor.
Definition at line 267 of file Matrix4.hpp.
|
inline |
Matrix-Matrix multiplication. Returns the new matrix.
Definition at line 281 of file Matrix4.hpp.
|
inline |
Matrix-Matrix multiplication (array based). Mainly implemented for compatibility with other math libs. ensure that the used array has at least 16 elements to avoid memory access violations.
Definition at line 341 of file Matrix4.hpp.
|
inline |
Multiplication of Matrix and Vertex types.
Definition at line 367 of file Matrix4.hpp.
|
inline |
Multiplication of Matrix and Vertex types.
Definition at line 385 of file Matrix4.hpp.
|
inline |
Matrix scaling with self assignment.
Definition at line 486 of file Matrix4.hpp.
|
inline |
Matrix-Matrix multiplication with self assigment.
Definition at line 495 of file Matrix4.hpp.
|
inline |
Matrix-Matrix multiplication (array based). See operator*}.
Definition at line 504 of file Matrix4.hpp.
|
inline |
Matrix addition operator. Returns a new matrix.
Definition at line 308 of file Matrix4.hpp.
|
inline |
Matrix addition operator.
Definition at line 322 of file Matrix4.hpp.
|
inline |
Definition at line 212 of file Matrix4.hpp.
|
inline |
|
inline |
Writeable index access.
Definition at line 553 of file Matrix4.hpp.
|
inline |
Sets the given index of the Matrix's data field to the provided value.
i | Field index of the matrix |
value | new value |
Definition at line 401 of file Matrix4.hpp.
|
inlineprivate |
Returns a sub matrix without row i and column j.
Definition at line 601 of file Matrix4.hpp.
|
inline |
Definition at line 237 of file Matrix4.hpp.
|
inline |
Definition at line 515 of file Matrix4.hpp.
|
inline |
Computes an Euler representation (x, y, z) plus three rotation values in rad. Rotations are with respect to the x, y, z axes.
Definition at line 433 of file Matrix4.hpp.
|
inline |
Transposes the current matrix.
Definition at line 406 of file Matrix4.hpp.
ValueType lvr2::Matrix4< BaseVecT >::m[16] |
Definition at line 594 of file Matrix4.hpp.