SharedStateSampler<UnitSphereSampler>public class UnitSphereSampler extends java.lang.Object implements SharedStateSampler<UnitSphereSampler>
Sampling uses:
UniformRandomProvider.nextLong()
UniformRandomProvider.nextDouble()
| Constructor | Description |
|---|---|
UnitSphereSampler(int dimension,
org.apache.commons.rng.UniformRandomProvider rng) |
| Modifier and Type | Method | Description |
|---|---|---|
double[] |
nextVector() |
|
UnitSphereSampler |
withUniformRandomProvider(org.apache.commons.rng.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.
|
public UnitSphereSampler(int dimension, org.apache.commons.rng.UniformRandomProvider rng)
dimension - Space dimension.rng - Generator for the individual components of the vectors.
A shallow copy will be stored in this instance.java.lang.IllegalArgumentException - If dimension <= 0public double[] nextVector()
public UnitSphereSampler withUniformRandomProvider(org.apache.commons.rng.UniformRandomProvider rng)
withUniformRandomProvider in interface SharedStateSampler<UnitSphereSampler>rng - Generator of uniformly distributed random numbers.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.