Module index_

Source
Expand description

Low-level API for sampling indices

Enumsยง

IndexVec
A vector of indices.
IndexVecIntoIter
Return type of IndexVec::into_iter.
IndexVecIter
Return type of IndexVec::iter.

Traitsยง

UInt ๐Ÿ”’

Functionsยง

sample
Randomly sample exactly amount distinct indices from 0..length, and return them in random order (fully shuffled).
sample_efraimidis_spirakis ๐Ÿ”’
Randomly sample amount distinct indices from 0..length
sample_floyd ๐Ÿ”’
Randomly sample exactly amount indices from 0..length, using Floydโ€™s combination algorithm.
sample_inplace ๐Ÿ”’
Randomly sample exactly amount indices from 0..length, using an inplace partial Fisher-Yates method. Sample an amount of indices using an inplace partial fisher yates method.
sample_rejection ๐Ÿ”’
Randomly sample exactly amount indices from 0..length, using rejection sampling.
sample_weighted
Randomly sample amount distinct indices from 0..length