A class used to generate uniform distribution.
More...
#include <UniformDistribution.h>
|
| UniformDistribution (const InputParameters ¶meters) |
|
virtual Real | pdf (const Real &x) const override |
|
virtual Real | cdf (const Real &x) const override |
|
virtual Real | quantile (const Real &y) const override |
|
|
static InputParameters | validParams () |
|
static Real | pdf (const Real &x, const Real &lower_bound, const Real &upper_bound) |
|
static Real | cdf (const Real &x, const Real &lower_bound, const Real &upper_bound) |
|
static Real | quantile (const Real &y, const Real &lower_bound, const Real &upper_bound) |
|
A class used to generate uniform distribution.
Definition at line 21 of file UniformDistribution.h.
◆ UniformDistribution()
UniformDistribution::UniformDistribution |
( |
const InputParameters & |
parameters | ) |
|
Definition at line 26 of file UniformDistribution.C.
27 : Distribution(parameters),
32 mooseError(
"The lower bound is larger than the upper bound!");
◆ cdf() [1/2]
Real UniformDistribution::cdf |
( |
const Real & |
x | ) |
const |
|
overridevirtual |
◆ cdf() [2/2]
Real UniformDistribution::cdf |
( |
const Real & |
x, |
|
|
const Real & |
lower_bound, |
|
|
const Real & |
upper_bound |
|
) |
| |
|
static |
Definition at line 45 of file UniformDistribution.C.
49 else if (x > upper_bound)
52 return (x - lower_bound) / (upper_bound - lower_bound);
Referenced by cdf().
◆ pdf() [1/2]
Real UniformDistribution::pdf |
( |
const Real & |
x | ) |
const |
|
overridevirtual |
◆ pdf() [2/2]
Real UniformDistribution::pdf |
( |
const Real & |
x, |
|
|
const Real & |
lower_bound, |
|
|
const Real & |
upper_bound |
|
) |
| |
|
static |
Definition at line 36 of file UniformDistribution.C.
38 if (x < lower_bound || x > upper_bound)
41 return 1.0 / (upper_bound - lower_bound);
Referenced by pdf().
◆ quantile() [1/2]
Real UniformDistribution::quantile |
( |
const Real & |
y | ) |
const |
|
overridevirtual |
◆ quantile() [2/2]
Real UniformDistribution::quantile |
( |
const Real & |
y, |
|
|
const Real & |
lower_bound, |
|
|
const Real & |
upper_bound |
|
) |
| |
|
static |
Definition at line 56 of file UniformDistribution.C.
59 ::mooseError(
"The cdf_value provided is out of range 0 to 1.");
61 return y * (upper_bound - lower_bound) + lower_bound;
Referenced by quantile().
◆ validParams()
InputParameters UniformDistribution::validParams |
( |
| ) |
|
|
static |
Definition at line 17 of file UniformDistribution.C.
20 params.addClassDescription(
"Continuous uniform distribution.");
21 params.addParam<Real>(
"lower_bound", 0.0,
"Distribution lower bound");
22 params.addParam<Real>(
"upper_bound", 1.0,
"Distribution upper bound");
◆ _lower_bound
const Real& UniformDistribution::_lower_bound |
|
protected |
◆ _upper_bound
const Real& UniformDistribution::_upper_bound |
|
protected |
The documentation for this class was generated from the following files: