MatrixInfo

Some reflective information about multidimensional arrays

Handles dynamic arrays, static arrays, and pointers to static arrays.

Members

Aliases

MatrixElementType
alias MatrixElementType = _dim.elt

Matrix element type of T E.g. immutable(double) for T=immutable(double[4][4])

RectArrayType
alias RectArrayType = _rect_type!(unqual, 0)

unqualified highest dimension subtype of T forming RectArray

_dim
alias _dim = _dim_list!(PointerTarget!T)
Undocumented in source.
_dim
alias _dim = _dim_list!T
Undocumented in source.
dim_list
alias dim_list = _dim.list

tuple of dimensions of T. dim_list[0] will be the dimension furthest from the MatrixElementType i.e. for double[1][2][3], dim_list == (3, 2, 1). Lists -1 as dimension of dynamic arrays.

unqual
alias unqual = _dim.unqual*

T, with all nonmutable qualifiers stripped away.

unqual
alias unqual = _dim.unqual
Undocumented in source.

Functions

build_shape
Py_ssize_t[] build_shape(T t)

Build shape from t. Assumes all arrays in a dimension are initialized and of uniform length.

check
bool check(Py_ssize_t[] shape)

Ensures that T can store a matrix of _shape shape.

matrixIter
string matrixIter(string arr_name, string shape_name, string index_name, size_t ndim, string pre_code, string post_code)

Generate a mixin string of nested for loops that iterate over the first ndim dimensions of an array of type T (or, preferrably MatrixInfo!T.unqual).

shape_builder_mixin
string shape_builder_mixin(string arr_name, string shape_name)
Undocumented in source. Be warned that the author may not have intended to support it.
tuple2string
string tuple2string()
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

ndim
enum ndim;

number of dimensions of this matrix

Templates

ElementType2
template ElementType2(_T)
Undocumented in source.
_dim_list
template _dim_list(T, dimi...)
Undocumented in source.
_rect_type
template _rect_type(S, size_t i)
Undocumented in source.

Variables

dimstring
enum string dimstring;

Pretty string of dimension list for T

indexof_rev
enum size_t indexof_rev;
Undocumented in source.
isRectArray
enum bool isRectArray;

T is a RectArray if: * it is any multidimensional static array (or a pointer to) * it is a 1 dimensional dynamic array

rectArrayAt
enum size_t rectArrayAt;

Highest dimension where it and all subsequent dimensions form a RectArray.

Meta