ArrayIntPermutation
Finite in-memory integer permutation backed by an IntArray lookup table.
Builds a random bijection over [0, size) by shuffling the identity mapping and precomputing the inverse. Encode and decode are O(1) array lookups.
Parameters
Random generator used to create the shuffled mapping.
Properties
Functions
Decodes a previously encoded value without range checks.
Encodes a value without range checks.
Returns an iterator over encode(i) for indices in [offset, size).
Returns an iterator over encode(i) for all i in [0, size) for finite domains, or over the full 32-bit space when size == -1.
Returns a view of this permutation that operates on range instead of [0, size). Only valid for finite domains where range.count() == size.
ArrayIntPermutation
decodeUnchecked
Decodes a previously encoded value without range checks.
encodeUnchecked
Encodes a value without range checks.
iterator
Returns an iterator over encode(i) for indices in [offset, size).
For finite domains, offset is an index in 0..size. For full-domain implementations, semantics are defined by the implementation.