auto calcMinor(T)(in T[][] mat, in size_t i, in size_t j)

The function gets minor of matrix by i,j.

T calcDeterminant(T)(in T[][] m)

The function gets determinant of matrix.

auto summarize(T)(in T[][] m1, in T[][] m2)

The function gets the sum of two matrices.

auto multiply(T1, T2)(in T1[][] m1, in T2[][] m2)

The function multiplies two matrices.

auto multiply(T, E)(in T[][] m, in E value) 
if(is(typeof(m[0][0] != value) == bool))

The function multiplies the matrix by a number.

T[][] transpose(T)(in T[][] m)

Matrix transpose.

size_t ndim(T)(T matrix)

Number of array dimensions.

Example

int[] arr1d;
int[][] arr2d;
int[3][][1] arr3d;
int[][][][][][][] arr7d;
assert(arr1d.ndim == 1);
assert(arr2d.ndim == 2);
assert(arr3d.ndim == 3);
assert(arr7d.ndim == 7);

size_t[] shape(A)(A arr)

Lengths of the corresponding array dimensions.

Example

int[4][5][6] arr456;
assert(arr456.shape == [4, 5, 6]);
int[][][] arr000;
assert(arr000.shape == [0, 0, 0]);
int[3][][7] arr307;
assert(arr307.shape == [3, 0, 7]);
int[][][7] arr007;
assert(arr007.shape == [0, 0, 7]);
int[5][][] arr500;
assert(arr500.shape == [5, 0, 0]);
int[] dynArr = new int[](8);
assert(dynArr.shape == [8]);

T[][] eye(T = double)(size_t matrixDimension)

The template function returns a two-dimensional array with ones on the main diagonal and zeros elsewhere.