Class BoxSampler.BoxSampler3D
- java.lang.Object
-
- org.apache.commons.rng.sampling.shape.BoxSampler
-
- org.apache.commons.rng.sampling.shape.BoxSampler.BoxSampler3D
-
- All Implemented Interfaces:
ObjectSampler<double[]>,SharedStateObjectSampler<double[]>,SharedStateSampler<SharedStateObjectSampler<double[]>>
- Enclosing class:
- BoxSampler
private static final class BoxSampler.BoxSampler3D extends BoxSampler
Sample uniformly from a box in 3D. This is an non-array based specialisation ofBoxSampler.BoxSamplerNDfor performance.
-
-
Field Summary
Fields Modifier and Type Field Description private doubleaxThe x component of bound a.private doubleayThe y component of bound a.private doubleazThe z component of bound a.private doublebxThe x component of bound b.private doublebyThe y component of bound b.private doublebzThe z component of bound b.
-
Constructor Summary
Constructors Constructor Description BoxSampler3D(UniformRandomProvider rng, double[] a, double[] b)BoxSampler3D(UniformRandomProvider rng, BoxSampler.BoxSampler3D source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]sample()Create an object sample.BoxSamplerwithUniformRandomProvider(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.-
Methods inherited from class org.apache.commons.rng.sampling.shape.BoxSampler
createSample, of
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.rng.sampling.ObjectSampler
samples, samples
-
-
-
-
Field Detail
-
ax
private final double ax
The x component of bound a.
-
ay
private final double ay
The y component of bound a.
-
az
private final double az
The z component of bound a.
-
bx
private final double bx
The x component of bound b.
-
by
private final double by
The y component of bound b.
-
bz
private final double bz
The z component of bound b.
-
-
Constructor Detail
-
BoxSampler3D
BoxSampler3D(UniformRandomProvider rng, double[] a, double[] b)
- Parameters:
rng- Source of randomness.a- Bound a.b- Bound b.
-
BoxSampler3D
BoxSampler3D(UniformRandomProvider rng, BoxSampler.BoxSampler3D source)
- Parameters:
rng- Source of randomness.source- Source to copy.
-
-
Method Detail
-
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
public BoxSampler withUniformRandomProvider(UniformRandomProvider rng)
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
-
-