Base class for all CoDiPack lvalue expression. More...
#include <lhsExpressionInterface.hpp>
Public Types | |
using | Base = ExpressionInterface<T_Real, T_Impl> |
Base class abbreviation. | |
using | Gradient = T_Gradient |
See LhsExpressionInterface. | |
using | Identifier = typename Tape::Identifier |
See GradientAccessTapeInterface. | |
using | Impl = T_Impl |
See LhsExpressionInterface. | |
using | PassiveReal = RealTraits::PassiveReal<Real> |
Basic computation type. | |
using | Real = T_Real |
See LhsExpressionInterface. | |
using | Tape = T_Tape |
See LhsExpressionInterface. | |
Public Types inherited from codi::ExpressionInterface< T_Real, T_Impl > | |
using | ActiveResult = void |
Type into which the expression can be converted. Usually also the type from which it is constructed. | |
using | Impl = T_Impl |
See ExpressionInterface. | |
using | Real = T_Real |
See ExpressionInterface. | |
using | StoreAs = ExpressionInterface |
Defines how this expression is stored in an expression tree. | |
Public Types inherited from codi::NodeInterface< T_Impl > | |
using | Impl = T_Impl |
See NodeInterface. | |
Public Member Functions | |
LhsExpressionInterface ()=default | |
Constructor. | |
LhsExpressionInterface (LhsExpressionInterface const &other)=default | |
Constructor. | |
General implementation | |
Impl & | cast () |
Cast to the implementation. | |
Gradient & | gradient () |
Get the gradient of this lvalue from the tape. | |
Gradient const & | gradient () const |
Get the gradient of this lvalue from the tape. | |
Gradient | getGradient () const |
Get the gradient of this lvalue from the tape. | |
void | setGradient (Gradient const &g) |
Set the gradient of this lvalue in the tape. | |
Real const & | getValue () const |
Get the primal value of this lvalue. | |
void | setValue (Real const &v) |
Set the primal value of this lvalue. | |
Impl & | operator= (Real const &rhs) |
Assignment operator for passive values. Calls store on the InternalStatementRecordingTapeInterface. | |
template<typename U = Real, typename = RealTraits::EnableIfNotPassiveReal<U>> | |
Impl & | operator= (PassiveReal const &rhs) |
Assignment operator for passive values. Calls store on the InternalStatementRecordingTapeInterface. | |
template<typename Rhs > | |
Impl & | operator= (ExpressionInterface< Real, Rhs > const &rhs) |
Assignment operator for expressions. Calls store on the InternalStatementRecordingTapeInterface. | |
template<typename Rhs , typename U = Real, typename = RealTraits::EnableIfNotPassiveReal<U>> | |
Impl & | operator= (ExpressionInterface< typename U::Real, Rhs > const &rhs) |
Assignment operator for expressions. Calls store on the InternalStatementRecordingTapeInterface. | |
Impl & | operator= (LhsExpressionInterface const &rhs) |
Assignment operator for lhs expressions. Calls store on the InternalStatementRecordingTapeInterface. | |
template<typename Rhs > | |
Impl & | operator= (LhsExpressionInterface< Real, Gradient, Tape, Rhs > const &rhs) |
Assignment operator for lhs expressions. Calls store on the InternalStatementRecordingTapeInterface. | |
Impl const & | cast () const |
Cast to the implementation. | |
Public Member Functions inherited from codi::ExpressionInterface< T_Real, T_Impl > | |
Impl const & | cast () const |
Cast to the implementation. | |
ExpressionInterface ()=default | |
Constructor. | |
ExpressionInterface (ExpressionInterface const &)=default | |
Constructor. | |
Real const | getValue () const |
Compute the primal value that is usually evaluated by the statement/expression. | |
template<size_t argNumber> | |
Real | getJacobian () const |
Public Member Functions inherited from codi::NodeInterface< T_Impl > | |
Impl const & | cast () const |
Cast to the implementation. | |
template<typename Logic , typename... Args> | |
void | forEachLink (TraversalLogic< Logic > &logic, Args &&... args) const |
Implementation of NodeInterface | |
static bool constexpr | EndPoint = true |
If this expression is handled as a leaf in the tree. | |
template<typename Logic , typename... Args> | |
void | forEachLink (TraversalLogic< Logic > &logic, Args &&... args) const |
template<typename Logic , typename... Args> | |
static Logic::ResultType constexpr | forEachLinkConstExpr (Args &&...) |
void | init (Real const &newValue, EventHints::Statement statementType) |
void | destroy () |
Interface definition | |
Real const & | value () const |
Get a constant reference to the lvalue represented by the expression. | |
Real & | value () |
Get a reference to the lvalue represented by the expression. | |
Identifier const & | getIdentifier () const |
Identifier & | getIdentifier () |
static Tape & | getTape () |
Get a reference to the tape which manages this expression. | |
Additional Inherited Members | |
Static Public Member Functions inherited from codi::NodeInterface< T_Impl > | |
template<typename Logic , typename... Args> | |
static Logic::ResultType constexpr | forEachLinkConstExpr (Args &&... args) |
Static Public Attributes inherited from codi::NodeInterface< T_Impl > | |
static bool constexpr | EndPoint = false |
If this expression is handled as a leaf in the tree. | |
Base class for all CoDiPack lvalue expression.
See Expression design documentation for details about the expression system in CoDiPack.
This interface resembles an lvalue in C++.
T_Real | Original primal value of the statement/expression. |
T_Gradient | Gradient values computed by the tape implementation. |
T_Tape | The tape that manages the lvalues of the expression. Minimal interface: InternalStatementRecordingTapeInterface, GradientAccessTapeInterface |
T_Impl | Class implementing this interface. |
|
inlineprotected |
Helper function to deconstruct the primal value and the identifier by the tape.
To be called in the destructor of the implementing class.
|
inline |
Call the link method of the given logic for all arguments (links) of this node (not to be confused with args). Pass args to each call.
|
inlinestaticconstexpr |
Call the link method of the given logic for all arguments (links) of this node (not to be confused with args). Pass args to each call.
Identifier & codi::LhsExpressionInterface< T_Real, T_Gradient, T_Tape, T_Impl >::getIdentifier | ( | ) |
Get a reference to the identifier of the tape for this expression. See also Direct data access (Identifier management)
Identifier const & codi::LhsExpressionInterface< T_Real, T_Gradient, T_Tape, T_Impl >::getIdentifier | ( | ) | const |
Get a constant reference to the identifier of the tape for this expression. See also Direct data access (Identifier management)
|
inlineprotected |
Helper function to initialize the primal value and the identifier by the tape.
To be called in constructors of the implementing class.
|
staticconstexpr |
If this expression is handled as a leaf in the tree.