Catalano.Math.Random
Class StandardRandom
- java.lang.Object
-
- Catalano.Math.Random.StandardRandom
-
- All Implemented Interfaces:
- IRandomNumberGenerator
public class StandardRandom extends java.lang.Object implements IRandomNumberGenerator
-
-
Constructor Summary
Constructors Constructor and Description StandardRandom()StandardRandom(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intnextBits(int numbits)Returns up to 32 random bits.doublenextDouble()Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.voidnextDoubles(double[] d)Returns a vector of pseudorandom, uniformly distributed double values between 0.0 and 1.0 from this random number generator's sequence.intnextInt()Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.intnextInt(int n)Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.longnextLong()Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.voidsetSeed(long seed)Set seed.
-
-
-
Constructor Detail
-
StandardRandom
public StandardRandom()
-
StandardRandom
public StandardRandom(long seed)
-
-
Method Detail
-
setSeed
public void setSeed(long seed)
Description copied from interface:IRandomNumberGeneratorSet seed.- Specified by:
setSeedin interfaceIRandomNumberGenerator- Parameters:
seed- Seed.
-
nextBits
public int nextBits(int numbits)
Description copied from interface:IRandomNumberGeneratorReturns up to 32 random bits.- Specified by:
nextBitsin interfaceIRandomNumberGenerator
-
nextInt
public int nextInt()
Description copied from interface:IRandomNumberGeneratorReturns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.- Specified by:
nextIntin interfaceIRandomNumberGenerator
-
nextInt
public int nextInt(int n)
Description copied from interface:IRandomNumberGeneratorReturns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.- Specified by:
nextIntin interfaceIRandomNumberGenerator
-
nextLong
public long nextLong()
Description copied from interface:IRandomNumberGeneratorReturns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.- Specified by:
nextLongin interfaceIRandomNumberGenerator
-
nextDouble
public double nextDouble()
Description copied from interface:IRandomNumberGeneratorReturns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.- Specified by:
nextDoublein interfaceIRandomNumberGenerator
-
nextDoubles
public void nextDoubles(double[] d)
Description copied from interface:IRandomNumberGeneratorReturns a vector of pseudorandom, uniformly distributed double values between 0.0 and 1.0 from this random number generator's sequence.- Specified by:
nextDoublesin interfaceIRandomNumberGenerator
-
-
DataMelt 3.0 © DataMelt by jWork.ORG