19 typedef typename Real_::DoubleType
Double_;
25 #define RandomDist_imports() \
26 using typename Super::Real_; \
27 using typename Super::Double_; \
28 using typename Super::Double; \
29 using typename Super::Alge; \
30 using typename Super::Alge_d; \
31 using typename Super::Uniform; \
32 using Super::getGen; \
96 extern template class RandomDist<Float>;
97 extern template class RandomDist<Double>;
Real cdfInvFind(Real P, Real min, Real max, bool discrete=false) const
Generic binary search algorithm to find Cdf.
Definition: Dist.cpp:10
Alge_< Real > Alge
Definition: Dist.h:21
Algebra.
Definition: Alge.h:13
virtual Real variance() const
Calc variance.
Definition: Dist.h:79
Random number generator interface.
Definition: Gen.h:11
static optnull_t optnull
Null optional, use to reset an optional to an uninitialized state or test for initialization.
Definition: Optional.h:12
Numeral< Real >::Real_ Real_
Definition: Dist.h:18
virtual Real next() const
Get next randomly distributed variate. Requires a random generator (see ctor or setGen()) ...
Definition: Dist.h:41
static Real sqrt(Real x)
Square Root.
Definition: Alge.h:63
virtual Real cdf(Real x) const
Cumulative Distribution Function.
Definition: Dist.h:59
RandomGen & getGen() const
Get random generator.
Definition: Dist.h:86
Real_::DoubleType Double_
Definition: Dist.h:19
Double_::Real Double
Definition: Dist.h:20
#define assert(...)
Forwards to assert_#args. See assert_1(), assert_2().
Definition: Debug.h:24
virtual Real mean() const
Calc mean.
Definition: Dist.h:77
virtual Real cdfComp(Real x) const
Complement of the CDF.
Definition: Dist.h:68
float Real
Real number type. See Real_ for real number operations and constants.
Definition: Real.h:21
Numeric type information, use numeral() to get instance safely from a static context.
Definition: Numeral.h:17
Enables any type to be optional so it can exist in an uninitialized null state.
Definition: Optional.h:52
virtual ~RandomDist()
Definition: Dist.h:38
double Real
Definition: Real.h:14
virtual Real pdf(Real x) const
Probability Density Function.
Definition: Dist.h:50
virtual Real cdfInv(Real P) const
Inverse of the CDF.
Definition: Dist.h:75
Alge_< Double > Alge_d
Definition: Dist.h:22
Real stdDev() const
Calc standard deviation.
Definition: Dist.h:81
RandomDist(optional< RandomGen & > gen=optnull)
Construct with a random generator to use for next()
Definition: Dist.h:36
void setGen(RandomGen &gen)
Set random generator to use for next()
Definition: Dist.h:84
Global Honeycomb namespace.
Uniform_< Double > Uniform
Definition: Dist.h:23
Base class for all random distributions.
Definition: Dist.h:15