Class XorGensRandomGenerator
java.lang.Object
org.apache.commons.math3.random.AbstractRandomGenerator
it.unimi.dsi.util.XorGensRandomGenerator
- All Implemented Interfaces:
Serializable, org.apache.commons.math3.random.RandomGenerator
public class XorGensRandomGenerator
extends org.apache.commons.math3.random.AbstractRandomGenerator
implements Serializable
A fast, high-quality 64-bit pseudorandom number generator described in “Some long-period random number generators using shift
and xors”, ANZIAM Journal 48, C188−C202, 2007.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new generator, initializing its seed withUtil.randomSeed().XorGensRandomGenerator(long seed) Creates a new generator using a given seed. -
Method Summary
Methods inherited from class org.apache.commons.math3.random.AbstractRandomGenerator
clear, nextGaussian, setSeed, setSeed
-
Constructor Details
-
XorGensRandomGenerator
public XorGensRandomGenerator()Creates a new generator, initializing its seed withUtil.randomSeed(). -
XorGensRandomGenerator
public XorGensRandomGenerator(long seed) Creates a new generator using a given seed.- Parameters:
seed- a nonzero seed for the generator (if zero, the generator will be seeded with -1).
-
-
Method Details
-
setSeed
public void setSeed(long seed) - Specified by:
setSeedin interfaceorg.apache.commons.math3.random.RandomGenerator- Specified by:
setSeedin classorg.apache.commons.math3.random.AbstractRandomGenerator
-
nextLong
public long nextLong()- Specified by:
nextLongin interfaceorg.apache.commons.math3.random.RandomGenerator- Overrides:
nextLongin classorg.apache.commons.math3.random.AbstractRandomGenerator
-
nextInt
public int nextInt()- Specified by:
nextIntin interfaceorg.apache.commons.math3.random.RandomGenerator- Overrides:
nextIntin classorg.apache.commons.math3.random.AbstractRandomGenerator
-
nextInt
public int nextInt(int n) - Specified by:
nextIntin interfaceorg.apache.commons.math3.random.RandomGenerator- Overrides:
nextIntin classorg.apache.commons.math3.random.AbstractRandomGenerator
-
nextLong
public long nextLong(long n) -
nextDouble
public double nextDouble()- Specified by:
nextDoublein interfaceorg.apache.commons.math3.random.RandomGenerator- Specified by:
nextDoublein classorg.apache.commons.math3.random.AbstractRandomGenerator
-
nextFloat
public float nextFloat()- Specified by:
nextFloatin interfaceorg.apache.commons.math3.random.RandomGenerator- Overrides:
nextFloatin classorg.apache.commons.math3.random.AbstractRandomGenerator
-
nextBoolean
public boolean nextBoolean()- Specified by:
nextBooleanin interfaceorg.apache.commons.math3.random.RandomGenerator- Overrides:
nextBooleanin classorg.apache.commons.math3.random.AbstractRandomGenerator
-
nextBytes
public void nextBytes(byte[] bytes) - Specified by:
nextBytesin interfaceorg.apache.commons.math3.random.RandomGenerator- Overrides:
nextBytesin classorg.apache.commons.math3.random.AbstractRandomGenerator
-