Sleipnir C++ API
Loading...
Searching...
No Matches
sleipnir::detail::ConstExpression Struct Referencefinal

#include <sleipnir/autodiff/Expression.hpp>

Inheritance diagram for sleipnir::detail::ConstExpression:
sleipnir::detail::Expression

Public Member Functions

constexpr ConstExpression ()=default
 
constexpr ConstExpression (double value)
 
double Value (double, double) const override
 
ExpressionType Type () const override
 
- Public Member Functions inherited from sleipnir::detail::Expression
constexpr Expression ()=default
 
constexpr Expression (double value)
 
constexpr Expression (ExpressionPtr lhs)
 
constexpr Expression (ExpressionPtr lhs, ExpressionPtr rhs)
 
virtual ~Expression ()=default
 
constexpr bool IsConstant (double constant) const
 
virtual double GradientValueLhs (double lhs, double rhs, double parentAdjoint) const
 
virtual double GradientValueRhs (double lhs, double rhs, double parentAdjoint) const
 
virtual ExpressionPtr GradientLhs (const ExpressionPtr &lhs, const ExpressionPtr &rhs, const ExpressionPtr &parentAdjoint) const
 
virtual ExpressionPtr GradientRhs (const ExpressionPtr &lhs, const ExpressionPtr &rhs, const ExpressionPtr &parentAdjoint) const
 

Additional Inherited Members

- Public Attributes inherited from sleipnir::detail::Expression
double value = 0.0
 The value of the expression node.
 
double adjoint = 0.0
 The adjoint of the expression node used during autodiff.
 
uint32_t duplications = 0
 
int32_t row = -1
 
ExpressionPtr adjointExpr
 
uint32_t refCount = 0
 Reference count for intrusive shared pointer.
 
std::array< ExpressionPtr, 2 > args {nullptr, nullptr}
 Expression arguments.
 

Constructor & Destructor Documentation

◆ ConstExpression() [1/2]

constexpr sleipnir::detail::ConstExpression::ConstExpression ( )
constexprdefault

Constructs a constant expression with a value of zero.

◆ ConstExpression() [2/2]

constexpr sleipnir::detail::ConstExpression::ConstExpression ( double  value)
inlineexplicitconstexpr

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

Parameters
valueThe expression value.

Member Function Documentation

◆ Type()

ExpressionType sleipnir::detail::ConstExpression::Type ( ) const
inlineoverridevirtual

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

Implements sleipnir::detail::Expression.

◆ Value()

double sleipnir::detail::ConstExpression::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.

Implements sleipnir::detail::Expression.


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