RandomXS128

Constructors

Link copied to clipboard
constructor()

Creates a new random number generator. This constructor sets the seed of the random number generator to a value very likely to be distinct from any other invocation of this constructor.

constructor(seed: Long)

Creates a new random number generator using a single long seed.

constructor(seed0: Long, seed1: Long)

Creates a new random number generator using two long seeds.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun doubles(): DoubleStream
open fun doubles(p0: Long): DoubleStream
open fun doubles(p0: Double, p1: Double): DoubleStream
open fun doubles(p0: Long, p1: Double, p2: Double): DoubleStream
Link copied to clipboard
fun getState(seed: Int): Long

Returns the internal seeds to allow state saving.

Link copied to clipboard
open fun ints(): IntStream
open fun ints(p0: Long): IntStream
open fun ints(p0: Int, p1: Int): IntStream
open fun ints(p0: Long, p1: Int, p2: Int): IntStream
Link copied to clipboard
open fun longs(): LongStream
open fun longs(p0: Long): LongStream
open fun longs(p0: Long, p1: Long): LongStream
open fun longs(p0: Long, p1: Long, p2: Long): LongStream
Link copied to clipboard
open override fun nextBoolean(): Boolean

Returns a pseudo-random, uniformly distributed boolean value from this random number generator's sequence.

Link copied to clipboard
open override fun nextBytes(bytes: ByteArray)

Generates random bytes and places them into a user-supplied byte array. The number of random bytes produced is equal to the length of the byte array.

Link copied to clipboard
open override fun nextDouble(): Double

Returns a pseudo-random, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.

Link copied to clipboard
open override fun nextFloat(): Float

Returns a pseudo-random, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.

Link copied to clipboard
open fun nextGaussian(): Double
Link copied to clipboard
open override fun nextInt(): Int

Returns the next pseudo-random, uniformly distributed int value from this random number generator's sequence.

open override fun nextInt(n: Int): Int

Returns a pseudo-random, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

Link copied to clipboard
open override fun nextLong(): Long

Returns the next pseudo-random, uniformly distributed long value from this random number generator's sequence.

fun nextLong(n: Long): Long

Returns a pseudo-random, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence. The algorithm used to generate the value guarantees that the result is uniform, provided that the sequence of 64-bit values produced by this generator is.

Link copied to clipboard
open override fun setSeed(seed: Long)

Sets the internal seed of this generator based on the given long value.

Link copied to clipboard
fun setState(seed0: Long, seed1: Long)

Sets the internal state of this generator.