|
(Note that these are not member functions.)
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
bool | operator== (const Matrix< T, ROWS, COLS > &lhs, const Matrix< T, ROWS, COLS > &rhs) |
| Equality operator between two matrices. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
bool | operator!= (const Matrix< T, ROWS, COLS > &lhs, const Matrix< T, ROWS, COLS > &rhs) |
| Inequality operator between two matrices. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > | operator- (const Matrix< T, ROWS, COLS > &val) |
| Component-wise unary minus. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > | operator+ (const Matrix< T, ROWS, COLS > &lhs, const Matrix< T, ROWS, COLS > &rhs) |
| Component-wise addition. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > & | operator+= (Matrix< T, ROWS, COLS > &lhs, const Matrix< T, ROWS, COLS > &rhs) |
| Component-wise addition and assignment. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > | operator- (const Matrix< T, ROWS, COLS > &lhs, const Matrix< T, ROWS, COLS > &rhs) |
| Component-wise substraction. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > & | operator-= (Matrix< T, ROWS, COLS > &lhs, const Matrix< T, ROWS, COLS > &rhs) |
| Component-wise substraction and assignment. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > | operator* (const Matrix< T, ROWS, COLS > &lhs, T rhs) |
| Right scalar multiplication. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > & | operator*= (Matrix< T, ROWS, COLS > &lhs, T rhs) |
| Right scalar multiplication and assignment. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > | operator* (T lhs, const Matrix< T, ROWS, COLS > &rhs) |
| Left scalar multiplication. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > | operator/ (const Matrix< T, ROWS, COLS > &lhs, T rhs) |
| Right scalar division. More...
|
|
template<typename T , std::size_t ROWS, std::size_t COLS> |
Matrix< T, ROWS, COLS > & | operator/= (Matrix< T, ROWS, COLS > &lhs, T rhs) |
| Right scalar division and assignment. More...
|
|
template<typename T , std::size_t S1, std::size_t S2> |
Vector< T, S1 > | operator* (const Matrix< T, S1, S2 > &lhs, const Vector< T, S2 > &rhs) |
| Matrix-vector multiplication. More...
|
|
template<typename T , std::size_t S1, std::size_t S2> |
Vector< T, S2 > | operator* (const Vector< T, S1 > &lhs, const Matrix< T, S1, S2 > &rhs) |
| Vector-matrix multiplication. More...
|
|
template<typename T , std::size_t S1, std::size_t S2, std::size_t S3> |
Matrix< T, S1, S3 > | operator* (const Matrix< T, S1, S2 > &lhs, const Matrix< T, S2, S3 > &rhs) |
| Matrix-matrix multiplication. More...
|
|
template<typename T , std::size_t N> |
Matrix< T, N, N > & | operator*= (Matrix< T, N, N > &lhs, const Matrix< T, N, N > &rhs) |
| Matrix-matrix multiplication and assignment. More...
|
|
template<typename MatrixType > |
MatrixType | identity () |
| Identity matrix. More...
|
|
template<typename T , std::size_t S1, std::size_t S2> |
Matrix< T, S2, S1 > | transpose (const Matrix< T, S1, S2 > &mat) |
| Transposition of a matrix. More...
|
|
template<typename T > |
Matrix< T, 2, 2 > | invert (const Matrix< T, 2, 2 > &mat) |
| Inversion of a 2x2 matrix. More...
|
|
template<typename T > |
Matrix< T, 3, 3 > | invert (const Matrix< T, 3, 3 > &mat) |
| Inversion of a 3x3 matrix. More...
|
|
template<typename T, std::size_t ROWS, std::size_t COLS>
struct gf::Matrix< T, ROWS, COLS >
General purpose math matrix.
gf::Matrix represents a matrix with ROWS
rows and COLS
columns. The internal representation uses a row-major order.
The template parameter T
is the type of coordinates. . It can be any type that supports arithmetic operations (+, -, *, /).
Several specializations are defined for common use cases, especially for square matrices:
This class was designed according to the article On Vector Math Libraries by Nathan Reed.
- See also
- gf::Array2D