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

#include <sleipnir/autodiff/expression.hpp>

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

Public Member Functions

constexpr ConstExpression (Scalar value)
 
Scalar value (Scalar, Scalar) const override
 
ExpressionType type () const override
 
- Public Member Functions inherited from slp::detail::Expression< Scalar >
constexpr Expression ()=default
 
constexpr Expression (Scalar value)
 
constexpr Expression (ExpressionPtr< Scalar > lhs)
 
constexpr Expression (ExpressionPtr< Scalar > lhs, ExpressionPtr< Scalar > rhs)
 
constexpr bool is_constant (Scalar constant) const
 
virtual Scalar grad_l (Scalar lhs, Scalar rhs, Scalar parent_adjoint) const
 
virtual Scalar grad_r (Scalar lhs, Scalar rhs, Scalar parent_adjoint) const
 
virtual ExpressionPtr< Scalargrad_expr_l (const ExpressionPtr< Scalar > &lhs, const ExpressionPtr< Scalar > &rhs, const ExpressionPtr< Scalar > &parent_adjoint) const
 
virtual ExpressionPtr< Scalargrad_expr_r (const ExpressionPtr< Scalar > &lhs, const ExpressionPtr< Scalar > &rhs, const ExpressionPtr< Scalar > &parent_adjoint) const
 

Additional Inherited Members

- Public Types inherited from slp::detail::Expression< Scalar >
using Scalar = Scalar
 
- 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< Scalaradjoint_expr
 
uint32_t ref_count
 Reference count for intrusive shared pointer.
 
std::array< ExpressionPtr< Scalar >, 2 > args
 Expression arguments.
 

Detailed Description

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

Derived expression type for constant.

Template Parameters
ScalarScalar type.

Constructor & Destructor Documentation

◆ ConstExpression()

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

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

Parameters
valueThe expression value.

Member Function Documentation

◆ type()

template<typename Scalar >
ExpressionType slp::detail::ConstExpression< 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::ConstExpression< Scalar >::value ( Scalar  lhs,
Scalar  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< Scalar >.


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