cern.jet.random.tfloat
Class FloatUniform
- java.lang.Object
-
- cern.colt.PersistentObject
-
- cern.jet.random.tfloat.AbstractFloatDistribution
-
- cern.jet.random.tfloat.AbstractContinousFloatDistribution
-
- cern.jet.random.tfloat.FloatUniform
-
- All Implemented Interfaces:
- FloatFunction, IntFunction, java.io.Serializable, java.lang.Cloneable
public class FloatUniform extends AbstractContinousFloatDistribution
Uniform distribution; Math definition and animated definition.Instance methods operate on a user supplied uniform random number generator; they are unsynchronized.
- Static methods operate on a default uniform random number generator; they are synchronized.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FloatUniform(float min, float max, FloatRandomEngine randomGenerator)Constructs a uniform distribution with the given minimum and maximum.FloatUniform(float min, float max, int seed)Constructs a uniform distribution with the given minimum and maximum, using aFloatMersenneTwisterseeded with the given seed.FloatUniform(FloatRandomEngine randomGenerator)Constructs a uniform distribution with min=0.0 and max=1.0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description floatcdf(float x)Returns the cumulative distribution function (assuming a continous uniform distribution).booleannextBoolean()Returns a uniformly distributed random boolean.floatnextFloat()Returns a uniformly distributed random number in the open interval (min,max) (excluding min and max).floatnextFloatFromTo(float from, float to)Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to).intnextInt()Returns a uniformly distributed random number in the closed interval [min,max] (including min and max).intnextIntFromTo(int from, int to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).longnextLongFromTo(long from, long to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).floatpdf(float x)Returns the probability distribution function (assuming a continous uniform distribution).voidsetState(float min, float max)Sets the internal state.static booleanstaticNextBoolean()Returns a uniformly distributed random boolean.static floatstaticNextFloat()Returns a uniformly distributed random number in the open interval (0,1) (excluding 0 and 1).static floatstaticNextFloatFromTo(float from, float to)Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to).static intstaticNextIntFromTo(int from, int to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).static longstaticNextLongFromTo(long from, long to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to).static voidstaticSetRandomEngine(FloatRandomEngine randomGenerator)Sets the uniform random number generation engine shared by all static methods.java.lang.StringtoString()Returns a String representation of the receiver.-
Methods inherited from class cern.jet.random.tfloat.AbstractFloatDistribution
apply, apply, clone, makeDefaultGenerator
-
-
-
-
Constructor Detail
-
FloatUniform
public FloatUniform(float min, float max, int seed)Constructs a uniform distribution with the given minimum and maximum, using aFloatMersenneTwisterseeded with the given seed.
-
FloatUniform
public FloatUniform(float min, float max, FloatRandomEngine randomGenerator)Constructs a uniform distribution with the given minimum and maximum.
-
FloatUniform
public FloatUniform(FloatRandomEngine randomGenerator)
Constructs a uniform distribution with min=0.0 and max=1.0.
-
-
Method Detail
-
cdf
public float cdf(float x)
Returns the cumulative distribution function (assuming a continous uniform distribution).
-
nextBoolean
public boolean nextBoolean()
Returns a uniformly distributed random boolean.
-
nextFloat
public float nextFloat()
Returns a uniformly distributed random number in the open interval (min,max) (excluding min and max).- Specified by:
nextFloatin classAbstractFloatDistribution
-
nextFloatFromTo
public float nextFloatFromTo(float from, float to)Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to). Pre conditions: from <= to.
-
nextInt
public int nextInt()
Returns a uniformly distributed random number in the closed interval [min,max] (including min and max).- Overrides:
nextIntin classAbstractFloatDistribution
-
nextIntFromTo
public int nextIntFromTo(int from, int to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
-
nextLongFromTo
public long nextLongFromTo(long from, long to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
-
pdf
public float pdf(float x)
Returns the probability distribution function (assuming a continous uniform distribution).
-
setState
public void setState(float min, float max)Sets the internal state.
-
staticNextBoolean
public static boolean staticNextBoolean()
Returns a uniformly distributed random boolean.
-
staticNextFloat
public static float staticNextFloat()
Returns a uniformly distributed random number in the open interval (0,1) (excluding 0 and 1).
-
staticNextFloatFromTo
public static float staticNextFloatFromTo(float from, float to)Returns a uniformly distributed random number in the open interval (from,to) (excluding from and to). Pre conditions: from <= to.
-
staticNextIntFromTo
public static int staticNextIntFromTo(int from, int to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
-
staticNextLongFromTo
public static long staticNextLongFromTo(long from, long to)Returns a uniformly distributed random number in the closed interval [from,to] (including from and to). Pre conditions: from <= to.
-
staticSetRandomEngine
public static void staticSetRandomEngine(FloatRandomEngine randomGenerator)
Sets the uniform random number generation engine shared by all static methods.- Parameters:
randomGenerator- the new uniform random number generation engine to be shared.
-
toString
public java.lang.String toString()
Returns a String representation of the receiver.- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG