Sampler

fun interface Sampler<out T : Any>

Sampler that generates chains of values of type T.

Functions

Link copied to clipboard
abstract fun sample(generator: RandomGenerator): Chain<T>

Generates a chain of samples.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
suspend fun <T : Any> Sampler<T>.next(generator: RandomGenerator): T

Samples one value from this Sampler.

Link copied to clipboard
suspend fun Sampler<Double>.nextBuffer(generator: RandomGenerator, size: Int): Buffer<Double>

Samples a Buffer of values from this Sampler.

Link copied to clipboard
fun <T : Any> Sampler<T>.sampleBuffer(generator: RandomGenerator, size: Int, bufferFactory: BufferFactory<T> = Buffer.Companion::boxing): Chain<Buffer<T>>

Sample a bunch of values

@JvmName(name = "sampleRealBuffer")
fun Sampler<Double>.sampleBuffer(generator: RandomGenerator, size: Int): Chain<Buffer<Double>>

Generates size real samples and chunks them into some buffers.

@JvmName(name = "sampleIntBuffer")
fun Sampler<Int>.sampleBuffer(generator: RandomGenerator, size: Int): Chain<Buffer<Int>>

Generates size integer samples and chunks them into some buffers.

Sources

Link copied to clipboard