![]() |
Sleipnir C++ API
|
#include </home/runner/work/Sleipnir/Sleipnir/include/sleipnir/autodiff/expression.hpp>
Public Member Functions | |
| constexpr | AbsExpression (ExpressionPtr< Scalar > x) |
| void | visit_args (function_ref< void(Expression< Scalar > *arg)> func) const override |
| Scalar | value () const override |
| ExpressionType | type () const override |
| std::string_view | name () const override |
| void | accumulate_adjoints () const override |
| Accumulates the child adjoints as Scalars. | |
| void | accumulate_adjoints_expr () const override |
| 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) |
| constexpr bool | is_constant (Scalar constant) const |
Public Attributes | |
| ExpressionPtr< Scalar > | x |
| Unary operator's operand. | |
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 |
| bool | is_leaf |
| int32_t | scratch |
| uint32_t | ref_count |
| Reference count for intrusive shared pointer. | |
Additional Inherited Members | |
Public Types inherited from slp::detail::Expression< Scalar > | |
| using | Scalar = Scalar |
| Scalar type alias. | |
Derived expression type for abs().
| Scalar | Scalar type. |
|
inlineexplicitconstexpr |
Constructs an unary expression (an operator with one argument).
| x | Unary operator's operand. |
|
inlineoverridevirtual |
Accumulates the child adjoints as Scalars.
Reimplemented from slp::detail::Expression< Scalar >.
|
inlineoverridevirtual |
Accumulates the child adjoints as Expressions.
Reimplemented from slp::detail::Expression< Scalar >.
|
inlineoverridevirtual |
Returns the name of this expression.
Implements slp::detail::Expression< Scalar >.
|
inlineoverridevirtual |
Returns the type of this expression (constant, linear, quadratic, or nonlinear).
Implements slp::detail::Expression< Scalar >.
|
inlineoverridevirtual |
Either nullary operator with no arguments, unary operator with one argument, or binary operator with two arguments. This operator is used to update the node's value.
Implements slp::detail::Expression< Scalar >.
|
inlineoverridevirtual |
Runs a function on each argument.
| func | The function to run. |
Reimplemented from slp::detail::Expression< Scalar >.