kpermute

FullIntPermutation

class FullIntPermutation(rng: Random = Random.Default, rounds: Int = 2, c1: Int = -2048144789, c2: Int = -1028477387) : IntPermutation(source)

Permutation over all 32-bit values using keyed xor-shift-multiply rounds. The multipliers c1 and c2 must be odd.

Constructors

FullIntPermutation

constructor(rng: Random = Random.Default, rounds: Int = 2, c1: Int = -2048144789, c2: Int = -1028477387)(source)

Properties

size

open override val size: Int(source)

Domain size, read as unsigned; -1 means all 32-bit values.

Functions

decodeUnchecked

open override fun decodeUnchecked(encoded: Int): Int(source)

decode without range checks. Out-of-domain input is unspecified and may not terminate.

encodeUnchecked

open override fun encodeUnchecked(value: Int): Int(source)

encode without range checks. Out-of-domain input is unspecified and may not terminate.

iterator

open override fun iterator(offset: Int): IntIterator(source)

Iterates unsigned indices from offset through -1.

toString

open override fun toString(): String(source)
Link copied to clipboard
open fun decode(encoded: Int): Int

Inverse of encode; throws if encoded is outside the domain.

Link copied to clipboard
open fun encode(value: Int): Int

Maps value to its permuted position; throws if value is outside the domain.

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.