![]() |
VectorNav C++ Library
|
Template for a matrix. More...
#include <matrix.h>
Public Member Functions | |
mat () | |
Creates a new matrix with uninitialized elements. | |
mat (T val) | |
Creates a new matrix with ints elements initialized to val. More... | |
T & | operator() (size_t row, size_t col) |
Indexing into the matrix's elements. More... | |
const T & | operator() (size_t row, size_t col) const |
Indexing into the matrix's elements. More... | |
mat | operator- () const |
Negates the matrix. More... | |
template<typename S > | |
mat & | operator*= (const S &rhs) |
Multiplies the matrix by a scalar. More... | |
template<size_t r, size_t s, typename S > | |
mat & | operator* (const mat< r, s, S > &rhs) |
Multiplies the matrix by another matrix. More... | |
template<typename S > | |
mat & | operator/= (const T &rhs) |
Divides the matrix by a scalar. More... | |
template<typename S > | |
mat & | operator+= (const mat< m, n, S > &rhs) |
Adds a matrix to this matrix. More... | |
template<typename S > | |
mat & | operator-= (const mat< m, n, S > &rhs) |
Subtracts a matrix from this matrix. More... | |
size_t | dimRow () const |
The matrix's row dimension. More... | |
size_t | dimCol () const |
The matrix's column dimension. More... | |
mat | neg () const |
Negates the matrix. More... | |
mat | mult (const double &scalar) const |
Multiplies the matrix by a scalar. More... | |
mat | div (const double &scalar) const |
Divides the matrix by a scalar. More... | |
mat | add (const mat &toAdd) const |
Adds a matrix to this matrix. More... | |
mat | sub (const mat &toSub) const |
Subtracts a matrix from this matrix. More... | |
mat< n, m, T > | transpose () const |
Transposes the matrix. More... | |
Static Public Member Functions | |
static mat | zero () |
Matrix with all of its elements set to 0. More... | |
static mat | one () |
Matrix with all of its elements set to 1. More... | |
static mat< m, m, T > | identity () |
Identity matrix with its diagonal elements set to 1. More... | |
Public Attributes | |
union { | |
T e [m *n] | |
}; | |
The matrix's elements. | |
Template for a matrix.
|
inlineexplicit |
Creates a new matrix with ints elements initialized to val.
[in] | val | The initialization value. |
|
inline |
Adds a matrix to this matrix.
[in] | toAdd | The matrix to add. |
|
inline |
The matrix's column dimension.
|
inline |
The matrix's row dimension.
|
inline |
Divides the matrix by a scalar.
[in] | scalar | The scalar value. |
|
inlinestatic |
Identity matrix with its diagonal elements set to 1.
|
inline |
Multiplies the matrix by a scalar.
[in] | scalar | The scalar value. |
|
inline |
Negates the matrix.
|
inlinestatic |
Matrix with all of its elements set to 1.
|
inline |
Indexing into the matrix's elements.
[in] | row | The 0-based index row. |
[in] | col | The 0-based index column. |
|
inline |
Indexing into the matrix's elements.
[in] | row | The 0-based index row. |
[in] | col | The 0-based index column. |
|
inline |
Multiplies the matrix by another matrix.
[in] | rhs | The other matrix. |
|
inline |
Multiplies the matrix by a scalar.
[in] | rhs | The scalar. |
|
inline |
Adds a matrix to this matrix.
[in] | rhs | The right-side vector. |
|
inline |
Negates the matrix.
|
inline |
Subtracts a matrix from this matrix.
[in] | rhs | The right-side matrix. |
|
inline |
Divides the matrix by a scalar.
[in] | rhs | The scalar. |
|
inline |
Subtracts a matrix from this matrix.
[in] | toSub | The matrix to subtract from this. |
|
inline |
|
inlinestatic |
Matrix with all of its elements set to 0.