The OpenD Programming Language

IndexedRoR

Creates a projection of a generalized Collection range for the numeric case case starting from 0 onto a custom range of any type.

Constructors

this
this(Collection collection, Range range)

Members

Aliases

DeepElement
alias DeepElement = ForeachType!Range

Functions

empty
bool empty()

Input range primitives

front
auto front()

Input range primitives

lightConst
auto lightConst()
lightScope
auto lightScope()
lightScope
auto lightScope()
popFront
void popFront()

Input range primitives

save
typeof(this) save()

Forward range primitive. Calls collection.save.

Properties

length
size_t length [@property getter]

Input range primitives

shape
size_t[2] shape [@property getter]

Return Value

Range with a projection to range for every element of collection

Examples

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']]);

See Also

Meta