Input range primitives
Input range primitives
Input range primitives
Forward range primitive. Calls collection.save.
Range with a projection to range for every element of collection
import mir.ndslice.fuse; auto perms = 2.permutations; assert(perms.save.fuse == [[0, 1], [1, 0]]); auto projection = perms.indexedRoR([1, 2]); assert(projection.fuse == [[1, 2], [2, 1]]);
import mir.ndslice.fuse; import std.string: representation; // import mir.ndslice.topology: only; auto projectionD = 2.permutations.indexedRoR("ab"d.representation); assert(projectionD.fuse == [['a', 'b'], ['b', 'a']]); // auto projectionC = 2.permutations.indexedRoR(only('a', 'b')); // assert(projectionC.fuse == [['a', 'b'], ['b', 'a']]);
Creates a projection of a generalized Collection range for the numeric case case starting from 0 onto a custom range of any type.