Sleipnir C++ API
Loading...
Searching...
No Matches
slp::detail::DecisionVariableExpression< Scalar > Struct Template Referencefinal

#include </home/runner/work/Sleipnir/Sleipnir/include/sleipnir/autodiff/expression.hpp>

Inheritance diagram for slp::detail::DecisionVariableExpression< Scalar >:
slp::detail::Expression< Scalar >

Public Member Functions

constexpr DecisionVariableExpression ()
 Constructs a decision variable expression with a value of zero.
 
constexpr DecisionVariableExpression (Scalar value)
 
Scalar value () const override
 
ExpressionType type () const override
 
std::string_view name () const override
 
- 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
 
virtual void visit_args (function_ref< void(Expression< Scalar > *arg)> func) const
 
virtual void accumulate_adjoints () const
 Accumulates the child adjoints as Scalars.
 
virtual void accumulate_adjoints_expr () const
 Accumulates the child adjoints as Expressions.
 

Additional Inherited Members

- Public Types inherited from slp::detail::Expression< Scalar >
using Scalar = Scalar
 Scalar type alias.
 
- 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.
 

Detailed Description

template<typename Scalar>
struct slp::detail::DecisionVariableExpression< Scalar >

Derived expression type for decision variable.

Template Parameters
ScalarScalar type.

Constructor & Destructor Documentation

◆ DecisionVariableExpression()

template<typename Scalar >
constexpr slp::detail::DecisionVariableExpression< Scalar >::DecisionVariableExpression ( Scalar  value)
inlineexplicitconstexpr

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

Parameters
valueThe expression value.

Member Function Documentation

◆ name()

template<typename Scalar >
std::string_view slp::detail::DecisionVariableExpression< Scalar >::name ( ) const
inlineoverridevirtual

Returns the name of this expression.

Returns
The name of this expression.

Implements slp::detail::Expression< Scalar >.

◆ type()

template<typename Scalar >
ExpressionType slp::detail::DecisionVariableExpression< Scalar >::type ( ) const
inlineoverridevirtual

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

Returns
The type of this expression.

Implements slp::detail::Expression< Scalar >.

◆ value()

template<typename Scalar >
Scalar slp::detail::DecisionVariableExpression< Scalar >::value ( ) 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.

Returns
The node's value.

Implements slp::detail::Expression< Scalar >.


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