org.jscience.measure.random
Class UncorrelatedRandomVectorGenerator

java.lang.Object
  extended by org.jscience.measure.random.UncorrelatedRandomVectorGenerator
All Implemented Interfaces:
java.io.Serializable, RandomVectorGenerator

public class UncorrelatedRandomVectorGenerator
extends java.lang.Object
implements java.io.Serializable, RandomVectorGenerator

This class allows to generate random vectors with uncorrelated components.

See Also:
Serialized Form

Constructor Summary
UncorrelatedRandomVectorGenerator(double[] mean, double[] standardDeviation, RandomGenerator generator)
          Simple constructor.
UncorrelatedRandomVectorGenerator(int dimension, RandomGenerator generator)
          Simple constructor.
 
Method Summary
 RandomGenerator getGenerator()
          Get the underlying normalized components generator.
 double[] nextVector()
          Generate a correlated random vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UncorrelatedRandomVectorGenerator

public UncorrelatedRandomVectorGenerator(double[] mean,
                                         double[] standardDeviation,
                                         RandomGenerator generator)
Simple constructor.

Build an uncorrelated random vector generator from its mean and standard deviation vectors.

Parameters:
mean - expected mean values for all components
standardDeviation - standard deviation for all components
generator - underlying generator for uncorrelated normalized components
Throws:
java.lang.IllegalArgumentException - if there is a dimension mismatch between the mean and standard deviation vectors

UncorrelatedRandomVectorGenerator

public UncorrelatedRandomVectorGenerator(int dimension,
                                         RandomGenerator generator)
Simple constructor.

Build a null mean random and unit standard deviation uncorrelated vector generator

Parameters:
dimension - dimension of the vectors to generate
generator - underlying generator for uncorrelated normalized components
Method Detail

getGenerator

public RandomGenerator getGenerator()
Get the underlying normalized components generator.

Returns:
underlying uncorrelated components generator

nextVector

public double[] nextVector()
Generate a correlated random vector.

Specified by:
nextVector in interface RandomVectorGenerator
Returns:
a random vector as an array of double. The generator will reuse the same array for each call, in order to save the allocation time, so the user should keep a copy by himself if he needs so.