Skip to content

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 doublevalue() override
virtual boolIsDeviate() override<br>Determines if the value of the expression contains deviate expressions.

Public Attributes

Name
ConstantExpressionkOne <br>Constant 1 or True.
ConstantExpressionkZero <br>Constant 0 or False.
ConstantExpressionkPi <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 voidValidate() const<br>Validates the expression.
virtual Intervalinterval()
doubleSample()
voidReset()<br>This routine resets the sampling to get new values.

Protected Functions inherited from scram::mef::Expression

Name
voidAddArg(Expression * arg)<br>Registers an additional argument expression.

Public Functions Documentation

function ConstantExpression

cpp
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

cpp
inline virtual double value() override

Return: The mean value of this expression.

Reimplements: scram::mef::Expression::value

function IsDeviate

cpp
inline virtual bool IsDeviate() override

Determines 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

cpp
static ConstantExpression kOne;

Constant 1 or True.

variable kZero

cpp
static ConstantExpression kZero;

Constant 0 or False.

variable kPi

cpp
static ConstantExpression kPi;

Constant PI value.


Updated on 2025-11-11 at 16:51:08 +0000