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.

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 Coefficients
    long maximumPeriod()
    Retrieve the Maximum Period
    double nextDouble01()
    Retrieve a Random Number between 0 and 1
    long nextLong()
    Generate the Next Long in the Sequence
    static ShiftRegisterGenerator Standard​(int iK)
    Construct a Standard Instance of ShiftRegisterGenerator from the Specified Period Power
    boolean[] x()
    Retrieve the Array of State Values

    Methods 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.Exception
      ShiftRegisterGenerator Constructor
      Parameters:
      abA - Array of Coefficients
      abX - Array of State Values
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid
  • Method Details

    • Standard

      public static final ShiftRegisterGenerator Standard​(int iK)
      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: RandomNumberGenerator
      Retrieve a Random Number between 0 and 1
      Overrides:
      nextDouble01 in class RandomNumberGenerator
      Returns:
      Random Number between 0 and 1