42#include "../../traits/adjointVectorTraits.hpp"
60 template<
typename T_Identifier,
typename T_Gradient>
68 mutable std::map<Identifier, Gradient>
adjoints;
81#ifndef DOXYGEN_DISABLE
83 namespace AdjointVectorTraits {
84 template<
typename T_Identifier,
typename T_Gradient>
85 struct GradientImplementation<MappedAdjoints<T_Identifier, T_Gradient>> {
87 using Gradient = T_Gradient;
104 template<
typename T_Identifier,
typename T_Gradient>
127#ifndef DOXYGEN_DISABLE
129 namespace AdjointVectorTraits {
130 template<
typename T_Identifier,
typename T_Gradient>
131 struct GradientImplementation<AdjointVectorWithOffset<T_Identifier, T_Gradient>> {
133 using Gradient = T_Gradient;
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:469
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:96
CoDiPack - Code Differentiation Package.
Definition codi.hpp:94
Identifier const offset
Offset that is subtracted when addressing into the adjoints memory.
Definition customAdjoints.hpp:111
AdjointVectorWithOffset(Gradient *adjoints, Identifier const &offset)
Constructor.
Definition customAdjoints.hpp:114
T_Gradient Gradient
See AdjointVectorWithOffset.
Definition customAdjoints.hpp:108
Gradient * adjoints
Points to user-provided adjoints memory.
Definition customAdjoints.hpp:110
inlineGradient & operator[](Identifier const &identifier)
Access operator in non-constant call contexts.
Definition customAdjoints.hpp:117
inlineGradient const & operator[](Identifier const &identifier) const
Access operator in constant call contexts.
Definition customAdjoints.hpp:122
T_Identifier Identifier
See AdjointVectorWithOffset.
Definition customAdjoints.hpp:107
Implementation of adjoints via a map.
Definition customAdjoints.hpp:61
Gradient const & operator[](Identifier const &i) const
Access operator in constant call contexts.
Definition customAdjoints.hpp:71
std::map< Identifier, Gradient > adjoints
Definition customAdjoints.hpp:68
T_Gradient Gradient
See MappedAdjoints.
Definition customAdjoints.hpp:64
Gradient & operator[](Identifier const &i)
Access operator in non-constant call contexts.
Definition customAdjoints.hpp:76
T_Identifier Identifier
See MappedAdjoints.
Definition customAdjoints.hpp:63