Class NormalRandomNumberGenerator
- java.lang.Object
-
- com.opengamma.strata.math.impl.random.NormalRandomNumberGenerator
-
- All Implemented Interfaces:
RandomNumberGenerator
public class NormalRandomNumberGenerator extends Object implements RandomNumberGenerator
Random number generator based onProbabilityDistribution
.
-
-
Constructor Summary
Constructors Constructor Description NormalRandomNumberGenerator(double mean, double sigma)
Creates an instance.NormalRandomNumberGenerator(double mean, double sigma, RandomEngine engine)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getVector(int size)
Gets an array of random numbers.List<double[]>
getVectors(int arraySize, int listSize)
Gets a list of random number arrays.
-
-
-
Constructor Detail
-
NormalRandomNumberGenerator
public NormalRandomNumberGenerator(double mean, double sigma)
Creates an instance.- Parameters:
mean
- the meansigma
- the sigma
-
NormalRandomNumberGenerator
public NormalRandomNumberGenerator(double mean, double sigma, RandomEngine engine)
Creates an instance.- Parameters:
mean
- the meansigma
- the sigmaengine
- the random number engine
-
-
Method Detail
-
getVector
public double[] getVector(int size)
Description copied from interface:RandomNumberGenerator
Gets an array of random numbers.- Specified by:
getVector
in interfaceRandomNumberGenerator
- Parameters:
size
- the size of the resulting array- Returns:
- the array of random numbers
-
getVectors
public List<double[]> getVectors(int arraySize, int listSize)
Description copied from interface:RandomNumberGenerator
Gets a list of random number arrays.- Specified by:
getVectors
in interfaceRandomNumberGenerator
- Parameters:
arraySize
- the size of each resulting arraylistSize
- the size of the list- Returns:
- the list of random number arrays
-
-