Class edu.cornell.lassp.houle.RngPack.Ranecu
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cornell.lassp.houle.RngPack.Ranecu

java.lang.Object
   |
   +----edu.cornell.lassp.houle.RngPack.RandomElement
           |
           +----edu.cornell.lassp.houle.RngPack.RandomSeedable
                   |
                   +----edu.cornell.lassp.houle.RngPack.Ranecu

public class Ranecu
extends RandomSeedable
Ranecu is an advanced multiplicative linear congruential random number generator with a period of aproximately 1018. Ranecu is a direct translation from Fortran of the RANECU subroutine published in the paper
F. James, Comp. Phys. Comm. 60 (1990) p 329-344
The algorithm was originally described in
P. L'Ecuyer, Commun. ACM. 1988 (1988) p 742

Source code is available.

Version:
1.0
Author:
Paul Houle (E-mail: houle@msc.cornell.edu)

Variable Index

 o DEFSEED1
default iseed1 = 12345
 o DEFSEED2
default iseed2 = 67890

Constructor Index

 o Ranecu()
Initialize RANECU with the default seeds from James.
 o Ranecu(int, int)
Initialize RANECU with two specified integer seeds.
 o Ranecu(long)
 o Ranecu(Date)

Method Index

 o getSeed()
 o raw()
 o raw(double[], int)
This is an inline version that returns an array of doubles for speed.

Variables

 o DEFSEED1
  public static int DEFSEED1
default iseed1 = 12345
 o DEFSEED2
  public static int DEFSEED2
default iseed2 = 67890

Constructors

 o Ranecu
  public Ranecu()
Initialize RANECU with the default seeds from James.
 o Ranecu
  public Ranecu(int s1,
                int s2)
Initialize RANECU with two specified integer seeds. Use this to introduce repeatable seeds. Equivalent to Ranecu(s1*(long) Integer.MAX_VALUE)+s2)
Parameters:
s1 - seed integer 1 (MSW)
s2 - seed integer 2 (LSW)
 o Ranecu
  public Ranecu(long l)
 o Ranecu
  public Ranecu(Date d)

Methods

 o raw
  public final double raw()
Overrides:
raw in class RandomElement
See Also:
raw
 o raw
  public final void raw(double d[],
                        int n)
This is an inline version that returns an array of doubles for speed.
Overrides:
raw in class RandomElement
 o getSeed
  public long getSeed()
Returns:
the current generator state as a long. Can be used to restart the generator where one left off.

All Packages  Class Hierarchy  This Package  Previous  Next  Index