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

Returns a proxy object for the gradient that implements the operation in the multiplication of the proxy. More...

#include <realToComplexCast.hpp>

Inheritance diagram for codi::OperationRealToComplexCast< T_ComplexReal >:

Public Types

using ComplexReal = T_ComplexReal
 See OperationRealToComplexCast.
 
using Jacobian = ReduceToReal
 See OperationRealToComplexCast.
 
using Real = typename ComplexReal::value_type
 Inner type of the complex value.
 
- Public Types inherited from codi::UnaryOperation< T_ComplexReal, OperationRealToComplexCast< T_ComplexReal > >
using Impl
 See UnaryOperation.
 
using Real
 See UnaryOperation.
 
- Public Types inherited from codi::ComputeOperation< T_ComplexReal >
using Real
 See ComputeOperation.
 

Static Public Member Functions

template<typename Adjoint, typename Arg>
static inlineReal applyAdjointArg (Adjoint const &adjoint, ComplexReal const &result, Arg const &arg)
 
template<typename Tangent, typename Arg>
static inlineComplexReal applyTangentArg (Tangent const &tangent, ComplexReal const &result, Arg const &arg)
 
static inlinestd::string getMathRep ()
 Get the math symbol of the operation. E.g. + for operators and pow() for functions.
 
template<typename Arg>
static inlineComplexReal primal (Arg const &arg)
 
- Static Public Member Functions inherited from codi::UnaryOperation< T_ComplexReal, OperationRealToComplexCast< T_ComplexReal > >
static inlineauto applyAdjoint (Adjoint const &adjoint, Real const &result, Arg const &arg)
 
static inlineauto applyAdjointArg (Adjoint const &adjoint, Real const &result, Arg const &arg)
 
static inlineauto applyTangent (Tangent const &tangent, Real const &result, Arg const &arg)
 
static inlineauto applyTangentArg (Tangent const &tangent, Real const &result, Arg const &arg)
 
static inlineReal primal (Arg const &arg)
 
- Static Public Member Functions inherited from codi::ComputeOperation< T_ComplexReal >
static inlineauto applyAdjoint (Adjoint const &adjoint, Real const &result, Args const &... 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.
 
static inlineReal primal (Args const &... args)
 

Detailed Description

template<typename T_ComplexReal>
struct codi::OperationRealToComplexCast< T_ComplexReal >

Returns a proxy object for the gradient that implements the operation in the multiplication of the proxy.

In CoDiPack the Jacobian is applied to other Jacobians via multiplication. Since the adjoint of this operation can not be described by a complex or floating point value, that would apply the same logic, a place holder is required. With this placeholder the multiplication operation is specialized and the custom logic is evaluated.

Template Parameters
T_RealOriginal primal value of the statement/expression. (E.g. for double for complex<double>.)

Member Function Documentation

◆ applyAdjointArg()

template<typename T_ComplexReal>
template<typename Adjoint, typename Arg>
static inlineReal codi::OperationRealToComplexCast< T_ComplexReal >::applyAdjointArg ( Adjoint const & adjoint,
ComplexReal const & result,
Arg const & arg )
inlinestatic

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

◆ applyTangentArg()

template<typename T_ComplexReal>
template<typename Tangent, typename Arg>
static inlineComplexReal codi::OperationRealToComplexCast< T_ComplexReal >::applyTangentArg ( Tangent const & tangent,
ComplexReal const & result,
Arg const & arg )
inlinestatic

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

◆ getMathRep()

template<typename T_ComplexReal>
static inlinestd::string codi::OperationRealToComplexCast< T_ComplexReal >::getMathRep ( )
inlinestatic

Get the math symbol of the operation. E.g. + for operators and pow() for functions.

◆ primal()

template<typename T_ComplexReal>
template<typename Arg>
static inlineComplexReal codi::OperationRealToComplexCast< T_ComplexReal >::primal ( Arg const & arg)
inlinestatic

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: