59 #ifndef distribution_H
60 #define distribution_H
177 virtual scalar
sample()
const = 0;
183 virtual scalar
min()
const = 0;
186 virtual scalar
max()
const = 0;
189 virtual scalar
mean()
const = 0;
206 template<
class Base,
class Derived>
233 static_cast<const Derived&
>(*this).sample();
#define forAll(list, i)
Loop across all elements in list.
virtual tmp< scalarField > sample(const label n) const
Sample the distribution.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Accumulating histogram of values. Specified bin resolution automatic generation of bins.
virtual tmp< scalarField > PDF(const scalarField &x) const =0
Return the distribution probability density function.
void report() const
Report.
virtual scalar max() const =0
Return the maximum value.
autoPtr< distribution > clone() const
Construct and return a clone.
Random & rndGen_
Reference to a random number generator.
declareRunTimeSelectionTable(autoPtr, distribution, dictionary,(const dictionary &dict, Random &rndGen, const label sampleQ),(dict, rndGen, sampleQ))
Declare runtime constructor selection table.
virtual void validatePositive(const dictionary &dict) const
Validate that the lower bound is positive.
tmp< scalarField > clipPDF(const scalarField &x, const tmp< scalarField > &pdf) const
Clip the PDF values to zero outside the bounds.
virtual scalar sample() const =0
Sample the distribution.
const label Q_
Distribution size exponent.
label q() const
Return the effective distribution size exponent.
virtual ~distribution()
Destructor.
static autoPtr< distribution > New(const dictionary &dict, Random &rndGen, const label sampleQ)
Selector.
virtual tmp< scalarField > x(const label n) const
Return coordinates to plot across the range of the distribution.
const label sampleQ_
Sample size exponent.
virtual void validateBounds(const dictionary &dict) const
Validate that the bounds are monotonic.
TypeName("distribution")
Runtime type information.
distribution()
Construct null.
virtual scalar min() const =0
Return the minimum value.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
word name(const complex &)
Return a string representation of a complex.