Matrix

A matrix type. This is a 2D array of a guaranteed uniform size.

Constructors

this
this(size_t rowCount, size_t columnCount, immutable(Number[]) data)
this(size_t rowCount, size_t columnCount, const(Number[]) data)
this(size_t rowCount, size_t columnCount, Number[] data)

Create an matrix from an array of data.

this
this(size_t rowCount, size_t columnCount)

Create a matrix of a given size.

Members

Functions

dup
Matrix!Number dup()
idup
immutable(Matrix!Number) idup()
idup
immutable(Matrix!Number) idup()

When calling .idup on an already immutable matrix, the reference to the same immutable matrix is returned. It should be safe to share the immutable memory in this manner.

opApply
int opApply(int delegate(ref size_t, ref size_t, ref Number) dg)

Overload for foreach(rowIndex, columnIndex, value; matrix) {}

opBinary
Matrix!Number opBinary(Matrix!OtherNumber other)

Add or subtract two matrices, yielding a new matrix.

opBinary
Matrix!Number opBinary(Matrix!OtherNumber other)
Matrix!OtherNumber opBinary(Matrix!OtherNumber other)

Multiply two matrices.

opBinary
Matrix!Number opBinary(OtherNumber other)
opBinary
Matrix!OtherNumber opBinary(Matrix!OtherNumber other)

Multiply two matrices.

opEquals
bool opEquals(Matrix!Number other)
opIndex
inout(Number[]) opIndex(size_t row)

Slice out a row from the matrix. Modifying this slice will modify the matrix, unless it is copied.

opIndex
inout(Number) opIndex(size_t row, size_t column)
opOpAssign
void opOpAssign(Matrix!OtherNumber other)

Modify this matrix, adding/subtracting values from another matrix.

opOpAssign
void opOpAssign(OtherNumber other)

Modify this matrix with a scalar value.

Properties

columnCount
size_t columnCount [@property getter]
empty
bool empty [@property getter]
isSquare
bool isSquare [@property getter]
rowCount
size_t rowCount [@property getter]

Meta