a slice
canonical slice
auto slice = iota(2, 3).universal.assumeCanonical; assert(slice == [[0, 1, 2], [3, 4, 5]]); assert(slice._lengths == [2, 3]); assert(slice._strides == [3]);
import mir.ndslice.slice; import mir.ndslice.allocation: slice; auto dataframe = slice!(double, int, string)(2, 3); dataframe.label[] = [1, 2]; dataframe.label!1[] = ["Label1", "Label2", "Label3"]; auto assmcanonicaldf = dataframe.assumeCanonical; assert(assmcanonicaldf._lengths == [2, 3]); assert(assmcanonicaldf._strides == [3]); assert(is(typeof(assmcanonicaldf) == Slice!(double*, 2, Canonical, int*, string*))); assert(assmcanonicaldf.label!0[0] == 1); assert(assmcanonicaldf.label!1[1] == "Label2");
Converts a slice to canonical kind (unsafe).