zmath.matrix
Defines a squared Matrix with column-major ordering from 2x2 to 4x4 size
-
Declaration
alias
Mat2f
= Matrix!(float, 2LU).Matrix;2D squared matrix of floats
-
Declaration
alias
Mat3f
= Matrix!(float, 3LU).Matrix;3D squared matrix of floats
-
Declaration
alias
Mat4f
= Matrix!(float, 4LU).Matrix;4D squared matrix of floats
-
Declaration
alias
Mat2d
= Matrix!(double, 2LU).Matrix;2D squared matrix of doubles
-
Declaration
alias
Mat3d
= Matrix!(double, 3LU).Matrix;3D squared matrix of doubles
-
Declaration
alias
Mat4d
= Matrix!(double, 4LU).Matrix;4D squared matrix of doubles
-
Declaration
alias
Mat2r
= Matrix!(real, 2LU).Matrix;2D squared matrix of reals
-
Declaration
alias
Mat3r
= Matrix!(real, 3LU).Matrix;3D squared matrix of reals
-
Declaration
alias
Mat4r
= Matrix!(real, 4LU).Matrix;4D squared matrix of reals
-
Declaration
struct
Matrix
(T, size_t dim_) if (__traits(isFloating, T) && (dim_ >= 2) && (dim_ <= 4));Defines a squared
Matrix
of n = 2, 3 or 4 size, like a linear array of numbers in a row-major order-
Declaration
static enum size_t
dim
;Matrix Dimension
-
Declaration
static enum size_t
cells
;Matrix number of
cells
-
Declaration
static enum Matrix!(T, 2)
ZERO
;Zero R2 matrix
-
Declaration
static enum Matrix!(T, 2)
IDENTITY
;Identity R2 matrix
-
Declaration
const pure @nogc T
opIndex
(size_trow
, size_tcol
);Returns i, j cell
-
Declaration
@nogc void
opIndexAssign
(K)(Kval
, size_trow
, size_tcol
) if (is(K : real));Assigns a new cell value
-
Declaration
const pure @nogc VRow
opIndex
(size_ti
);Returns
i
row vector -
Declaration
@nogc void
opIndexAssign
(K)(Kv
, size_ti
) if (isVector!K);Assigns a new row vector
-
Declaration
const pure @nogc bool
opEquals
()(auto ref const Matrixrhs
);Define Equality
-
Declaration
const pure @nogc bool
approxEqual
()(auto ref const Matrixrhs
, TmaxRelDiff
= 0.01, TmaxAbsDiff
= 1e-05);Approximated equality
-
Declaration
const pure @nogc Matrix
opUnary
(string op)() if (op == "+" || op == "-");Define unary operators + and -
-
Declaration
const pure @nogc Matrix
opBinary
(string op)(auto ref const Matrixrhs
) if ((op == "+" || op == "-") && (dim >= 2) && (dim <= 4));Define binary operator + and -
-
Declaration
const pure @nogc Matrix
opBinary
(string op)(in realrhs
) if (op == "*" || op == "/");Define Scalar multiplication
-
Declaration
const pure @nogc Matrix
opBinaryRight
(string op)(in realrhs
) if (op == "*" || op == "/");Define Scalar multiplication
-
Declaration
const pure @nogc Matrix
opBinary
(string op)(auto ref const Matrixrhs
) if (op == "*");Define Matrix Product
-
Declaration
const pure @nogc VCol
opBinary
(string op)(auto ref const VRowrhs
) if (op == "*");Define Matrix x Vector
-
Declaration
const pure @nogc VCol
opBinaryRight
(string op)(auto ref const VCollhs
) if (op == "*");Define Vector x Matrix
-
Declaration
const pure @nogc Matrix
transpose
();Returns transposed matrix
Discussion
It can be used to "convert" Matrix to a row ordered matrix
-
Declaration
const pure @nogc T
determinant
();Returns Determinant of this matrix
-
Declaration
const pure @nogc Matrix
inverse
();Calcs this matrix
inverse
Return Value
A matrix full of NaNs if this matrix isn't inverible (!isOk =1)
-
Declaration
const pure @nogc bool
isOk
();Checks that the matrix not have a weird NaN value
-
Declaration
const pure @nogc bool
isFinite
();Checks that the matrix have finite values
-
Declaration
pure nothrow @nogc @property T*
ptr
();Return a pointer of the internal array
-
Declaration
const pure @nogc Tout
opCast
(Tout)() if (isMatrix!Tout && (Tout.dim >= dim));Casting operation that allow convert between Matrix types
-
Declaration
const string
toString
();Returns a visual representation of this matrix
-
-
Declaration
immutable bool
isMatrix
(T);Say if a thing it's a Matrix