Top Description Fields Constructors Methods
org.apache.commons.math3.random

public Class UnitSphereRandomVectorGenerator

extends Object
implements RandomVectorGenerator
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.random.RandomVectorGenerator
Imports
org.apache.commons.math3.util.FastMath

Generate random vectors isotropically located on the surface of a sphere.
Since
2.1

Field Summary

Modifier and TypeField and Description
private final int
dimension

Space dimension.

private final RandomGenerator
rand

RNG used for generating the individual components of the vectors.

Constructor Summary

AccessConstructor and Description
public
UnitSphereRandomVectorGenerator(final int
Space dimension.
dimension
,
final RandomGenerator
RNG for the individual components of the vectors.
rand
)

public
UnitSphereRandomVectorGenerator(final int
Space dimension.
dimension
)

Create an object that will use a default RNG (MersenneTwister), in order to generate the individual components.

Method Summary

Modifier and TypeMethod and Description
public double[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dimensionback to summary
private final int dimension

Space dimension.

randback to summary
private final RandomGenerator rand

RNG used for generating the individual components of the vectors.

Constructor Detail

UnitSphereRandomVectorGeneratorback to summary
public UnitSphereRandomVectorGenerator(final int dimension, final RandomGenerator rand)
Parameters
dimension:int

Space dimension.

rand:RandomGenerator

RNG for the individual components of the vectors.

UnitSphereRandomVectorGeneratorback to summary
public UnitSphereRandomVectorGenerator(final int dimension)

Create an object that will use a default RNG (MersenneTwister), in order to generate the individual components.

Parameters
dimension:int

Space dimension.

Method Detail

nextVectorback to summary
public double[] nextVector()

Implements org.apache.commons.math3.random.RandomVectorGenerator.nextVector.

Doc from org.apache.commons.math3.random.RandomVectorGenerator.nextVector.

Generate a random vector.

Returns:double[]

a random vector as an array of double.