Java Randomness Test Suite

JRandTest at SourceForge

com.fasteasytrade.JRandTest.Algo
Class Lcg1Prng

java.lang.Object
  extended bycom.fasteasytrade.JRandTest.Algo.Cipher
      extended bycom.fasteasytrade.JRandTest.Algo.Lcg1Prng

public class Lcg1Prng
extends Cipher

Simple LCG from NIST test package

Seed to LCG is double

Each cycle returns new double.

Author:
Zur Aougav

Field Summary
(package private)  double DA1
          DA1 = 950706376 mod 2**16
(package private)  double DA2
          DA2 = 950706376 - DA1
(package private)  double DTWO31
          DTWO31 = 2 ** 31
(package private)  double DTWO31M1
          DTWO31M1 = 2 ** 31 - 1
(package private)  double seed
          seed contains the "state" of the LCG
 
Constructor Summary
(package private) Lcg1Prng()
           
(package private) Lcg1Prng(double seed)
           
 
Method Summary
 double nextDouble()
           
 
Methods inherited from class com.fasteasytrade.JRandTest.Algo.Cipher
compareBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

seed

double seed
seed contains the "state" of the LCG


DTWO31

final double DTWO31
DTWO31 = 2 ** 31

See Also:
Constant Field Values

DTWO31M1

final double DTWO31M1
DTWO31M1 = 2 ** 31 - 1

See Also:
Constant Field Values

DA1

final double DA1
DA1 = 950706376 mod 2**16

See Also:
Constant Field Values

DA2

final double DA2
DA2 = 950706376 - DA1

See Also:
Constant Field Values
Constructor Detail

Lcg1Prng

Lcg1Prng()

Lcg1Prng

Lcg1Prng(double seed)
Method Detail

nextDouble

public double nextDouble()

Java Randomness Test Suite

JRandTest at SourceForge

JRandTest at SourceForge
Copyright © 2005 Zur Aougav. All Rights Reserved.