kpermute

SmallLongPermutation

Permutation over [0, size) backed by shuffled lookup tables.

Constructors

SmallLongPermutation

constructor(size: Long, rng: Random)(source)

Properties

size

open override val size: Long(source)

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

Functions

decodeUnchecked

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

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

encodeUnchecked

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

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

toString

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

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

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

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

Link copied to clipboard
open operator override fun iterator(): LongIterator

Iterates encode(i) over the whole domain in index order.

open override fun iterator(offset: Long): LongIterator

Iterates encode(i) for unsigned indices i from offset, which must be in 0..size.

Link copied to clipboard

Returns a view of this permutation shifted onto range, which must hold exactly LongPermutation.size values. On an existing range view, replaces its range.

iterator

open override fun iterator(offset: Long): LongIterator(source)

Iterates encode(i) for unsigned indices i from offset, which must be in 0..size.