Base class for all CoDiPack expressions. More...
#include <expressionInterface.hpp>
Public Types | |
using | ADLogic = char |
AD logic that governs the expression. Needs to be the same for all inputs of the expression. | |
using | Impl = T_Impl |
See ExpressionInterface. | |
using | Real = T_Real |
See ExpressionInterface. | |
![]() | |
using | Impl = T_Impl |
See NodeInterface. | |
![]() | |
using | Impl = T_Impl |
See ExpressionMemberOperations. | |
using | Real = T_Real |
See ExpressionMemberOperations. | |
Public Member Functions | |
inlineImpl const & | cast () const |
Cast to the implementation. | |
ExpressionInterface ()=default | |
Constructor. | |
ExpressionInterface (ExpressionInterface const &)=default | |
Constructor. | |
![]() | |
inlineImpl const & | cast () const |
Cast to the implementation. | |
template<size_t argNumber> | |
char const & | getLink () const |
an expression. | |
Interface definition | |
using | StoreAs = ExpressionInterface |
Defines how this expression is stored in an expression tree. | |
inlineReal const | getValue () const |
Compute the primal value that is usually evaluated by the statement/expression. | |
template<size_t argNumber, typename Tangent> | |
inlineauto | applyTangent (Tangent const &tangent) const |
template<size_t argNumber, typename Adjoint> | |
inlineauto | applyAdjoint (Adjoint const &adjoint) const |
Additional Inherited Members | |
static size_t constexpr | LinkCount = false |
handle the expression as a leaf node. | |
![]() | |
inlineImpl const & | cast () const |
Cast to implementation. | |
Base class for all CoDiPack expressions.
See Expression design documentation for details about the expression system in CoDiPack.
This interface resembles a rvalue in C++.
T_Real | Original primal value of the statement/expression. |
T_Impl | Class implementing this interface. |
inlineauto codi::ExpressionInterface< T_Real, T_Impl >::applyAdjoint | ( | Adjoint const & | adjoint | ) | const |
Apply the AD reverse mode on the expression with respect to the given parameter.
This is just the local reverse mode application and not the one for the whole expression tree.
Does not need to be implemented for expressions with NodeInterface::LinkCount
= 0 .
Real
f(complex<Real>, Real) the
type with argNumber=0
is
complex<Real>
or
Direction<complex<Real>>
, with argNumber=1
it
is Real
or
Direction<Real>
.Adjoint | The type of the result or a compatible vector type. E.g. Real or Direction<Real>. |
inlineauto codi::ExpressionInterface< T_Real, T_Impl >::applyTangent | ( | Tangent const & | tangent | ) | const |
Apply the AD forward mode on the expression with respect to the given parameter.
This is just the local forward mode application and not the one for the whole expression tree.
Does not need to be implemented for expressions with NodeInterface::LinkCount
= 0 .
Tangent | The type is the Real type of the selected argument or a compatible vector type. E.g. for Real f(complex<Real>, Real) the type with argNumber=0 is complex<Real> or Direction<complex<Real>> , with argNumber=1 it is Real or Direction<Real> . |