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

Base implementation of AggregatedTypeTraits for aggregated types that can be defined as an array. More...

#include <realTraits.hpp>

Inheritance diagram for codi::RealTraits::ArrayAggregatedTypeTraitsBase< T_Type, T_InnerType, T_Real, T_Elements >:

Public Types

using InnerType = T_InnerType
 See AggregatedTypeTraits.
 
using Real = T_Real
 See AggregatedTypeTraits.
 
using Type = T_Type
 See AggregatedTypeTraits.
 

Public Member Functions

template<size_t element>
inlinestatic Type adjointOfArrayAccess (Type const &w, InnerType const &v_b)
 
template<size_t element>
inlinestatic InnerType adjointOfConstructor (Type const &w, Type const &w_b)
 
template<size_t element>
inlinestatic InnerTypearrayAccess (Type &w)
 
template<size_t element>
inlinestatic InnerType const & arrayAccess (Type const &w)
 
inlinestatic Type arrayConstructor (InnerType const *v)
 

Static Public Attributes

static int constexpr Elements = T_Elements
 See AggregatedTypeTraits.
 

Detailed Description

template<typename T_Type, typename T_InnerType, typename T_Real, int T_Elements>
struct codi::RealTraits::ArrayAggregatedTypeTraitsBase< T_Type, T_InnerType, T_Real, T_Elements >

Base implementation of AggregatedTypeTraits for aggregated types that can be defined as an array.

Member Function Documentation

◆ adjointOfArrayAccess()

template<typename T_Type, typename T_InnerType, typename T_Real, int T_Elements>
template<size_t element>
inlinestatic Type codi::RealTraits::ArrayAggregatedTypeTraitsBase< T_Type, T_InnerType, T_Real, T_Elements >::adjointOfArrayAccess ( Type const & w,
InnerType const & v_b )
inline

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 T_InnerType, typename T_Real, int T_Elements>
template<size_t element>
inlinestatic InnerType codi::RealTraits::ArrayAggregatedTypeTraitsBase< T_Type, T_InnerType, T_Real, T_Elements >::adjointOfConstructor ( Type const & w,
Type const & w_b )
inline

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 T_InnerType, typename T_Real, int T_Elements>
template<size_t element>
inlinestatic InnerType & codi::RealTraits::ArrayAggregatedTypeTraitsBase< T_Type, T_InnerType, T_Real, T_Elements >::arrayAccess ( Type & w)
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 T_InnerType, typename T_Real, int T_Elements>
template<size_t element>
inlinestatic InnerType const & codi::RealTraits::ArrayAggregatedTypeTraitsBase< T_Type, T_InnerType, T_Real, T_Elements >::arrayAccess ( Type const & w)
inline

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

◆ arrayConstructor()

template<typename T_Type, typename T_InnerType, typename T_Real, int T_Elements>
inlinestatic Type codi::RealTraits::ArrayAggregatedTypeTraitsBase< T_Type, T_InnerType, T_Real, T_Elements >::arrayConstructor ( InnerType const * v)
inline

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.


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