|
|
| Matrix () |
| | Constructs a zero-initialized matrix.
|
| |
| | Matrix (const DataType &data) |
| | Constructs a matrix from existing data.
|
| |
| RowDataType & | operator[] (size_t index) |
| | Accesses a row by index.
|
| |
| const RowDataType & | operator[] (size_t index) const |
| | Accesses a row by index (const).
|
| |
|
DataType & | data () |
| | Returns a mutable reference to the underlying data.
|
| |
|
const DataType & | data () const |
| | Returns a const reference to the underlying data.
|
| |
|
size_t | width () const |
| | Returns the number of columns.
|
| |
|
size_t | height () const |
| | Returns the number of rows.
|
| |
|
bool | isSquare () const |
| | Returns true if the matrix is square (W == H).
|
| |
| Matrix< T, H, W > | transpose () const |
| | Returns the transpose of this matrix.
|
| |
| Matrix< T, W, H > | operator+ (const Matrix< T, W, H > &other) const |
| | Element-wise matrix addition.
|
| |
| Matrix< T, W, H > | operator- (const Matrix< T, W, H > &other) const |
| | Element-wise matrix subtraction.
|
| |
| Matrix< T, W, H > | operator* (const T &scalar) const |
| | Scalar multiplication.
|
| |
| template<size_t K> |
| Matrix< T, W, K > | operator* (const Matrix< T, H, K > &other) const |
| | Matrix multiplication.
|
| |
| Matrix< T, W, H > | operator/ (const T &scalar) const |
| | Scalar division.
|
| |
| void | LUdecomposition (Matrix< T, W, H > &L, Matrix< T, W, H > &U) const |
| | Computes the LU decomposition of this matrix.
|
| |
| T | determinant () const |
| | Computes the determinant of a square matrix.
|
| |
| Matrix< T, W, H > | inverse (Error *err=nullptr) const |
| | Computes the inverse of a square matrix.
|
| |
| template<size_t L> |
| T | dot (const Matrix< T, L, 1 > &other) const |
| | Computes the dot product between two matrices treated as vectors.
|
| |
| template<typename Func > |
| Matrix< T, W, H > | apply (Func &&func) const |
| | Applies a function to each element of the matrix.
|
| |
| T | frobeniusNorm () const |
| | Computes the Frobenius norm of the matrix.
|
| |
| T | trace () const |
| | Computes the trace (sum of diagonal elements) of a square matrix.
|
| |
| T | sum () const |
| | Computes the sum of all elements in the matrix.
|
| |
| Matrix< T, W, H > | hadamardProduct (const Matrix< T, W, H > &other) const |
| | Computes the Hadamard (element-wise) product of two matrices.
|
| |
| template<size_t L> |
| Matrix< T, H, L > | outer_product (const Matrix< T, L, 1 > &other) const |
| | Computes the outer product of two column vectors.
|
| |
| Matrix< T, 1, H > | rowSum () const |
| | Computes the sum of each row.
|
| |
| Matrix< T, W, 1 > | colSum () const |
| | Computes the sum of each column.
|
| |
| Matrix< T, W, 1 > | diagonal () const |
| | Extracts the diagonal elements of a square matrix.
|
| |
| Matrix< double, 1, H > | rowMean () const |
| | Computes the mean of each row.
|
| |
| Matrix< double, W, 1 > | colMean () const |
| | Computes the mean of each column.
|
| |
| Matrix< T, H, W > | rotateCW () const |
| | Rotates the matrix 90 degrees clockwise.
|
| |
| Matrix< T, H, W > | rotateCCW () const |
| | Rotates the matrix 90 degrees counter-clockwise.
|
| |
Generic fixed-size matrix with compile-time dimensions.
- Example
m.translate(1.0f, 2.0f, 3.0f);
Dynamic array container wrapping std::vector.
Definition list.h:40
static Matrix< T, W, H > identity()
Creates an identity matrix.
Definition matrix.h:48
Provides standard matrix operations including arithmetic, transposition, determinant, inverse, LU decomposition, and element-wise operations.
- Template Parameters
-
| T | Element type (e.g. float, double). |
| W | Number of columns (width). |
| H | Number of rows (height). |