CoDiPack  3.0.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::RealTraits::AggregatedTypeTraits< T_Type, typename > Struct Template Reference

Methods that access inner values of aggregated types that contain CoDiPack active types. More...

#include <realTraits.hpp>

Inheritance diagram for codi::RealTraits::AggregatedTypeTraits< T_Type, typename >:

Public Types

using InnerType = int
 Inner type of the aggregated type.
 
using Real = int
 Real version of the aggregated type without the active CoDiPack types.
 
using Type = T_Type
 See AggregatedTypeTraits.
 

Public Member Functions

template<size_t element>
inlinestatic InnerTypearrayAccess (Type &v)
 

Static Public Member Functions

template<size_t element>
static Type adjointOfArrayAccess (Type const &w, InnerType const &v_b)
 
template<size_t element>
static InnerType adjointOfConstructor (Type const &w, Type const &w_b)
 
template<size_t element>
static InnerType arrayAccess (Type const &w)
 
static Type arrayConstructor (InnerType const *v)
 
static inlinestd::string getMathRep ()
 Get the math symbol of the operation. E.g. + for operators and pow() for functions.
 

Static Public Attributes

static int constexpr Elements = 0
 Number of elements of the aggregated type.
 

Detailed Description

template<typename T_Type, typename = void>
struct codi::RealTraits::AggregatedTypeTraits< T_Type, typename >

Methods that access inner values of aggregated types that contain CoDiPack active types.

An aggregated type is for example std::complex<codi::RealReverse>, which contains two CoDiPack values. The methods in this class access each of these values. The real part is the element 0 and the imaginary part is the element 1.

Template Parameters
T_TypeAny type that contains a CoDiPack type. (E.g. codi::RealReverse, std::complex<codi::RealReverse>)

Member Function Documentation

◆ adjointOfArrayAccess()

template<typename T_Type, typename = void>
template<size_t element>
static Type codi::RealTraits::AggregatedTypeTraits< T_Type, typename >::adjointOfArrayAccess ( Type const & w,
InnerType const & v_b )
inlinestatic

Implementation of the adjoint array access. See arrayAccess for the equation definition. The adjoint is defined as $ \bar w += dw[element]/w^T * \bar v $.

◆ adjointOfConstructor()

template<typename T_Type, typename = void>
template<size_t element>
static InnerType codi::RealTraits::AggregatedTypeTraits< T_Type, typename >::adjointOfConstructor ( Type const & w,
Type const & w_b )
inlinestatic

Adjoint implementation of element-wise construction, that is, T is our aggregated type and the construction is defined as w = T(v_0, v_1, ..., v_{N-1}) where N is the number of elements. Then this function needs to implement the adjoint formulation of this construction, which is defined as $ \bar v_{element} = dT/dv_{element}^T * \bar w $ .

◆ arrayAccess() [1/2]

template<typename T_Type, typename = void>
template<size_t element>
inlinestatic InnerType & codi::RealTraits::AggregatedTypeTraits< T_Type, typename >::arrayAccess ( Type & v)
inline

Implementation of the array access, which is defined as $ v = w[element] $ where $ w $ is an aggregated type.

◆ arrayAccess() [2/2]

template<typename T_Type, typename = void>
template<size_t element>
static InnerType codi::RealTraits::AggregatedTypeTraits< T_Type, typename >::arrayAccess ( Type const & w)
inlinestatic

Implementation of the array access, which is defined as $ v = w[element] $ where $ w $ is an aggregated type.

◆ arrayConstructor()

template<typename T_Type, typename = void>
static Type codi::RealTraits::AggregatedTypeTraits< T_Type, typename >::arrayConstructor ( InnerType const * v)
inlinestatic

Array construction of the aggregated type. It is defined as $ w = T(v_0, v_1, ..., v_{N-1}) $ where $ N $ is the number of elements.

◆ getMathRep()

template<typename T_Type, typename = void>
static inlinestd::string codi::RealTraits::AggregatedTypeTraits< T_Type, typename >::getMathRep ( )
inlinestatic

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


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