|
template<class Num > |
MatrixS & | fromArray (const Num *a, bool rowMajor=true) |
| Initialize from array. If the array is in row-major format set rowMajor to true, otherwise set to false for column-major. More...
|
|
MatrixS & | fromArray (const Real *a, bool rowMajor=true) |
|
MatrixS & | fromZero () |
| Zero all elements. More...
|
|
MatrixS & | fromScalar (Real f) |
| Initialize with scalar in every element. More...
|
|
MatrixS & | fromIdentity () |
| Make matrix identity. For non-square matrices the identity is in the upper-left square block, the rest is filled with zero. More...
|
|
template<class T > |
matrix::Builder< MatrixS > | operator<< (T &&val) |
| Initialize matrix elements from scalars and other matrices using the comma operator: Matrix() << 1, 2, vec*5 ... The number of assigned elements must total up to be the matrix size exactly. More...
|
|
template<class T > |
MatrixBase & | operator= (const MatrixBase< T > &rhs) |
| Assign to matrix of any size. Asserts that any fixed dimensions in this matrix match those in rhs. More...
|
|
template<class Matrix > |
Matrix | cast () |
| Convert to a matrix of another real type. More...
|
|
template<class T > |
bool | operator== (const MatrixBase< T > &rhs) const |
|
template<class T > |
bool | operator!= (const MatrixBase< T > &rhs) const |
|
template<class T > |
bool | operator< (const MatrixBase< T > &rhs) const |
|
template<class T > |
bool | operator> (const MatrixBase< T > &rhs) const |
|
template<class T > |
bool | operator<= (const MatrixBase< T > &rhs) const |
|
template<class T > |
bool | operator>= (const MatrixBase< T > &rhs) const |
|
template<class T , class Res > |
Res && | add (const T &rhs, Res &&res) const |
| Add another matrix. Stores result in and returns res. res may reference the same matrix as this or rhs. More...
|
|
MatrixS | operator+ () const |
|
template<class T > |
MatrixS | operator+ (const MatrixBase< T > &rhs) const |
|
template<class T > |
MatrixS & | operator+= (const MatrixBase< T > &rhs) |
|
template<class T , class Res > |
Res && | sub (const T &rhs, Res &&res) const |
| Subtract another matrix. Stores result in and returns res. res may reference the same matrix as this or rhs. More...
|
|
MatrixS | operator- () const |
|
template<class T > |
MatrixS | operator- (const MatrixBase< T > &rhs) const |
|
template<class T > |
MatrixS & | operator-= (const MatrixBase< T > &rhs) |
|
template<class T , class Res > |
Res && | mul (const T &rhs, Res &&res) const |
| Multiply with another matrix. This mat's column size must match rhs' row size. Stores result in and returns res. Complexity: . More...
|
|
template<class T > |
Matrix< s_rows, T::s_cols, Real > | operator* (const T &rhs) const |
| Multiply with another matrix. Returns a new matrix. More...
|
|
MatrixS | operator* (Real rhs) const |
|
template<class T > |
MatrixS & | operator*= (const MatrixBase< T > &rhs) |
|
MatrixS & | operator*= (Real rhs) |
|
MatrixS | operator/ (Real rhs) const |
|
MatrixS & | operator/= (Real rhs) |
|
MatrixS | elemAdd (Real rhs) const |
| Add rhs to each element. Returns a new matrix with the results. More...
|
|
MatrixS & | elemAddEq (Real rhs) |
| Add rhs to each element. More...
|
|
MatrixS | elemSub (Real rhs) const |
| Subtract rhs from each element. Returns a new matrix with the results. More...
|
|
MatrixS & | elemSubEq (Real rhs) |
| Subtract rhs from each element. More...
|
|
template<class T > |
MatrixS | elemMul (const MatrixBase< T > &rhs) const |
| Multiply each element with its corresponding element in rhs. Returns a new matrix with the results. More...
|
|
template<class T > |
MatrixS & | elemMulEq (const MatrixBase< T > &rhs) |
| Multiply each element with its corresponding element in rhs. More...
|
|
template<class T > |
MatrixS | elemDiv (const MatrixBase< T > &rhs) const |
| Divide each element by its corresponding element in rhs. Returns a new matrix with the results. More...
|
|
template<class T > |
MatrixS & | elemDivEq (const MatrixBase< T > &rhs) |
| Divide each element by its corresponding element in rhs. More...
|
|
MatrixS | elemAbs () const |
| Get the absolute value of each element. Returns a new matrix with the results. More...
|
|
MatrixS | elemSqr () const |
| Square each element. Returns a new matrix with the results. More...
|
|
MatrixS | elemInverse () const |
| Inverse each element. Returns a new matrix with the results. More...
|
|
template<class T > |
MatrixS | elemMin (const MatrixBase< T > &rhs) const |
| Get the min of each element and its corresponding element in rhs. Returns a new matrix with the results. More...
|
|
template<class T > |
MatrixS | elemMax (const MatrixBase< T > &rhs) const |
| Get the max of each element and its corresponding element in rhs. Returns a new matrix with the results. More...
|
|
bool | isZero () const |
| Check if each element is exactly zero. More...
|
|
bool | isNearZero (Real tol=Real_::zeroTol) const |
| Check if each element is close to zero. More...
|
|
template<class T > |
MatrixS | clamp (const MatrixBase< T > &min, const MatrixBase< T > &max) const |
| Clamp each element between its corresponding elements in min and max. Returns a new matrix with the results. More...
|
|
Real | sum () const |
| Get the sum of all elements. More...
|
|
Real | prod () const |
| Get the product of all elements. More...
|
|
Real | mean () const |
| Get the mean of all elements. More...
|
|
Real | min () const |
| Get the minimum element. More...
|
|
Real | max () const |
| Get the maximum element. More...
|
|
template<sdt Rows, sdt Cols> |
matrix::Block< MatrixS, Rows, Cols > | block (sdt row, sdt col, sdt rows=-1, sdt cols=-1) |
| Get block at offset (row,col) with size (Rows, Cols). If Rows or Cols is fixed then rows or cols may be left unspecified. More...
|
|
template<sdt Rows, sdt Cols> |
matrix::Block< const MatrixS, Rows, Cols > | block (sdt row, sdt col, sdt rows=-1, sdt cols=-1) const |
|
matrix::Block< MatrixS > | block (sdt row, sdt col, sdt rows, sdt cols) |
| Get dynamic block at offset (row,col) with size (rows, cols) More...
|
|
matrix::Block< const MatrixS > | block (sdt row, sdt col, sdt rows, sdt cols) const |
|
matrix::Block< MatrixS, 1, s_cols > | row (sdt row) |
| Get row as a row vector. More...
|
|
matrix::Block< const MatrixS, 1, s_cols > | row (sdt row) const |
|
matrix::Block< MatrixS, s_rows, 1 > | col (sdt col) |
| Get column as a column vector. More...
|
|
matrix::Block< const MatrixS, s_rows, 1 > | col (sdt col) const |
|
MatrixS & | resize (sdt rows, sdt cols) |
| Sets number of rows/columns and reallocates only if the size has changed (rows*cols). All previous data is lost on reallocation. Returns self. More...
|
|
matrix::Iter< MatrixS > | begin () |
| Get an iterator over the elements in row-major order. More...
|
|
matrix::Iter< const MatrixS > | begin () const |
|
matrix::Iter< MatrixS > | end () |
| Get an iterator to the end of the iteration provided by begin() More...
|
|
matrix::Iter< const MatrixS > | end () const |
|
matrix::Iter< MatrixS > | iter (sdt i) |
| Get an iterator to the element at index. More...
|
|
matrix::Iter< const MatrixS > | iter (sdt i) const |
|
matrix::Iter< MatrixS > | iter (sdt row, sdt col) |
| Get an iterator to the element at (row, col) More...
|
|
matrix::Iter< const MatrixS > | iter (sdt row, sdt col) const |
|
template<class Num > |
Num * | toArray (Num *a, bool rowMajor=true) const |
| Copy matrix into array. If the array is in row-major format set rowMajor to true, otherwise set to false for column-major. More...
|
|
Real * | toArray (Real *a, bool rowMajor=true) const |
|
template<class Res > |
Res && | transpose (Res &&res) const |
| transpose and store result in res. Returns res. More...
|
|
Matrix< s_cols, s_rows, Real > | transpose () const |
| Returns new matrix. More...
|
|
void | transposeInPlace () |
| transpose and store in this matrix, only valid for square matrices More...
|
|
template<class T , class Res > |
Res && | transposeMul (const T &rhs, Res &&res) const |
| Stores result in and returns res. More...
|
|
template<class T > |
Matrix< s_cols, T::s_cols, Real > | transposeMul (const T &rhs) const |
| Returns new matrix. More...
|
|
template<class T , class Res > |
Res && | mulTranspose (const T &rhs, Res &&res) const |
| Stores result in and returns res. More...
|
|
template<class T > |
Matrix< s_rows, T::s_rows, Real > | mulTranspose (const T &rhs) const |
| Returns new matrix. More...
|
|
template<class T , class Res > |
Res && | transposeMulTranspose (const T &rhs, Res &&res) const |
| Stores result in and returns res. More...
|
|
template<class T > |
Matrix< s_cols, T::s_rows, Real > | transposeMulTranspose (const T &rhs) const |
| Returns new matrix. More...
|
|
auto | minor (sdt row, sdt col) const -> Matrix< (s_rows > 0)?s_rows-1:s_rows, (s_cols > 0)?s_cols-1:s_cols, Real > |
| Returns a matrix without the selected row and column. More...
|
|
Matrix< s_cols, s_rows, Real > | inverse (optional< Real & > det=optnull) const |
| Get the pseudo-inverse of this matrix. The pseudo-determinant will be returned in det if specified. More...
|
|
Real | determinant () const |
| Get the determinant. Returns the pseudo-determinant if this matrix is not square. More...
|
|
Real | cond () const |
| Get the condition value. A high value means the matrix is ill-conditioned and close to singular, so inversion and linear ops will be unreliable. More...
|
|