Sleipnir C++ API
Loading...
Searching...
No Matches
slp::detail::DecisionVariableExpression Struct Referencefinal

#include <sleipnir/autodiff/expression.hpp>

Inheritance diagram for slp::detail::DecisionVariableExpression:
slp::detail::Expression

Public Member Functions

constexpr DecisionVariableExpression ()=default
 
constexpr DecisionVariableExpression (double value)
 
double value (double, double) const override
 
ExpressionType type () const override
 
- Public Member Functions inherited from slp::detail::Expression
constexpr Expression ()=default
 
constexpr Expression (double value)
 
constexpr Expression (ExpressionPtr lhs)
 
constexpr Expression (ExpressionPtr lhs, ExpressionPtr rhs)
 
constexpr bool is_constant (double constant) const
 
virtual double grad_l (double lhs, double rhs, double parent_adjoint) const
 
virtual double grad_r (double lhs, double rhs, double parent_adjoint) const
 
virtual ExpressionPtr grad_expr_l (const ExpressionPtr &lhs, const ExpressionPtr &rhs, const ExpressionPtr &parent_adjoint) const
 
virtual ExpressionPtr grad_expr_r (const ExpressionPtr &lhs, const ExpressionPtr &rhs, const ExpressionPtr &parent_adjoint) const
 

Additional Inherited Members

- Public Attributes inherited from slp::detail::Expression
double val = 0.0
 The value of the expression node.
 
double adjoint = 0.0
 The adjoint of the expression node used during autodiff.
 
uint32_t incoming_edges = 0
 Counts incoming edges for this node.
 
int32_t col = -1
 This expression's column in a Jacobian, or -1 otherwise.
 
ExpressionPtr adjoint_expr
 
uint32_t ref_count = 0
 Reference count for intrusive shared pointer.
 
std::array< ExpressionPtr, 2 > args {nullptr, nullptr}
 Expression arguments.
 

Detailed Description

Derived expression type for decision variable.

Constructor & Destructor Documentation

◆ DecisionVariableExpression() [1/2]

constexpr slp::detail::DecisionVariableExpression::DecisionVariableExpression ( )
constexprdefault

Constructs a decision variable expression with a value of zero.

◆ DecisionVariableExpression() [2/2]

constexpr slp::detail::DecisionVariableExpression::DecisionVariableExpression ( double  value)
inlineexplicitconstexpr

Constructs a nullary expression (an operator with no arguments).

Parameters
valueThe expression value.

Member Function Documentation

◆ type()

ExpressionType slp::detail::DecisionVariableExpression::type ( ) const
inlineoverridevirtual

Returns the type of this expression (constant, linear, quadratic, or nonlinear).

Returns
The type of this expression.

Implements slp::detail::Expression.

◆ value()

double slp::detail::DecisionVariableExpression::value ( double  lhs,
double  rhs 
) const
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.

Parameters
lhsLeft argument to binary operator.
rhsRight argument to binary operator.
Returns
The node's value.

Implements slp::detail::Expression.


The documentation for this struct was generated from the following file: