![]() |
Sleipnir C++ API
|
#include </home/runner/work/Sleipnir/Sleipnir/include/sleipnir/autodiff/expression_functions.hpp>
Public Member Functions | |
| constexpr | IfElseExpression (IfElseCondition cond, ExpressionPtr< Scalar > c, ExpressionPtr< Scalar > t, ExpressionPtr< Scalar > f) |
Public Member Functions inherited from slp::detail::NonLeafExpression< IfElseExpression, Scalar, Type, 3 > | |
| constexpr | NonLeafExpression (Args &&... args) |
| void | visit_args (function_ref< void(Expression< Scalar > *arg)> func) const final |
| Scalar | value () const final |
| ExpressionType | type () const final |
| std::string_view | name () const final |
| bool | has_constant_partials () const final |
| void | accumulate_adjoints () const final |
| Accumulates the child adjoints as Scalars. | |
| void | accumulate_adjoints_expr () const final |
| Accumulates the child adjoints as Expressions. | |
Public Member Functions inherited from slp::detail::Expression< Scalar > | |
| constexpr | Expression ()=default |
| Constructs a constant expression with a value of zero. | |
| constexpr | Expression (Scalar value) |
| SLEIPNIR_FORCE_INLINE constexpr bool | is_constant (Scalar constant) const |
Static Public Member Functions | |
| static bool | satisfied (IfElseCondition cond, Scalar c) |
Public Attributes | |
| IfElseCondition | cond |
| The condition checked on c. | |
Public Attributes inherited from slp::detail::NonLeafExpression< IfElseExpression, Scalar, Type, 3 > | |
| std::array< ExpressionPtr< Scalar >, NumArgs > | args |
| The arguments in visit_args() order. | |
Public Attributes inherited from slp::detail::Expression< Scalar > | |
| Scalar | val |
| The value of the expression node. | |
| Scalar | adj |
| The adjoint of the expression node, used during autodiff. | |
| ExpressionPtr< Scalar > | adj_expr |
| int32_t | scratch |
| uint32_t | ref_count |
| Reference count for intrusive shared pointer. | |
| uint32_t | is_leaf |
Static Public Attributes | |
| static constexpr std::string_view | NAME = "if-else" |
| The expression's name. | |
Static Public Attributes inherited from slp::detail::NonLeafExpression< IfElseExpression, Scalar, Type, 3 > | |
| static constexpr bool | CONSTANT_PARTIALS |
| Whether the partial derivatives are the same at every argument value. | |
Additional Inherited Members | |
Public Types inherited from slp::detail::Expression< Scalar > | |
| using | Scalar = Scalar |
| Scalar type alias. | |
Derived expression type for if_else().
Returns t if c satisfies the condition, otherwise f.
| Scalar | Scalar type. |
| Type | Expression type. |
|
inlineconstexpr |
Constructs an if-else expression.
| cond | The condition checked on c. |
| c | The condition's argument. |
| t | Value selected when c satisfies the condition. |
| f | Value selected when c violates the condition. |
|
inlinestatic |
Returns true if c satisfies the condition.
| cond | The condition checked on c. |
| c | The condition's argument. |