Go to the documentation of this file.
31 #include <casacore/casa/aips.h>
32 #include <casacore/casa/BasicMath/Math.h>
36 template<
class T>
class Vector;
130 virtual void reset() = 0;
237 virtual void reset();
319 virtual void reset();
Binomial(RNG *gen, uInt n=1, Double p=0.5)
Construct a random number generator for a binomial distribution.
virtual Bool checkParameters(const Vector< Double > &parms) const
Float asFloat()
Return random bits converted to either a Float or a Double.
virtual Bool checkParameters(const Vector< Double > &parms) const
2 parameters, alpha and beta.
virtual Vector< Double > parameters() const =0
Geometric(RNG *gen, Double probability=0.5)
Construct a random number generator for a geometric uniform distribution.
2 parameters, mean and variance.
virtual Double operator()()
Returns a value from the geometric uniform distribution.
LatticeExprNode variance(const LatticeExprNode &expr)
virtual Double operator()()
Returns a value from the Weiball distribution.
virtual Double operator()()
Returns a value from the Poisson distribution.
virtual ~Normal()
The destructor is trivial.
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (mean & variance) described above through the b...
Double mean() const
Functions that allow you to query and change the parameters of the hypergeometric distribution.
virtual uInt asuInt()=0
Return the 32-random bits as an unsigned integer.
virtual Vector< Double > parameters() const
virtual Double operator()()
Returns a value from the hypergeometric distribution.
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (mean) described above through the base class.
virtual Bool checkParameters(const Vector< Double > &parms) const
Double mean() const
Functions that allow you to query and change the parameters of the Poisson distribution.
Double mean() const
Functions that allow you to query and change the parameters of the discrete uniform distribution.
static Random::Types asType(const String &str)
Convert the string to enumerator.
virtual Vector< Double > parameters() const
virtual ~MLCG()
The destructor is trivial
virtual ~Poisson()
The destructor is trivial.
HyperGeometric(RNG *gen, Double mean=0.5, Double variance=1.0)
Construct a random number generator for an hypergeometric distribution.
Discrete geometric distribution.
LatticeExprNode mean(const LatticeExprNode &expr)
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (mean & variance) described above through the b...
static String asString(Random::Types type)
Convert the enumerator to a lower-case string.
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (mean & variance) described above through the b...
virtual void setParameters(const Vector< Double > &parms)=0
These function allow you to manipulate the parameters (mean variance etc.) of random number distribut...
virtual Bool checkParameters(const Vector< Double > &parms) const
virtual Vector< Double > parameters() const
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (alpha & beta) described above through the base...
virtual Bool checkParameters(const Vector< Double > &parms) const
virtual Double operator()()
Returns a value from the Binomial distribution.
Base class for random number distributions.
virtual Vector< Double > parameters() const
Weibull(RNG *gen, Double alpha=1.0, Double beta=1.0)
Construct a random number generator for a uniform distribution.
virtual Bool checkParameters(const Vector< Double > &parms) const
static Random * construct(Random::Types type, RNG *gen)
Convert the Random::Type enumerator to a specific object (derived from Random but upcast to a Random ...
virtual Double operator()()
Returns a value from the log-normal distribution.
virtual Bool checkParameters(const Vector< Double > &parms) const
Int seed1() const
Functions that allow the user to retrieve or change the seed integers.
Types
This enumerator lists all the predefined random number distributions.
virtual ~Binomial()
The destructor is trivial.
Additive number generator.
virtual Bool checkParameters(const Vector< Double > &parms) const =0
2 parameters, low and high.
virtual ~Weibull()
The destructor is trivial.
Negative exponential distribution.
virtual Bool checkParameters(const Vector< Double > &parms) const
virtual ~LogNormal()
The destructor is trivial.
virtual void reset()
Resets the random number generator.
virtual ~HyperGeometric()
The destructor is trivial.
virtual Vector< Double > parameters() const
virtual ~Random()
A virtual destructor is needed to ensure that the destructor of derived classes gets used.
virtual Double operator()()
Returns a value from the normal distribution.
this file contains all the compiler specific defines
2 parameters, mean and variance.
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameter (probability) described above through the base c...
virtual void reset()
Resets the random number generator.
2 parameters, mean and variance.
static Vector< Double > defaultParameters(Random::Types type)
returns the default parameters for the specified distribution.
virtual Double variance() const
virtual ~Geometric()
The destructor is trivial.
MLCG(Int seed1=0, Int seed2=1)
The constructor allows you to specify seeds.
virtual Double operator()()
Returns a value from the Erlang distribution.
Erlang(RNG *gen, Double mean=1.0, Double variance=1.0)
Construct a random number generator for an Erlang distribution.
Multiplicative linear congruential generator.
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (mean) described above through the base class.
virtual ~RNG()
A virtual destructor is needed to ensure that the destructor of derived classes gets used.
uInt n() const
Functions that allow you to query and change the parameters of the binomial distribution.
Double probability() const
Functions that allow you to query and change the parameters of the geometric uniform distribution.
virtual Double operator()()=0
This function returns a random number from the appropriate distribution.
virtual Vector< Double > parameters() const
virtual Vector< Double > parameters() const
virtual ~NegativeExpntl()
The destructor is trivial.
LogNormal(RNG *gen, Double mean=1.0, Double variance=1.0)
Construct a random number generator for a log-normal distribution.
virtual uInt asuInt()
Return the 32-random bits as an unsigned integer.
virtual Double mean() const
Functions that allow you to query and change the parameters of the log-normal distribution.
Base class for random number generators.
virtual Double operator()()
Returns a value from the negative exponential distribution.
String: the storage and methods of handling collections of characters.
Double alpha() const
Functions that allow you to query and change the parameters of the Weiball distribution.
2 parameters, the mean and variance.
bool Bool
Define the standard types used by Casacore.
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (n & p) described above through the base class.
Normal or Gaussian distribution.
ACG(uInt seed=0, Int size=55)
The constructor allows you to specify seeds.
An non-predefined random number distribution.
virtual void setParameters(const Vector< Double > &parms)
These function allow you to manipulate the parameters (mean & variance) described above through the b...
virtual uInt asuInt()
Return the 32-random bits as an unsigned integer.
virtual ~ACG()
The destructor cleans up memory allocated by this class.
NegativeExpntl(RNG *gen, Double mean=1.0)
Construct a random number generator for a negative exponential distribution.
virtual Double variance() const
Hypergeometric distribution.
void reseed(Int s1, Int s2)
virtual ~Erlang()
The destructor is trivial.
Logarithmic normal distribution.
virtual Double mean() const
Functions that allow you to query and change the parameters of the normal distribution.
virtual Vector< Double > parameters() const
virtual Bool checkParameters(const Vector< Double > &parms) const
virtual void reset()=0
Resets the random number generator.
Normal(RNG *gen, Double mean=0.0, Double variance=1.0)
Construct a random number generator for a normal distribution.
Poisson(RNG *gen, Double mean=0.0)
Construct a random number generator for a Poisson distribution.
RNG * generator()
Functions that allow you to access and change the class that generates the random bits.
virtual Vector< Double > parameters() const
Double mean() const
Functions that allow you to query and change the parameters of the negative exponential distribution.