|
Colt 1.0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cern.colt.PersistentObject | +--edu.cornell.lassp.houle.RngPack.RandomElement | +--edu.cornell.lassp.houle.RngPack.RandomSeedable | +--cern.jet.random.engine.RandomEngine
Abstract base class for uniform pseudo-random number generating engines.
Most probability distributions are obtained by using a uniform pseudo-random number generation engine
(derived from this class or RandomElement
)
followed by a transformation to the desired distribution.
Thus, subclasses of this class are at the core of computational statistics, simulations, Monte Carlo methods, etc.
Subclasses produce uniformly distributed int's and long's in the closed intervals [Integer.MIN_VALUE,Integer.MAX_VALUE] and [Long.MIN_VALUE,Long.MAX_VALUE], respectively, as well as float's and double's in the open unit intervals (0.0f,1.0f) and (0.0,1.0), respectively.
Subclasses need to override one single method only: nextInt(). All other methods generating different data types or ranges are usually layered upon nextInt(). long's are formed by concatenating two 32 bit int's. float's are formed by dividing the interval [0.0f,1.0f] into 232 sub intervals, then randomly choosing one subinterval. double's are formed by dividing the interval [0.0,1.0] into 264 sub intervals, then randomly choosing one subinterval.
Note that this implementation is not synchronized.
MersenneTwister
,
MersenneTwister64
,
Ranmar
,
Ranlux
,
Ranecu
,
Random
, Serialized FormFields inherited from class cern.colt.PersistentObject |
serialVersionUID |
Method Summary | |
double |
apply(double dummy)
Equivalent to raw(). |
int |
apply(int dummy)
Equivalent to nextInt(). |
static RandomElement |
makeDefault()
Constructs and returns a new uniform random number engine seeded with the current time. |
double |
nextDouble()
Returns a 64 bit uniformly distributed random number in the open unit interval (0.0,1.0) (excluding 0.0 and 1.0). |
float |
nextFloat()
Returns a 32 bit uniformly distributed random number in the open unit interval (0.0f,1.0f) (excluding 0.0f and 1.0f). |
abstract int |
nextInt()
Returns a 32 bit uniformly distributed random number in the closed interval [Integer.MIN_VALUE,Integer.MAX_VALUE] (including Integer.MIN_VALUE and Integer.MAX_VALUE); |
long |
nextLong()
Returns a 64 bit uniformly distributed random number in the closed interval [Long.MIN_VALUE,Long.MAX_VALUE] (including Long.MIN_VALUE and Long.MAX_VALUE). |
double |
raw()
Returns a 32 bit uniformly distributed random number in the open unit interval (0.0,1.0) (excluding 0.0 and 1.0). |
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomSeedable |
ClockSeed, ClockSeed |
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomElement |
choose, choose, gaussian, gaussian, powlaw, raw, raw, uniform |
Methods inherited from class cern.colt.PersistentObject |
clone |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public double apply(double dummy)
apply
in interface DoubleFunction
cern.colt.function.DoubleFunction
argument
- argument passed to the function.public int apply(int dummy)
apply
in interface IntFunction
cern.colt.function.IntFunction
argument
- argument passed to the function.public static RandomElement makeDefault()
MersenneTwister
.public double nextDouble()
(0.0,1.0)
(excluding 0.0 and 1.0).public float nextFloat()
(0.0f,1.0f)
(excluding 0.0f and 1.0f).public abstract int nextInt()
public long nextLong()
public double raw()
(0.0,1.0)
(excluding 0.0 and 1.0).raw
in class RandomElement
edu.cornell.lassp.houle.RngPack.RandomElement
RandomJava
|
Colt 1.0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |