BoundedIntPermutation
class BoundedIntPermutation(val size: Int, rng: Random = Random.Default, rounds: Int = 3, const: UInt) : IntPermutation(source)
Permutation over [0, size) that mixes within the enclosing power-of-two block and cycle-walks until the output lands in range. size is read as unsigned, so -1 means 2^32 - 1 values. const must be odd.
Constructors
BoundedIntPermutation
Properties
size
Functions
decode
decodeUnchecked
decode without range checks. Out-of-domain input is unspecified and may not terminate.
encode
encodeUnchecked
encode without range checks. Out-of-domain input is unspecified and may not terminate.
iterator
Iterates encode(i) for unsigned indices i from offset, which must be in 0..size.
toString
Link copied to clipboard
Returns a view of this permutation shifted onto range, which must hold exactly IntPermutation.size values. On an existing range view, replaces its range.