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