| LSSTApplications
    20.0.0
    LSSTDataManagementBasePackage | 
 
 
 
Go to the documentation of this file.
   29 #ifndef LSST_AFW_MATH_RANDOM_H 
   30 #define LSST_AFW_MATH_RANDOM_H 
   34 #include "gsl/gsl_rng.h" 
  233     double flat(
double const a, 
double const b);
 
  249     double chisq(
double const nu);
 
  256     double poisson(
double const mu);
 
  265     static char const *
const _algorithmEnvVarName;
 
  266     static char const *
const _seedEnvVarName;
 
  292 template <
typename ImageT>
 
  301 template <
typename ImageT>
 
  311 template <
typename ImageT>
 
  322 template <
typename ImageT>
 
  331 template <
typename ImageT>
 
  341 template <
typename ImageT>
 
  351 template <
typename ImageT>
 
  357 #endif  // LSST_AFW_MATH_RANDOM_H 
  
double flat(double const a, double const b)
Returns a random variate from the flat (uniform) distribution on [a, b).
@ RANLUX
Original version of the RANLUX algorithm, 24-bit output.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
@ RANLXD1
Double precision (48-bit) output using the RANLXS algorithm, luxury level 1 (weakest).
Random & operator=(Random &&)=default
double uniformPos()
Returns a uniformly distributed random double precision floating point number from the generator.
std::string getAlgorithmName() const
Random(Algorithm algorithm=MT19937, unsigned long seed=1)
Creates a random number generator that uses the given algorithm to produce random numbers,...
@ TAUS2
A maximally equidistributed combined Tausworthe generator by L'Ecuyer with improved seeding relative ...
@ RANLUX389
Original version of the RANLUX algorithm, 24-bit output (all bits are decorrelated).
@ TAUS
A maximally equidistributed combined Tausworthe generator by L'Ecuyer.
std::size_t getStateSize() const
double uniform()
Returns a uniformly distributed random double precision floating point number from the generator.
void randomFlatImage(ImageT *image, Random &rand, double const a, double const b)
Set image to random numbers uniformly distributed in the range [a, b)
unsigned long getSeed() const
unsigned long uniformInt(unsigned long n)
Returns a uniformly distributed random integer from 0 to n-1.
@ MRG
Fifth-order multiple recursive generator by L'Ecuyer, Blouin, and Coutre.
Algorithm getAlgorithm() const
static std::vector< std::string > const  & getAlgorithmNames()
@ RANLXS2
Second-generation version of the RANLUX algorithm of Lüscher, 24-bit output, luxury level 2 (stronges...
void randomUniformPosImage(ImageT *image, Random &rand)
Set image to random numbers uniformly distributed in the range (0, 1)
double chisq(double const nu)
Returns a random variate from the chi-squared distribution with nu degrees of freedom.
Algorithm
Identifiers for the list of supported algorithms.
Random(Random &&)=default
Random(Random const &)=default
void randomGaussianImage(ImageT *image, Random &rand)
Set image to random numbers with a gaussian N(0, 1) distribution.
@ CMRG
Combined multiple recursive generator by L'Ecuyer.
std::string State
Accessors for the opaque state of the random number generator.
A base class for image defects.
@ NUM_ALGORITHMS
Number of supported algorithms.
void randomChisqImage(ImageT *image, Random &rand, double const nu)
Set image to random numbers with a chi^2_{nu} distribution.
void setState(State const &state)
@ RANLXS1
Second-generation version of the RANLUX algorithm of Lüscher, 24-bit output, luxury level 1 (stronger...
A class that can be used to generate sequences of random numbers according to a number of different a...
Random & operator=(Random const &)=default
double gaussian()
Returns a gaussian random variate with mean 0 and standard deviation 1
@ RANLXD2
Double precision (48-bit) output using the RANLXS algorithm, luxury level 2 (strongest).
@ GFSR4
A fifth-order multiple recursive generator by L'Ecuyer, Blouin, and Coutre.
void randomUniformIntImage(ImageT *image, Random &rand, unsigned long n)
Set image to random integers uniformly distributed in the range 0 ...
@ RANLXS0
Second-generation version of the RANLUX algorithm of Lüscher, 24-bit output, luxury level 0 (weakest)
@ MT19937
The MT19937 "Mersenne Twister" generator of Makoto Matsumoto and Takuji Nishimura.
void randomUniformImage(ImageT *image, Random &rand)
Set image to random numbers uniformly distributed in the range [0, 1)
Random deepCopy() const
Creates a deep copy of this random number generator.
double poisson(double const mu)
Returns a random variate from the poisson distribution with mean mu.
void randomPoissonImage(ImageT *image, Random &rand, double const mu)
Set image to random numbers with a Poisson distribution with mean mu (n.b.