HalfIntPermutation
Finite integer permutation using cycle-walking over a 2^k-sized block.
Embeds the domain [0, size) in a power-of-two block and applies reversible affine steps plus XOR-shift mixing. Outputs outside [0, size) are rejected and walked until they fall back inside the domain.
Parameters
Random generator used to derive per-round keys.
Number of mixing rounds; higher values increase dispersion.
Odd multiplicative constant used in each affine step.
Constructors
HalfIntPermutation
Parameters
Random generator used to derive per-round keys.
Number of mixing rounds; higher values increase dispersion.
Odd multiplicative constant used in each affine step.
Functions
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.
toString
Returns a view of this permutation that operates on range instead of [0, size). Only valid for finite domains where range.count() == size.