Matrix.this

struct Matrix(T, ubyte R, ubyte C = R, MatrixOrder O = CurrentMatrixOrder)
pure nothrow @safe @nogc
static if(O == MatrixOrder.RowMajor)
this
(
U...
)
()
if (
R >= 2 &&
R <= 4
&&
C >= 2
&&
C <= 4
)

Examples

// Create a matrix using all values.
auto matrix1 = Matrix!(int, 2)(1, 2, 3, 4);
assert (matrix1.v == [1, 2, /**/ 3, 4]);
// Create a matrix from one value.
auto matrix2 = Matrix!(float, 2)(5.2f);
assert (matrix2.v == [5.2f, 5.2f, /**/ 5.2f, 5.2f]);
// Create a matrix with no value (implicit 0).
auto matrix3 = Matrix!(short, 2)();
assert (matrix3.v == [0, 0, /**/ 0, 0]);

Meta