Report a bug
If you spot a problem with this page, click here to create a Github issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

mir.ndslice.traits

Multidimensional traits

This is a submodule of mir.ndslice.

Function

Function Name Description
isVector Test if type is a one-dimensional slice.
isMatrix Test if type is a two-dimensional slice.
isContiguousSlice Test if type is a contiguous slice.
isCanonicalSlice Test if type is a canonical slice.
isUniversalSlice Test if type is a universal slice.
isContiguousVector Test if type is a contiguous one-dimensional slice.
isUniversalVector Test if type is a universal one-dimensional slice.
isContiguousMatrix Test if type is a contiguous two-dimensional slice.
isCanonicalMatrix Test if type is a canonical two-dimensional slice.
isUniversalMatrix Test if type is a universal two-dimensional slice.
Authors:
John Hall
enum bool isVector(T);
Test if type is a one-dimensional slice.
enum bool isMatrix(T);
Test if type is a two-dimensional slice.
enum bool isContiguousSlice(T);
Test if type is a contiguous slice.
enum bool isCanonicalSlice(T);
Test if type is a canonical slice.
enum bool isUniversalSlice(T);
Test if type is a universal slice.
enum bool isContiguousVector(T);
Test if type is a contiguous one-dimensional slice.
enum bool isUniversalVector(T);
Test if type is a universal one-dimensional slice.
enum bool isContiguousMatrix(T);
Test if type is a contiguous two-dimensional slice.
enum bool isCanonicalMatrix(T);
Test if type is a canonical two-dimensional slice.
enum bool isUniversalMatrix(T);
Test if type is a universal two-dimensional slice.
Examples:
import mir.ndslice.slice : ContiguousVector;

alias S1 = ContiguousVector!int;
static assert(isContiguousVector!S1);
static assert(!isUniversalVector!S1);

static assert(!isContiguousMatrix!S1);
static assert(!isCanonicalMatrix!S1);
static assert(!isUniversalMatrix!S1);

static assert(isVector!S1);
static assert(!isMatrix!S1);

static assert(isContiguousSlice!S1);
static assert(!isCanonicalSlice!S1);
static assert(!isUniversalSlice!S1);