Class HypersphereRVG
- java.lang.Object
-
- dev.nm.stat.random.rng.multivariate.HypersphereRVG
-
- All Implemented Interfaces:
RandomVectorGenerator,Seedable
public class HypersphereRVG extends Object implements RandomVectorGenerator
Generates uniformly distributed points on the surface of a hypersphere.- See Also:
- "Marsaglia, G. "Choosing a Point from the Surface of a Sphere," Ann. Math. Stat. 43, 645-646, 1972."
- http://mathworld.wolfram.com/HyperspherePointPicking.html
-
-
Constructor Summary
Constructors Constructor Description HypersphereRVG(int dimension)Constructs a hypersphere RVG to generate random uniform points.HypersphereRVG(int dimension, RandomStandardNormalGenerator rnorm)Constructs a hypersphere RVG to generate random uniform points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]nextVector()Gets the next random vector.voidseed(long... seeds)Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
HypersphereRVG
public HypersphereRVG(int dimension, RandomStandardNormalGenerator rnorm)Constructs a hypersphere RVG to generate random uniform points.- Parameters:
dimension- the dimension of the hyperspherernorm- the standard Normal RNG to be used
-
HypersphereRVG
public HypersphereRVG(int dimension)
Constructs a hypersphere RVG to generate random uniform points.- Parameters:
dimension- the dimension of the hypersphere
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:SeedableSeed the random number/vector/scenario generator to produce repeatable experiments.
-
nextVector
public double[] nextVector()
Description copied from interface:RandomVectorGeneratorGets the next random vector.- Specified by:
nextVectorin interfaceRandomVectorGenerator- Returns:
- the next random vector
-
-