scram::mef::ConstantExpression
Indicates a constant value.
#include <constant.h>
Inherits from scram::mef::Expression, boost::noncopyable
Public Functions
| Name | |
|---|---|
| ConstantExpression(double value)<br>Constructor for constant integer, float, and bool values. | |
| virtual double | value() override |
| virtual bool | IsDeviate() override<br>Determines if the value of the expression contains deviate expressions. |
Public Attributes
| Name | |
|---|---|
| ConstantExpression | kOne <br>Constant 1 or True. |
| ConstantExpression | kZero <br>Constant 0 or False. |
| ConstantExpression | kPi <br>Constant PI value. |
Additional inherited members
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 void | Validate() const<br>Validates the expression. |
| virtual Interval | interval() |
| 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 ConstantExpression
inline explicit ConstantExpression(
double value
)Constructor for constant integer, float, and bool values.
Parameters:
- value Numerical value.
In other words, this constructor is implicitly generic.
function value
inline virtual double value() overrideReturn: The mean value of this expression.
Reimplements: scram::mef::Expression::value
function IsDeviate
inline virtual bool IsDeviate() overrideDetermines if the value of the expression contains deviate expressions.
Return:
- true if the expression's value deviates from its mean.
- false if the expression's value does not need sampling.
Warning: Improper registration of arguments may yield silent failure.
Reimplements: scram::mef::Expression::IsDeviate
The default logic is to check arguments with uncertainties for sampling. Derived expression classes must decide if they don't have arguments, or if they are random deviates.
Public Attributes Documentation
variable kOne
static ConstantExpression kOne;Constant 1 or True.
variable kZero
static ConstantExpression kZero;Constant 0 or False.
variable kPi
static ConstantExpression kPi;Constant PI value.
Updated on 2025-11-11 at 16:51:08 +0000
