Class UniformRNG
- java.lang.Object
-
- dev.nm.stat.random.rng.univariate.uniform.UniformRNG
-
- All Implemented Interfaces:
RandomLongGenerator,RandomNumberGenerator,Seedable
public class UniformRNG extends Object implements RandomLongGenerator
A pseudo uniform random number generator samples numbers from the unit interval, [0, 1], in such a way that there are equal probabilities of them falling in any same length sub-interval. Sampling from the unit interval is the most basic building block of most pseudo random number generation algorithms.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUniformRNG.Methodthe pseudo uniform random number generators available
-
Constructor Summary
Constructors Constructor Description UniformRNG()Construct a pseudo uniform random number generator.UniformRNG(long... seeds)Construct a seeded pseudo uniform random number generator.UniformRNG(UniformRNG.Method method)Construct a pseudo uniform random number generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublenextDouble()Get the next randomdouble.longnextLong()Get the next randomlong.voidseed(long... seeds)Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
UniformRNG
public UniformRNG(UniformRNG.Method method)
Construct a pseudo uniform random number generator.- Parameters:
method- the uniform random number generation algorithm to use
-
UniformRNG
public UniformRNG()
Construct a pseudo uniform random number generator.
-
UniformRNG
public UniformRNG(long... seeds)
Construct a seeded pseudo uniform random number generator.- Parameters:
seeds- the seed(s)
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:SeedableSeed the random number/vector/scenario generator to produce repeatable experiments.
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGeneratorGet the next randomdouble.- Specified by:
nextDoublein interfaceRandomNumberGenerator- Returns:
- the next random number
-
nextLong
public long nextLong()
Description copied from interface:RandomLongGeneratorGet the next randomlong.- Specified by:
nextLongin interfaceRandomLongGenerator- Returns:
- the next random
long
-
-