byCoordinate

Returns unsorted forward range of coordinates.

byCoordinate
(
T
size_t N
)
(
Slice!(FieldIterator!(SparseField!T), N) slice
)

Parameters

slice
Type: Slice!(FieldIterator!(SparseField!T), N)

sparse slice with pure structure. Any operations on structure of a slice are not allowed.

Examples

1 import mir.array.allocation: array;
2 import mir.ndslice.sorting: sort;
3 
4 auto slice = sparse!double(3, 3);
5 slice[] = [[0, 2, 1], [0, 0, 4], [6, 7, 0]];
6 assert(slice.byCoordinate.array.sort() == [
7     [0, 1],
8     [0, 2],
9     [1, 2],
10     [2, 0],
11     [2, 1]]);

Meta