Mat
template<typename T, std::size_t C, std::size_t R>
struct Mat;
A regular mathematical dense matrix.
Member types
| Member Type | Definition |
|---|---|
value_type |
T |
col_type |
Vec<value_type, rows> |
row_type |
Vec<value_type, cols> |
Member constants
| name | type | Definition |
|---|---|---|
rows |
std::size_t |
Number of rows |
cols |
std::size_t |
Number of columns |
Member functions
| Member | Behavior |
|---|---|
| (constructor) | initalize using aggregate initialization |
| (destructor) | destroy every element in the matrix |
| operator= | ovewrite the matrix with another matrix |
| at | access specific element with bounds checking |
| operator[] | access specific element |
| data | access underlying array |
Non-member functions
Language support
| Function | Behavior |
|---|---|
| operator<< | print to stream |
Per-member operations
| Function | Behavior |
|---|---|
| operator== | compares two vectors for equality |
| operator!= | compares two vectors for inequality |
| operator-= | per-member substraction |
| operator/= | per-member division |
| operator- | per-member substraction |
| operator+ | per-member addition |
Unary operations
| Function | Behavior |
|---|---|
| operator-(unary) | negation |
Scalar operations
| Function | Behavior |
|---|---|
| operator/=(scalar) | matrix scaling |
| operator*=(scalar) | matrix scaling |
| operator/(scalar) | matrix scaling |
| operator*(scalar) | matrix scaling |
Geometric functions
| Function | Behavior |
|---|---|
| determinant | Calculate determinant |
| transpose | Generate transposed matrix |