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

Interface for implementing the logic for a ComputeExpression. More...

#include <computeExpression.hpp>

Inheritance diagram for codi::ComputeOperation< T_Real >:

Public Types

using Real = T_Real
 See ComputeOperation.
 

Static Public Member Functions

template<size_t argNumber, typename Adjoint, typename... Args>
static inlineauto applyAdjoint (Adjoint const &adjoint, Real const &result, Args const &... args)
 
template<size_t argNumber, typename Tangent, typename... Args>
static inlineauto applyTangent (Tangent const &tangent, Real const &result, Args const &... args)
 
static inlinestd::string getMathRep ()
 Get the math symbol of the operation. E.g. + for operators and pow() for functions.
 
template<typename... Args>
static inlineReal primal (Args const &... args)
 

Detailed Description

template<typename T_Real>
struct codi::ComputeOperation< T_Real >

Interface for implementing the logic for a ComputeExpression.

Represents an operation $ w = f(x)$.

See Expression design documentation for details about the expression system in CoDiPack.

Template Parameters
T_RealOriginal primal value of the statement/expression.

Member Function Documentation

◆ applyAdjoint()

template<typename T_Real>
template<size_t argNumber, typename Adjoint, typename... Args>
static inlineauto codi::ComputeOperation< T_Real >::applyAdjoint ( Adjoint const & adjoint,
Real const & result,
Args const &... args )
static

Apply the reverse AD mode with respect to the given argument on the adjoint and return the result. Computes $ \bar x_{argNumber} = \frac{\d f}{\d x_{argNumber}}^T \bar w $

◆ applyTangent()

template<typename T_Real>
template<size_t argNumber, typename Tangent, typename... Args>
static inlineauto codi::ComputeOperation< T_Real >::applyTangent ( Tangent const & tangent,
Real const & result,
Args const &... args )
static

Apply the forward AD mode with respect to the given argument on the tangent and return the result. Computes $ \dot w = \frac{\d f}{\d x_{argNumber}} \dot x_{argNumber} $

◆ primal()

template<typename T_Real>
template<typename... Args>
static inlineReal codi::ComputeOperation< T_Real >::primal ( Args const &... args)
static

Compute the primal value from the arguments. E.g. evaluates $ w = f(x)$

The argument types are the types of the result of a getValue call on the expression.


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