|
MorphoGraphX
2.0-1-227
|
#include <Matrix.hpp>
Public Types | |
| typedef T | value_type |
| typedef T & | reference_type |
| typedef T * | pointer_type |
| typedef T * | iterator |
Public Member Functions | |
| CU_HOST_DEVICE | Matrix (void) |
| Create a matrix filled with 0s. More... | |
| template<typename T1 > | |
| CU_HOST_DEVICE | Matrix (const Matrix< nRows, nCols, T1 > &mat) |
| Copy a matrix. More... | |
| template<typename T1 > | |
| CU_HOST_DEVICE | Matrix (const Vector< nCols, T1 > *vecs) |
| Fill the matrix with the array of vectors. More... | |
| template<typename T1 > | |
| CU_HOST_DEVICE | Matrix (const Vector< nCols, T1 > &r0, const Vector< nCols, T1 > &r1, const Vector< nCols, T1 > &r2) |
| Initialize a 3 row matrix. More... | |
| template<typename T1 > | |
| CU_HOST_DEVICE | Matrix (const T1 *values) |
Fill in the matrix with the values. More... | |
| CU_HOST_DEVICE | Matrix (const T *values) |
Fill in the matrix with the values. More... | |
| CU_HOST_DEVICE | Matrix (const T &value) |
| Create a diagonal matrix. More... | |
| const CU_HOST_DEVICE T * | c_data () const |
| Returns a constant raw pointer on the data. More... | |
| CU_HOST_DEVICE T * | data () |
| Returns a raw pointer on the data. More... | |
| CU_HOST_DEVICE Matrix | operator- (void) const |
| Matrix subtraction. More... | |
| CU_HOST_DEVICE Matrix | operator+ (const Matrix &mat) const |
| Matrix addition. More... | |
| CU_HOST_DEVICE Matrix | operator- (const Matrix &mat) const |
| CU_HOST_DEVICE Matrix | operator* (const T &scalar) const |
| Matrix-scalar multiplication. More... | |
| CU_HOST_DEVICE Matrix | operator/ (const T &scalar) const |
| Matrix-scalar division. More... | |
| CU_HOST_DEVICE Vector< nRows, T > | operator* (const Vector< nCols, T > &vec) const |
| Matrix*Column Vector. More... | |
| CU_HOST_DEVICE Matrix & | operator= (const Matrix &mat) |
| CU_HOST_DEVICE Matrix & | operator+= (const Matrix &mat) |
| CU_HOST_DEVICE Matrix & | operator-= (const Matrix &mat) |
| CU_HOST_DEVICE Matrix & | operator*= (const T &scalar) |
| CU_HOST_DEVICE Matrix & | operator/= (const T &scalar) |
| CU_HOST_DEVICE Matrix & | operator*= (const Matrix &mat) |
| CU_HOST_DEVICE bool | operator== (const Matrix &mat) const |
| Element-wise equality. More... | |
| CU_HOST_DEVICE bool | operator!= (const Matrix &mat) const |
| Element-wise inequality. More... | |
| CU_HOST_DEVICE bool | operator< (const Matrix &other) const |
| Comparison operator. More... | |
| CU_HOST_DEVICE Vector< nCols, T > & | operator[] (size_t idx) |
| Returns the nth row. More... | |
| CU_HOST_DEVICE Vector< nCols, T > | operator[] (size_t idx) const |
| Returns the nth row. More... | |
| CU_HOST_DEVICE T & | operator() (size_t i, size_t j) |
Return the value at row i, column j. More... | |
| CU_HOST_DEVICE T | operator() (size_t i, size_t j) const |
Return the value at row i, column j. More... | |
| CU_HOST_DEVICE Matrix & | zero (void) |
| Set the matrix to all zero. More... | |
| CU_HOST_DEVICE Matrix & | operator= (const T &value) |
| Set the matrix to a diagonal matrix. More... | |
| CU_HOST_DEVICE Matrix< nCols, nRows, T > | operator~ () |
| Transpose the matrix. More... | |
| CU_HOST_DEVICE T | trace () const |
| Trace of the matrix. More... | |
| CU_HOST_DEVICE void | fillArray (T *array) |
| CU_HOST_DEVICE Vector< nRows, T > | diag () const |
| Return the diagonal vector, if the matrix is square. More... | |
Static Public Member Functions | |
| static CU_HOST_DEVICE Vector< 2, size_t > | size () |
| Returns the size of the matrix. More... | |
| static CU_HOST_DEVICE size_t | nbRows () |
| Returns the number of rows of the matrix. More... | |
| static CU_HOST_DEVICE size_t | nbColumns () |
| Returns the number of columns of the matrix. More... | |
| static CU_HOST_DEVICE Matrix | identity () |
| Returns an identity matrix. More... | |
| static CU_HOST_DEVICE Matrix< 3, 3, T > | rotation (const Vector< 3, T > &direction, T angle) |
| Creates the 3x3 matrix corresponding to a rotation. More... | |
| static CU_HOST_DEVICE Matrix< 4, 4, T > | rotation (const Vector< 4, T > &direction, T angle) |
| Creates the 4x4 matrix corresponding to a rotation. More... | |
Public Attributes | |
| const typedef T & | const_reference_type |
| const typedef T * | const_pointer_type |
| const typedef T * | const_iterator |
Static Public Attributes | |
| static const size_t | numcols |
| static const size_t | numrows |
Friends | |
| CU_HOST_DEVICE friend Matrix | operator* (const T &scalar, const Matrix &mat) |
| Matrix-scalar multiplication. More... | |
| QTextStream & | operator<< (QTextStream &out, const Matrix &mat) |
| QTextStream & | operator>> (QTextStream &in, Matrix &mat) |
| CU_HOST_DEVICE friend std::ostream & | operator<< (std::ostream &out, const Matrix &mat) |
| CU_HOST_DEVICE friend std::istream & | operator>> (std::istream &in, Matrix &mat) |
Related Functions | |
(Note that these are not member functions.) | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Vector< nCols, T > | operator* (const Vector< nCols, T > &vec, const Matrix< nRows, nCols, T > &mat) |
| Row-Vector - Matrix multipliation. More... | |
| template<size_t nRows, size_t nSize, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | operator* (const Matrix< nRows, nSize, T > &mat1, const Matrix< nSize, nCols, T > &mat2) |
| Matrix multiplication. More... | |
| template<typename T > | |
| T CU_HOST_DEVICE | det (const Matrix< 1, 1, T > &mat) |
| Determinant of the matrix. More... | |
| template<typename T > | |
| T CU_HOST_DEVICE | det (const Matrix< 2, 2, T > &mat) |
| Determinant of the matrix. More... | |
| template<typename T > | |
| T CU_HOST_DEVICE | det (const Matrix< 3, 3, T > &mat) |
| Determinant of the matrix. More... | |
| template<size_t nRows, typename T > | |
| T CU_HOST_DEVICE | det (const Matrix< nRows, nRows, T > &mat) |
| Determinant of the matrix. More... | |
| template<size_t nRows, typename T > | |
| CU_HOST_DEVICE T | cofactor (const Matrix< nRows, nRows, T > &mat, size_t i, size_t j) |
| Returns the cofactor of the matrix for position (i,j) More... | |
| template<typename T > | |
| CU_HOST_DEVICE Matrix< 1, 1, T > | inverse (const Matrix< 1, 1, T > &mat) |
| Inverse the matrix. More... | |
| template<typename T > | |
| CU_HOST_DEVICE Matrix< 2, 2, T > | inverse (const Matrix< 2, 2, T > &mat) |
| Inverse the matrix. More... | |
| template<typename T > | |
| CU_HOST_DEVICE Matrix< 3, 3, T > | inverse (const Matrix< 3, 3, T > &mat) |
| Inverse the matrix. More... | |
| template<typename T > | |
| CU_HOST_DEVICE Matrix< 4, 4, T > | inverse (const Matrix< 4, 4, T > &mat) |
| Inverse the matrix. More... | |
| template<size_t nRows, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nRows, T > | inverse (const Matrix< nRows, nRows, T > &mat) |
| Inverse the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nCols, nRows, T > | transpose (const Matrix< nRows, nCols, T > &mat) |
| Transpose a matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE T | norm (const Matrix< nRows, nCols, T > &mat) |
| Return the norm of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE T | normsq (const Matrix< nRows, nCols, T > &mat) |
| Return the square norm of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (const T &(*fct)(const T &), const Matrix< nRows, nCols, T > &m) |
| Apply a unary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(T), const Matrix< nRows, nCols, T > &m) |
| Apply a unary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(const T &), const Matrix< nRows, nCols, T > &m) |
| Apply a unary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T , typename T1 > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (const T &(*fct)(const T1 &), const Matrix< nRows, nCols, T1 > &m) |
| Apply a unary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T , typename T1 > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(T1), const Matrix< nRows, nCols, T1 > &m) |
| Apply a unary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T , typename T1 > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(const T1 &), const Matrix< nRows, nCols, T1 > &m) |
| Apply a unary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(T, T), const Matrix< nRows, nCols, T > &m1, const Matrix< nRows, nCols, T > &m2) |
| Apply a binary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(const T &, const T &), const Matrix< nRows, nCols, T > &m1, const Matrix< nRows, nCols, T > &m2) |
| Apply a binary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (const T &(*fct)(const T &, const T &), const Matrix< nRows, nCols, T > &m1, const Matrix< nRows, nCols, T > &m2) |
| Apply a binary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T , typename T1 , typename T2 > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(T1, T2), const Matrix< nRows, nCols, T1 > &m1, const Matrix< nRows, nCols, T2 > &m2) |
| Apply a binary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T , typename T1 , typename T2 > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (T(*fct)(const T1 &, const T2 &), const Matrix< nRows, nCols, T1 > &m1, const Matrix< nRows, nCols, T2 > &m2) |
| Apply a binary function to each element of the matrix. More... | |
| template<size_t nRows, size_t nCols, typename T , typename T1 , typename T2 > | |
| CU_HOST_DEVICE Matrix< nRows, nCols, T > | map (const T &(*fct)(const T1 &, const T2 &), const Matrix< nRows, nCols, T1 > &m1, const Matrix< nRows, nCols, T2 > &m2) |
| Apply a binary function to each element of the matrix. More... | |
Class representing a fixed-size dense matrix.
Definition at line 39 of file Matrix.hpp.
| typedef T* mgx::Matrix< nRows, nCols, T >::iterator |
Definition at line 49 of file Matrix.hpp.
| typedef T* mgx::Matrix< nRows, nCols, T >::pointer_type |
Definition at line 47 of file Matrix.hpp.
| typedef T& mgx::Matrix< nRows, nCols, T >::reference_type |
Definition at line 45 of file Matrix.hpp.
| typedef T mgx::Matrix< nRows, nCols, T >::value_type |
Definition at line 44 of file Matrix.hpp.
|
inline |
Create a matrix filled with 0s.
Definition at line 59 of file Matrix.hpp.
|
inline |
Copy a matrix.
Can be used to cast a matrix onto another type.
Definition at line 71 of file Matrix.hpp.
|
inline |
Fill the matrix with the array of vectors.
| vecs | Array of nRows vectors. |
Definition at line 83 of file Matrix.hpp.
|
inline |
Initialize a 3 row matrix.
Definition at line 93 of file Matrix.hpp.
|
inline |
Fill in the matrix with the values.
| values | nRows*nCols array. If c_style is true, values is rows first (i.e. the first values correspond to the first row). Otherwise, values are columns first. |
| c_style | Determine the ordering of values. |
Definition at line 111 of file Matrix.hpp.
|
inline |
Fill in the matrix with the values.
| values | nRows*nCols array. If c_style is true, values is rows first (i.e. the first values correspond to the first row). Otherwise, values are columns first. |
| c_style | Determine the ordering of values. |
Definition at line 127 of file Matrix.hpp.
|
inline |
Create a diagonal matrix.
| value | Value placed on the diagonal. |
Definition at line 139 of file Matrix.hpp.
|
inline |
Returns a constant raw pointer on the data.
The data are organised on by rows. (i.e. in the opposite order as OpenGL)
Definition at line 178 of file Matrix.hpp.
|
inline |
Returns a raw pointer on the data.
The data are organised on by rows. (i.e. in the opposite order as OpenGL)
Definition at line 188 of file Matrix.hpp.
|
inline |
Return the diagonal vector, if the matrix is square.
Definition at line 560 of file Matrix.hpp.
|
inline |
Definition at line 551 of file Matrix.hpp.
|
inlinestatic |
Returns an identity matrix.
Definition at line 444 of file Matrix.hpp.
|
inlinestatic |
Returns the number of columns of the matrix.
Definition at line 168 of file Matrix.hpp.
|
inlinestatic |
Returns the number of rows of the matrix.
Definition at line 160 of file Matrix.hpp.
|
inline |
Element-wise inequality.
Definition at line 343 of file Matrix.hpp.
|
inline |
Return the value at row i, column j.
Definition at line 428 of file Matrix.hpp.
|
inline |
Return the value at row i, column j.
Definition at line 436 of file Matrix.hpp.
|
inline |
Matrix-scalar multiplication.
Definition at line 238 of file Matrix.hpp.
|
inline |
Matrix*Column Vector.
Definition at line 280 of file Matrix.hpp.
|
inline |
Definition at line 322 of file Matrix.hpp.
|
inline |
Definition at line 312 of file Matrix.hpp.
|
inline |
|
inline |
Definition at line 302 of file Matrix.hpp.
|
inline |
Definition at line 224 of file Matrix.hpp.
|
inline |
Matrix subtraction.
Definition at line 196 of file Matrix.hpp.
|
inline |
Definition at line 307 of file Matrix.hpp.
|
inline |
Matrix-scalar division.
Definition at line 252 of file Matrix.hpp.
|
inline |
Definition at line 317 of file Matrix.hpp.
|
inline |
|
inline |
Definition at line 293 of file Matrix.hpp.
|
inline |
Set the matrix to a diagonal matrix.
| value | Value to put on the diagonal |
Definition at line 468 of file Matrix.hpp.
|
inline |
Element-wise equality.
Definition at line 330 of file Matrix.hpp.
|
inline |
Returns the nth row.
| idx | Index of the returned row |
Definition at line 410 of file Matrix.hpp.
|
inline |
Returns the nth row.
| idx | Index of the returned row |
Definition at line 420 of file Matrix.hpp.
|
inline |
Transpose the matrix.
Definition at line 485 of file Matrix.hpp.
|
inlinestatic |
Creates the 3x3 matrix corresponding to a rotation.
| direction | Axes of the rotation |
| angle | Angle of the rotation |
Definition at line 501 of file Matrix.hpp.
|
inlinestatic |
Creates the 4x4 matrix corresponding to a rotation.
| direction | Axes of the rotation |
| angle | Angle of the rotation |
Definition at line 522 of file Matrix.hpp.
|
inlinestatic |
Returns the size of the matrix.
First element is number of rows, second is number of columns
Definition at line 152 of file Matrix.hpp.
|
inline |
Trace of the matrix.
Definition at line 541 of file Matrix.hpp.
|
inline |
Set the matrix to all zero.
Definition at line 454 of file Matrix.hpp.
|
related |
Returns the cofactor of the matrix for position (i,j)
Definition at line 992 of file Matrix.hpp.
|
related |
Determinant of the matrix.
Definition at line 946 of file Matrix.hpp.
|
related |
Determinant of the matrix.
Definition at line 950 of file Matrix.hpp.
|
related |
Determinant of the matrix.
Definition at line 955 of file Matrix.hpp.
|
related |
Determinant of the matrix.
complexity ! Definition at line 961 of file Matrix.hpp.
|
related |
Inverse the matrix.
Definition at line 1001 of file Matrix.hpp.
|
related |
Inverse the matrix.
Definition at line 1008 of file Matrix.hpp.
|
related |
Inverse the matrix.
Definition at line 1022 of file Matrix.hpp.
|
related |
Inverse the matrix.
Definition at line 1041 of file Matrix.hpp.
|
related |
Inverse the matrix.
Definition at line 1100 of file Matrix.hpp.
|
related |
Apply a unary function to each element of the matrix.
Definition at line 684 of file Matrix.hpp.
|
related |
Apply a binary function to each element of the matrix.
Definition at line 840 of file Matrix.hpp.
|
related |
Apply a unary function to each element of the matrix.
Definition at line 741 of file Matrix.hpp.
|
related |
Apply a binary function to each element of the matrix.
Definition at line 903 of file Matrix.hpp.
|
related |
Apply a unary function to each element of the matrix.
Definition at line 722 of file Matrix.hpp.
|
related |
Apply a binary function to each element of the matrix.
Definition at line 819 of file Matrix.hpp.
|
related |
Apply a unary function to each element of the matrix.
Definition at line 779 of file Matrix.hpp.
|
related |
Apply a binary function to each element of the matrix.
Definition at line 882 of file Matrix.hpp.
|
related |
Apply a unary function to each element of the matrix.
Definition at line 703 of file Matrix.hpp.
|
related |
Apply a binary function to each element of the matrix.
Definition at line 798 of file Matrix.hpp.
|
related |
Apply a unary function to each element of the matrix.
Definition at line 760 of file Matrix.hpp.
|
related |
Apply a binary function to each element of the matrix.
Definition at line 861 of file Matrix.hpp.
|
related |
Return the norm of the matrix.
The norm is defined as the square-root of the sum of the square of the values.
Definition at line 1134 of file Matrix.hpp.
|
related |
Return the square norm of the matrix.
Definition at line 1123 of file Matrix.hpp.
|
related |
Matrix multiplication.
|
friend |
Matrix-scalar multiplication.
Definition at line 266 of file Matrix.hpp.
|
related |
Row-Vector - Matrix multipliation.
Definition at line 919 of file Matrix.hpp.
|
friend |
Definition at line 365 of file Matrix.hpp.
|
friend |
Definition at line 385 of file Matrix.hpp.
|
friend |
Definition at line 376 of file Matrix.hpp.
|
friend |
Definition at line 397 of file Matrix.hpp.
|
related |
Transpose a matrix.
Definition at line 1114 of file Matrix.hpp.
| const typedef T* mgx::Matrix< nRows, nCols, T >::const_iterator |
Definition at line 50 of file Matrix.hpp.
| const typedef T* mgx::Matrix< nRows, nCols, T >::const_pointer_type |
Definition at line 48 of file Matrix.hpp.
| const typedef T& mgx::Matrix< nRows, nCols, T >::const_reference_type |
Definition at line 46 of file Matrix.hpp.
|
static |
Definition at line 52 of file Matrix.hpp.
|
static |
Definition at line 53 of file Matrix.hpp.
1.8.17