![]() |
WPILibC++ 2027.0.0-alpha-4
|
Derived expression type for constant. More...
Public Member Functions | |
| constexpr | ConstantExpression (Scalar value) |
| Constructs a nullary expression (an operator with no arguments). | |
| Scalar | value (Scalar, Scalar) const override |
| Either nullary operator with no arguments, unary operator with one argument, or binary operator with two arguments. | |
| ExpressionType | type () const override |
| Returns the type of this expression (constant, linear, quadratic, or nonlinear). | |
| std::string_view | name () const override |
| Returns the name of this expression. | |
| Public Member Functions inherited from slp::detail::Expression< Scalar > | |
| constexpr | Expression ()=default |
| Constructs a constant expression with a value of zero. | |
| virtual | ~Expression ()=default |
| constexpr bool | is_constant (Scalar constant) const |
| Returns true if the expression is the given constant. | |
| virtual Scalar | grad_l (Scalar lhs, Scalar rhs, Scalar parent_adjoint) const |
| Returns ∂/∂l as a Scalar. | |
| virtual Scalar | grad_r (Scalar lhs, Scalar rhs, Scalar parent_adjoint) const |
| Returns ∂/∂r as a Scalar. | |
| virtual ExpressionPtr< Scalar > | grad_expr_l (const ExpressionPtr< Scalar > &lhs, const ExpressionPtr< Scalar > &rhs, const ExpressionPtr< Scalar > &parent_adjoint) const |
| Returns ∂/∂l as an Expression. | |
| virtual ExpressionPtr< Scalar > | grad_expr_r (const ExpressionPtr< Scalar > &lhs, const ExpressionPtr< Scalar > &rhs, const ExpressionPtr< Scalar > &parent_adjoint) const |
| Returns ∂/∂r as an Expression. | |
Additional Inherited Members | |
| Public Types inherited from slp::detail::Expression< Scalar > | |
| using | Scalar |
| Scalar type alias. | |
| Public Attributes inherited from slp::detail::Expression< Scalar > | |
| Scalar | val |
| The value of the expression node. | |
| Scalar | adjoint |
| The adjoint of the expression node, used during autodiff. | |
| uint32_t | incoming_edges |
| Counts incoming edges for this node. | |
| int32_t | col |
| This expression's column in a Jacobian, or -1 otherwise. | |
| ExpressionPtr< Scalar > | adjoint_expr |
| The adjoint of the expression node, used during gradient expression tree generation. | |
| uint32_t | ref_count |
| Reference count for intrusive shared pointer. | |
| std::array< ExpressionPtr< Scalar >, 2 > | args |
| Expression arguments. | |
Derived expression type for constant.
|
inlineexplicitconstexpr |
Constructs a nullary expression (an operator with no arguments).
| value | The expression value. |
|
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.
| lhs | Left argument to binary operator. |
| rhs | Right argument to binary operator. |
Implements slp::detail::Expression< Scalar >.