SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.random.pseudorandom.linear
Interface LinearCongruentialGenerator

All Superinterfaces:
RandomLongGenerator, RandomNumberGenerator
All Known Implementing Classes:
CombinedLinearCongruentialGenerator, LEcuyer, Lehmer, MRG

public interface LinearCongruentialGenerator
extends RandomLongGenerator

A linear congruential generator (LCG) produces a sequence of pseudo-random numbers based on a linear recurrence relation.

LCGs are simple to understand and implement, but they should not be used for applications where high-quality randomness is critical. The higher quality pseudo-random generators available are, for instances, Mersenne twister and Multiply-with-carry.

However, if only a small number of random numbers are needed, e.g,. a few thousands, then this should be sufficient.

See Also:
Wikipedia: Linear congruential generator

Method Summary
 long modulus()
          Get the modulus of this linear congruential generator.
 int order()
          Get the order of recursion.
 
Methods inherited from interface com.numericalmethod.suanshu.stats.random.RandomLongGenerator
nextLong
 
Methods inherited from interface com.numericalmethod.suanshu.stats.random.RandomNumberGenerator
nextDouble, seed
 

Method Detail

order

int order()
Get the order of recursion.

Returns:
the order of recursion

modulus

long modulus()
Get the modulus of this linear congruential generator.

Returns:
m

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.