scram::mef::Histogram
Histogram distribution.
#include <random_deviate.h>
Inherits from scram::mef::RandomDeviate, scram::mef::Expression, boost::noncopyable
Public Functions
| Name | |
|---|---|
| Histogram(std::vector< Expression * > boundaries, std::vector< Expression * > weights)<br>Histogram distribution setup. | |
| virtual void | Validate() const override |
| virtual double | value() override |
| virtual Interval | interval() override |
Additional inherited members
Public Functions inherited from scram::mef::RandomDeviate
| Name | |
|---|---|
| virtual bool | IsDeviate() override<br>Determines if the value of the expression contains deviate expressions. |
| Expression(std::vector< Expression * > args ={})<br>Constructor for use by derived classes to register their arguments. | |
| void | seed(unsigned seed)<br>Sets the seed of the underlying random number generator. |
Protected Functions inherited from scram::mef::RandomDeviate
| Name | |
|---|---|
| std::mt19937 & | rng() |
Public Functions inherited from scram::mef::Expression
| Name | |
|---|---|
| Expression(std::vector< Expression * > args ={})<br>Constructor for use by derived classes to register their arguments. | |
| virtual | ~Expression() =default |
| const std::vector< Expression * > & | args() const |
| virtual bool | IsDeviate()<br>Determines if the value of the expression contains deviate expressions. |
| double | Sample() |
| void | Reset()<br>This routine resets the sampling to get new values. |
Protected Functions inherited from scram::mef::Expression
| Name | |
|---|---|
| void | AddArg(Expression * arg)<br>Registers an additional argument expression. |
Public Functions Documentation
function Histogram
cpp
Histogram(
std::vector< Expression * > boundaries,
std::vector< Expression * > weights
)Histogram distribution setup.
Parameters:
- boundaries The bounds of intervals.
- weights The positive weights of intervals restricted by the upper boundaries. Therefore, the number of weights must be equal to the number of intervals.
Exceptions:
- ValidityError The boundaries container size is not equal to weights container size + 1.
function Validate
cpp
virtual void Validate() const overrideExceptions:
- ValidityError The boundaries are not strictly increasing, or weights are negative.
Reimplements: scram::mef::Expression::Validate
function value
cpp
virtual double value() overrideReturn: The mean value of this expression.
Reimplements: scram::mef::Expression::value
function interval
cpp
inline virtual Interval interval() overrideReturn: The domain interval for validation purposes only.
Reimplements: scram::mef::Expression::interval
Updated on 2025-11-11 at 16:51:08 +0000
