Class BoxSampler.BoxSamplerND
java.lang.Object
org.apache.commons.rng.sampling.shape.BoxSampler
org.apache.commons.rng.sampling.shape.BoxSampler.BoxSamplerND
- All Implemented Interfaces:
ObjectSampler<double[]>,SharedStateObjectSampler<double[]>,SharedStateSampler<SharedStateObjectSampler<double[]>>
- Enclosing class:
BoxSampler
Sample uniformly from a box in ND.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBoxSamplerND(UniformRandomProvider rng, double[] a, double[] b) BoxSamplerND(UniformRandomProvider rng, BoxSampler.BoxSamplerND source) -
Method Summary
Modifier and TypeMethodDescriptiondouble[]sample()Create an object sample.Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.Methods inherited from class org.apache.commons.rng.sampling.shape.BoxSampler
createSample, ofMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.rng.sampling.ObjectSampler
samples, samples
-
Field Details
-
a
private final double[] aBound a. -
b
private final double[] bBound b.
-
-
Constructor Details
-
BoxSamplerND
BoxSamplerND(UniformRandomProvider rng, double[] a, double[] b) - Parameters:
rng- Source of randomness.a- Bound a.b- Bound b.
-
BoxSamplerND
BoxSamplerND(UniformRandomProvider rng, BoxSampler.BoxSamplerND source) - Parameters:
rng- Source of randomness.source- Source to copy.
-
-
Method Details
-
sample
public double[] sample()Description copied from interface:ObjectSamplerCreate an object sample.- Specified by:
samplein interfaceObjectSampler<double[]>- Specified by:
samplein classBoxSampler- Returns:
- a random Cartesian coordinate within the box.
-
withUniformRandomProvider
Description copied from class:BoxSamplerCreate a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Specified by:
withUniformRandomProviderin interfaceSharedStateSampler<SharedStateObjectSampler<double[]>>- Specified by:
withUniformRandomProviderin classBoxSampler- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-