Sampler

fun fun interface Sampler<out T : Any>

Sampler that generates chains of values of type T.

Functions

sample
Link copied to clipboard
common
abstract fun sample(generator: RandomGenerator): Chain<T>
Generates a chain of samples.

Inheritors

Distribution
Link copied to clipboard
AhrensDieterExponentialSampler
Link copied to clipboard
AhrensDieterMarsagliaTsangGammaSampler
Link copied to clipboard
AliasMethodDiscreteSampler
Link copied to clipboard
KempSmallMeanPoissonSampler
Link copied to clipboard
BlockingDoubleSampler
Link copied to clipboard
SmallMeanPoissonSampler
Link copied to clipboard
LargeMeanPoissonSampler
Link copied to clipboard
ConstantSampler
Link copied to clipboard
BasicSampler
Link copied to clipboard

Extensions

next
Link copied to clipboard
common
suspend fun <T : Any> Sampler<T>.next(generator: RandomGenerator): T
Samples one value from this Sampler.
sampleBuffer
Link copied to clipboard
common
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

common source
Link copied to clipboard