Dimensions of this array.
Implements by-element iteration with inidces starting from the top dimension.
Inexing/slicing.
Implements elements initialisation with a value, where value can be of type T or an input range which front can be assigned to an element. The range should contain exectly elements elements, otherwise an Exception will be thrown.
Creates a slice of this entire array with reordered indices. newOrder[i] = n means that i-th index of a resulting array will behave like n-th index of the original array. Every index sould be used once, otherwise an Exception will be thrown.
Conversion to string function for debugging purposes.
Returns a forward range which has mutable elements and a length for iteration by an element.
Returns a finite random-access range which has mutable elements and a length for iteration by an element.
Returns a forward range which has mutable elements for iteration using indices defined by pred starting from a = 0 and incrementing it while indices are in valid range.
Returns a finite random-access range for iteration over the top dimension. It has mutable elements iff dimensions is 1.
Returns the elements count of the array.
Returns the read only view at its lengths array.
Returns the maximum number of tail dimensions without pading. Note, that there can be no such dimensions.
t { // Let's creates an GC allocated three-dimensional rectangular array from 2 matrices 3x4 auto matrices = multidimArray!int(2, 3, 4); // matrices has a type MultidimArray!(int, 3) // Setting an element at intersection of the first column and // the third row of the secon matrix to seven: matrices[1, 0, 2] = 7; // Filling the whole first column of the secon matrix with sixes: matrices[1, 0, 0..$][] = 6; // Filling the whole array with fives: matrices[] = 5; // Iterating the array foreach(z, y, x, ref el; matrices) // using opApply el = cast(int) (z * 100 + y * 10 + x); int c = 0; foreach(ref el; matrices.byElementForward) el = c++; c = 0; foreach(i; 0 .. matrices.elements) matrices.byElementRandomAccess[i] = c++; c = 0; foreach(matrix; matrices.byTopDimension) // for each of two matrices foreach(row; matrix.byTopDimension) // for each row foreach(ref el; row.byTopDimension) // for each element el = c++; c = 0; foreach_reverse(ref el; matrices.byElementRandomAccess) el = c++; c = 0; foreach_reverse(i; 0 .. matrices.elements) matrices.byElementRandomAccess[i] = c++; // Inexing/slicing // * use <integer> to select a position // * use <integer> .. <integer> to select a range // E.g. use 0..$ to select the whole range matrices = matrices[0..$, 0..$, 0..$]; // the entire array, same as [0..2, 0..3, 0..4] auto array2d = matrices[0, 0..$, 0..$]; // the first matrix auto array1d = matrices[0, 1, 0..$]; // the second row of the first matrix array1d = matrices[0, 0..$, 1]; // the second column of the first matrix matrices[0, 1, 1] = 9; // setting an element at a crossing of the row an the column // first two rows and three columns of the secon matrix array2d = matrices[1, 0 .. 2, 0 .. 3
Implements multidimensional rectangular arrays.
Something like FORTRAN's one.