CoDiPack  3.0.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::ExpressionInterface< T_Real, T_Impl > Struct Template Reference

Base class for all CoDiPack expressions. More...

#include <expressionInterface.hpp>

Inheritance diagram for codi::ExpressionInterface< T_Real, T_Impl >:

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.
 
- Public Types inherited from codi::NodeInterface< T_Impl >
using Impl = T_Impl
 See NodeInterface.
 
- Public Types inherited from codi::ExpressionMemberOperations< T_Real, T_Impl, typename >
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.
 
- Public Member Functions inherited from codi::NodeInterface< T_Impl >
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.
 
- Protected Member Functions inherited from codi::ExpressionMemberOperations< T_Real, T_Impl, typename >
inlineImpl const & cast () const
 Cast to implementation.
 

Detailed Description

template<typename T_Real, typename T_Impl>
struct codi::ExpressionInterface< T_Real, T_Impl >

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++.

Template Parameters
T_RealOriginal primal value of the statement/expression.
T_ImplClass implementing this interface.

Member Function Documentation

◆ applyAdjoint()

template<typename T_Real, typename T_Impl>
template<size_t argNumber, typename Adjoint>
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 .

Returns
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> .
Template Parameters
AdjointThe type of the result or a compatible vector type. E.g. Real or Direction<Real>.

◆ applyTangent()

template<typename T_Real, typename T_Impl>
template<size_t argNumber, typename Tangent>
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 .

Returns
The type of the result or a compatible vector type. E.g. Real or Direction<Real>.
Template Parameters
TangentThe 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> .

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