public abstract class BoxSampler extends Object implements SharedStateObjectSampler<double[]>
Sampling uses:
| Modifier and Type | Method and Description |
|---|---|
static BoxSampler |
of(UniformRandomProvider rng,
double[] a,
double[] b)
Create a box sampler with bounds
a and b. |
abstract double[] |
sample()
Create an object sample.
|
abstract BoxSampler |
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 abstract double[] sample()
ObjectSamplersample in interface ObjectSampler<double[]>public abstract BoxSampler withUniformRandomProvider(UniformRandomProvider rng)
withUniformRandomProvider in interface SharedStateSampler<SharedStateObjectSampler<double[]>>rng - Generator of uniformly distributed random numbers.public static BoxSampler of(UniformRandomProvider rng, double[] a, double[] b)
a and b.
Sampled points are uniformly distributed within the box defined by the bounds.
Sampling is supported in dimensions of 2 or above. Single dimension sampling
can be performed using a LineSampler.
Note: There is no requirement that a <= b. The samples will be uniformly
distributed in the range a to b for each dimension.
rng - Source of randomness.a - Bound a.b - Bound b.IllegalArgumentException - If the bounds do not have the same
dimension; the dimension is less than 2; or bounds have non-finite coordinates.Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.