MatrixInfo.matrixIter

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).

template MatrixInfo(T)
string
matrixIter
(
string arr_name
,
string shape_name
,
string index_name
,
size_t ndim
,
string pre_code
,
string post_code
)
if (
isArray!T ||
)

Parameters

arr_name
Type: string

name of array to iterate.

shape_name
Type: string

name of array of dimension lengths.

index_name
Type: string

name to use for index vector. Declared in a new nested scoped.

ndim
Type: size_t

number of dimensions to iterate over.

pre_code
Type: string

code to mixin each for loop before beginning the nested for loop.

post_code
Type: string

code to mix in to each for loop after finishing the nested for loop.

Meta