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

#include <sleipnir/autodiff/Expression.hpp>

Inheritance diagram for sleipnir::detail::TanExpression:
sleipnir::detail::Expression

Public Member Functions

 TanExpression (ExpressionPtr lhs)
 
double Value (double x, double) const override
 
ExpressionType Type () const override
 
double GradientValueLhs (double x, double, double parentAdjoint) const override
 
ExpressionPtr GradientLhs (const ExpressionPtr &x, const ExpressionPtr &, const ExpressionPtr &parentAdjoint) 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 GradientValueRhs (double lhs, double rhs, double 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

◆ TanExpression()

sleipnir::detail::TanExpression::TanExpression ( ExpressionPtr  lhs)
inlineexplicit

Constructs an unary expression (an operator with one argument).

Parameters
lhsUnary operator's operand.

Member Function Documentation

◆ GradientLhs()

ExpressionPtr sleipnir::detail::TanExpression::GradientLhs ( const ExpressionPtr lhs,
const ExpressionPtr rhs,
const ExpressionPtr parentAdjoint 
) const
inlineoverridevirtual

Returns Variable adjoint of the left child expression.

Parameters
lhsLeft argument to binary operator.
rhsRight argument to binary operator.
parentAdjointAdjoint of parent expression.

Reimplemented from sleipnir::detail::Expression.

◆ GradientValueLhs()

double sleipnir::detail::TanExpression::GradientValueLhs ( double  lhs,
double  rhs,
double  parentAdjoint 
) const
inlineoverridevirtual

Returns double adjoint of the left child expression.

Parameters
lhsLeft argument to binary operator.
rhsRight argument to binary operator.
parentAdjointAdjoint of parent expression.

Reimplemented from sleipnir::detail::Expression.

◆ Type()

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

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

Implements sleipnir::detail::Expression.

◆ Value()

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