N-dimensional slice composed of indeces
auto slice = sparse!double(2, 3); slice[0][] = 1; slice[0, 1] = 2; --slice[0, 0]; slice[1, 2] += 4; assert(slice == [[0, 2, 1], [0, 0, 4]]); import std.range.primitives: isRandomAccessRange; static assert(isRandomAccessRange!(Sparse!(double, 2))); import mir.ndslice.slice: Slice, DeepElementType; static assert(is(Sparse!(double, 2) : Slice!(FieldIterator!(SparseField!double), 2))); static assert(is(DeepElementType!(Sparse!(double, 2)) == double));
Sparse tensors represented in Dictionary of Keys (DOK) format.