VitterStrides
- this
this(size_t N, size_t n)
A postblit is present on this object, but not explicitly documented in the source.
- empty
bool empty()
- length
size_t length()
- opCall
sizediff_t opCall(G gen)
- tail
size_t tail()
import mir.random.engine.xorshift;
auto gen = Xorshift(112);
auto strides = VitterStrides(20, 3);
size_t s;
foreach(_; 0..3)
{
s += strides(gen) + 1;
assert(s + strides.tail == 20);
}
Random sampling utility. Complexity: O(n) References: Jeffrey Scott Vitter, An efficient algorithm for sequential random sampling