Matrix

A matrix is just like a mathematical matrix where it is similar to essentially a 2d array of of the given type Template parameters are the type, how many rows, and how many columns TODO: rref, frustums, transformations

Constructors

this
this(T[][] elements)

Constructs a matrix from a two-dimensional array of elements

this
this(T[columns][rows] elements)

Constructs a matrix from a two-dimensional array of elements

this
this(T element)

Constructs a matrix that is identically one value

this
this()

Constructs a matrix as an identity matrix

this
this(Matrix!(T, rows, columns) toCopy)

Copy constructor for a matrix; creates a copy of the given matrix

Members

Functions

getColumn
Vector!(T, rows) getColumn(uint index)

Returns the nth column of the matrix

getRow
Vector!(T, columns) getRow(uint index)

Returns the nth row of the matrix

opAssign
void opAssign(T[][] rhs)

Allows assigning the matrix to a static two-dimensional array to set all components of the matrix

opAssign
void opAssign(T[columns][rows] rhs)

Allows assigning the matrix to a static two-dimensional array to set all components of the matrix

opAssign
void opAssign(T rhs)

Allows assigning the matrix to a single value to set all elements of the matrix to such a value

setColumn
void setColumn(uint index, Vector!(T, rows) c)

Sets the nth column of the matrix

setRow
void setRow(uint index, Vector!(T, columns) r)

Sets the nth row of the matrix

Properties

determinant
T determinant [@property getter]

Recursively finds the determinant of the matrix if the matrix is square Task is done in O(n!) for an nxn matrix, so determinants of matrices of at most size 3x3 are already defined to be more efficient Not very efficient for large matrices

Variables

elements
T[columns][rows] elements;

The elements of the matrix; stored as an array of rows (i.e. row vectors)

Meta