Package org.drip.measure.crng
Class ShiftRegisterGenerator
java.lang.Object
org.drip.measure.crng.RandomNumberGenerator
org.drip.measure.crng.ShiftRegisterGenerator
public class ShiftRegisterGenerator extends RandomNumberGenerator
ShiftRegisterGenerator implements a RNG based on the Shift Register Generation Scheme.
- Module = Computational Core Module
- Library = Numerical Analysis Library
- Project = Rd Continuous/Discrete Probability Measures
- Package = Continuous Random Number Stream Generator
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description ShiftRegisterGenerator(boolean[] abA, boolean[] abX)ShiftRegisterGenerator Constructor -
Method Summary
Modifier and Type Method Description boolean[]a()Retrieve the Array of CoefficientslongmaximumPeriod()Retrieve the Maximum PerioddoublenextDouble01()Retrieve a Random Number between 0 and 1longnextLong()Generate the Next Long in the Sequencestatic ShiftRegisterGeneratorStandard(int iK)Construct a Standard Instance of ShiftRegisterGenerator from the Specified Period Powerboolean[]x()Retrieve the Array of State ValuesMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ShiftRegisterGenerator
public ShiftRegisterGenerator(boolean[] abA, boolean[] abX) throws java.lang.ExceptionShiftRegisterGenerator Constructor- Parameters:
abA- Array of CoefficientsabX- Array of State Values- Throws:
java.lang.Exception- Thrown if the Inputs are Invalid
-
-
Method Details
-
Standard
Construct a Standard Instance of ShiftRegisterGenerator from the Specified Period Power- Parameters:
iK- The Period Power- Returns:
- Instance of ShiftRegisterGenerator
-
a
public boolean[] a()Retrieve the Array of Coefficients- Returns:
- The Array of Coefficients
-
x
public boolean[] x()Retrieve the Array of State Values- Returns:
- The Array of State Values
-
maximumPeriod
public long maximumPeriod()Retrieve the Maximum Period- Returns:
- The Maximum Period
-
nextLong
public long nextLong()Generate the Next Long in the Sequence- Returns:
- The Next Long in the Sequence
-
nextDouble01
public double nextDouble01()Description copied from class:RandomNumberGeneratorRetrieve a Random Number between 0 and 1- Overrides:
nextDouble01in classRandomNumberGenerator- Returns:
- Random Number between 0 and 1
-