intPermutation
Creates an IntPermutation for a contiguous integer domain.
The concrete implementation depends on size:
size == -1uses FullIntPermutation over the full signed 32-bit range.size < 0(excluding-1) uses UIntPermutation over an unsigned-style domain.0 <= size <= 16uses ArrayIntPermutation.size > 16uses HalfIntPermutation with cycle-walking over a 2^k block.
When rounds is 0, a size-dependent default is chosen to balance speed and dispersion. The permutation is reproducible for a given rng state.
Return
an IntPermutation with domain [0, size) or the full 32-bit space when size == -1.
Parameters
domain size. For non-negative values the domain is [0, size). Special values: -1 selects a full 32-bit permutation, other negative values select an unsigned-style domain.
random source used to derive internal keys and parameters.
number of mixing rounds; 0 selects a reasonable default per implementation.
Creates an IntPermutation using a seed-based Random instance.
This overload behaves like intPermutation with an explicit rng, but derives the random source from seed. For a fixed combination of [size, seed, rounds] the resulting permutation is deterministic.
Return
an IntPermutation with domain [0, size) or the full 32-bit space when size == -1.
Parameters
domain size; see intPermutation for semantics and special values.
seed used to construct the underlying Random.
number of mixing rounds; 0 selects a reasonable default per implementation.
See also
Creates an IntPermutation for values within the given inclusive range.
Internally this constructs a permutation over a domain of length range.last - range.first + 1, then wraps it so that IntPermutation.encode and IntPermutation.decode operate directly on values in range.
The same implementation selection rules and default rounds logic as intPermutation are used based on the range length.
Return
an IntPermutation whose domain is exactly range.
Parameters
inclusive range of values to permute.
random source used to derive internal keys and parameters.
number of mixing rounds; 0 selects a reasonable default per implementation.
Throws
if range is empty or its length exceeds Int.MAX_VALUE.
Creates an IntPermutation for the given inclusive range using a seed-based Random instance.
This overload behaves like intPermutation with an explicit rng, but derives the random source from seed.
Return
an IntPermutation whose domain is exactly range.
Parameters
inclusive range of values to permute.
seed used to construct the underlying Random.
number of mixing rounds; 0 selects a reasonable default per implementation.
See also
longPermutation
Creates a LongPermutation for a contiguous long domain.
The concrete implementation depends on size:
size == -1Luses FullLongPermutation over the full signed 64-bit range.size < 0L(excluding-1L) uses ULongPermutation over an unsigned-style domain.0 <= size <= 16Luses ArrayLongPermutation.size > 16Luses HalfLongPermutation with cycle-walking over a 2^k block.
When rounds is 0, a size-dependent default is chosen to balance speed and dispersion. The permutation is reproducible for a given rng state.
Return
a LongPermutation with domain [0, size) or the full 64-bit space when size == -1L.
Parameters
domain size. For non-negative values the domain is [0, size). Special values: -1L selects a full 64-bit permutation, other negative values select an unsigned-style domain.
random source used to derive internal keys and parameters.
number of mixing rounds; 0 selects a reasonable default per implementation.
Creates a LongPermutation using a seed-based Random instance.
This overload behaves like longPermutation with an explicit rng, but derives the random source from seed. For a fixed combination of [size, seed, rounds] the resulting permutation is deterministic.
Return
a LongPermutation with domain [0, size) or the full 64-bit space when size == -1L.
Parameters
domain size; see longPermutation for semantics and special values.
seed used to construct the underlying Random.
number of mixing rounds; 0 selects a reasonable default per implementation.
See also
Creates a LongPermutation for values within the given inclusive range.
Internally this constructs a permutation over a domain of length range.last - range.first + 1, then wraps it so that IntPermutation.encode and IntPermutation.decode operate directly on values in range.
The same implementation selection rules and default rounds logic as longPermutation are used based on the range length.
Return
a LongPermutation whose domain is exactly range.
Parameters
inclusive range of values to permute.
random source used to derive internal keys and parameters.
number of mixing rounds; 0 selects a reasonable default per implementation.
Throws
if range is empty or its length exceeds Long.MAX_VALUE.
Creates a LongPermutation for the given inclusive range using a seed-based Random instance.
This overload behaves like longPermutation with an explicit rng, but derives the random source from seed.
Return
a LongPermutation whose domain is exactly range.
Parameters
inclusive range of values to permute.
seed used to construct the underlying Random.
number of mixing rounds; 0 selects a reasonable default per implementation.