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. It provides
the following Functionality:
- Construct a Standard Instance of ShiftRegisterGenerator from the Specified Period Power
- ShiftRegisterGenerator Constructor
- Retrieve the Array of Coefficients
- Retrieve the Array of State Values
- Retrieve the Maximum Period
- Generate the Next Long in the Sequence
- Retrieve a Random Number between 0 and 1
| 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[] coefficientArray, boolean[] stateValueArray)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 k)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[] coefficientArray, boolean[] stateValueArray) throws java.lang.ExceptionShiftRegisterGenerator Constructor- Parameters:
coefficientArray- Array of CoefficientsstateValueArray- 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:
k- 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()Retrieve a Random Number between 0 and 1- Overrides:
nextDouble01in classRandomNumberGenerator- Returns:
- Random Number between 0 and 1
-