Build a matrix from its elements. To be provided row major.
Build a matrix from the provided rows. Each row must be an array (static or dynamic) and have the correct number of elements.
The matrix columns type.
Alias to a type sequence holding all components
The type of the componetypeof(rt.expand)nts.
The matrix rows type.
Alias to a type sequence holding all rows
Index a matrix column.
Index a matrix component
Assign a compile time indexed component
Assign a row indexed at compile time
Assign a column indexed at compile time
Build an augmented matrix (add oth to the right of this matrix)
Add/Subtract by a matrix to its right.
Multiply by a matrix to its right.
Multiply a matrix by a vector to its right.
Operation of a matrix with a scalar on its right.
Multiply a matrix by a vector to its left.
Operation of a matrix with a scalar on its left.
Cast a matrix to another type
Number of components per direction.
Index a matrix component.
Index a matrix row
Assign a matrix component.
Assign a row
Apply op on a matrix component.
Assign operation of a matrix with a scalar on its right.
Assign operation of a matrix with a matrix on its right.
Index a matrix row.
The number of columns in the matrix.
The number of components in the matrix;
The identity matrix.
row major container: length is the number of rows
The number of rows in the matrix.
All components in a tuple
Index a component at compile time
Index a row at compile time
Index a column at compile time
Direct access to underlying data. Reminder: row major order!
All rows in a tuple
Return a slice of the matrix
Assign a slice of this matrix e.g:
mat.slice!(0, 2) = otherMat;
import gfx.math.approx : approxUlp; assert(approxUlp(FMat2x2.identity, FMat2x2( 1, 0, 0, 1 )));
import gfx.math.approx : approxUlp; immutable ml = Mat!(float, 2, 3)( 1, 2, 3, 4, 5, 6, ); immutable mr = Mat!(float, 3, 2)( 1, 2, 3, 4, 5, 6, ); immutable exp = Mat!(float, 2, 2)( 1+6+15, 2+8+18, 4+15+30, 8+20+36 ); assert(approxUlp(ml * mr, exp));
Matrix type for linear algebra