org.jquantlib.math.randomnumbers
Class RandomSequenceGenerator<RNG extends RandomNumberGenerator>
- java.lang.Object
-
- org.jquantlib.math.randomnumbers.RandomSequenceGenerator<RNG>
-
- Type Parameters:
RNG- is a subclass ofRandomNumberGenerator
- All Implemented Interfaces:
- UniformRandomSequenceGenerator
public class RandomSequenceGenerator<RNG extends RandomNumberGenerator> extends java.lang.Object implements UniformRandomSequenceGenerator
Random sequence generator based on a pseudo-random number generator
-
-
Constructor Summary
Constructors Constructor and Description RandomSequenceGenerator(java.lang.Class<? extends RandomNumberGenerator> classRNG, int dimensionality)RandomSequenceGenerator(java.lang.Class<? extends RandomNumberGenerator> classRNG, int dimensionality, long seed)RandomSequenceGenerator(java.lang.Class<? extends RandomNumberGenerator> classRNG, int dimensionality, RNG rng)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intdimension()Sample<double[]>lastSequence()long[]nextInt32Sequence()Once JVM does not support unsigned fixed arithmetic, we use 64bit variables as containers for 32bit values in order to reduce the complexity and performance overhead of certain fixed arithmetic operations.Sample<double[]>nextSequence()
-
-
-
Constructor Detail
-
RandomSequenceGenerator
public RandomSequenceGenerator(java.lang.Class<? extends RandomNumberGenerator> classRNG, int dimensionality, RNG rng)
-
RandomSequenceGenerator
public RandomSequenceGenerator(java.lang.Class<? extends RandomNumberGenerator> classRNG, int dimensionality)
-
RandomSequenceGenerator
public RandomSequenceGenerator(java.lang.Class<? extends RandomNumberGenerator> classRNG, int dimensionality, long seed)
-
-
Method Detail
-
dimension
public int dimension()
- Specified by:
dimensionin interfaceUniformRandomSequenceGenerator
-
lastSequence
public final Sample<double[]> lastSequence()
- Specified by:
lastSequencein interfaceUniformRandomSequenceGenerator
-
nextSequence
public final Sample<double[]> nextSequence()
- Specified by:
nextSequencein interfaceUniformRandomSequenceGenerator
-
nextInt32Sequence
public long[] nextInt32Sequence()
Description copied from interface:UniformRandomSequenceGeneratorOnce JVM does not support unsigned fixed arithmetic, we use 64bit variables as containers for 32bit values in order to reduce the complexity and performance overhead of certain fixed arithmetic operations.From the user's perspective, it's easier to understand that a certain
longvariable contains values from 0 to 2^32 than understand that a certainintvariable contains negative values that should be converted to it's two's complement and extended to alongvariable before use.- Specified by:
nextInt32Sequencein interfaceUniformRandomSequenceGenerator- Returns:
- an array of unsigned 32bit wide numbers encapsulated in a 64bit containers
- See Also:
- Bug 4504839, Java and Unsigned Types, Two's complement
-
-
DataMelt 3.0 © DataMelt by jWork.ORG