public abstract class UnitBallSampler extends Object implements SharedStateObjectSampler<double[]>
Sampling uses:
UniformRandomProvider.nextLong()
UniformRandomProvider.nextDouble() (only for dimensions above 2)
| Constructor and Description |
|---|
UnitBallSampler() |
| Modifier and Type | Method and Description |
|---|---|
static UnitBallSampler |
of(UniformRandomProvider rng,
int dimension)
Create a unit n-ball sampler for the given dimension.
|
abstract double[] |
sample()
Create an object sample.
|
abstract UnitBallSampler |
withUniformRandomProvider(UniformRandomProvider rng)
Create a new instance of the sampler with the same underlying state using the given
uniform random provider as the source of randomness.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsamples, samplespublic UnitBallSampler()
public abstract double[] sample()
ObjectSamplersample in interface ObjectSampler<double[]>public abstract UnitBallSampler withUniformRandomProvider(UniformRandomProvider rng)
withUniformRandomProvider in interface SharedStateSampler<SharedStateObjectSampler<double[]>>rng - Generator of uniformly distributed random numbers.public static UnitBallSampler of(UniformRandomProvider rng, int dimension)
Sampling is supported in dimensions of 1 or above.
rng - Source of randomness.dimension - Space dimension.IllegalArgumentException - If dimension <= 0Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.