numir.core.utility

Various slice utility (e.g., ndim, view, type functions)

Members

Functions

byteStrides
size_t[] byteStrides(S s)

Return the number of bytes to step in each dimension when traversing a slice.

dtype
auto dtype(S s)

Returns the typeid of the element type of S.

ndim
size_t ndim(S s)

Returns the number of dimensions of a slice.

shapeNested
size_t[rank!T] shapeNested(T array)

Returns the shape of a nested array length. Note that the array should have compile-time nested lengths. Dynamic arrays get compile errors.

size
auto size(S s)

Returns the total number of elements in a slice

view
auto view(S sl, ptrdiff_t[N] lengths)

Returns a new view of a slice with the same data, but reshaped to have shape equal to lengths.

Templates

NestedElementType
template NestedElementType(T)

Returns the ElementType of a nested type T.

rank
template rank(R)

Returns the number of dimensions of type R.

Meta