42#include "../../tools/data/direction.hpp"
43#include "../../traits/adjointVectorTraits.hpp"
44#include "../../traits/realTraits.hpp"
45#include "vectorAccessInterface.hpp"
60 template<
typename T_Real,
typename T_Identifier,
typename T_Adjo
intVector>
74 std::array<Gradient, Config::MaxArgumentSize> lhs;
78 std::array<Real, GradientTraits::dim<Gradient>()> buffer;
170 return buffer.data();
#define codiAssert(x)
See codi::Config::EnableAssert.
Definition config.h:441
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:96
typename GradientImplementation< AdjointVector >::Gradient Gradient
Deduce the entry type from an adjoint vector type, usually identical to the gradient type of a tape.
Definition adjointVectorTraits.hpp:92
typename TraitsImplementation< Gradient >::Real Real
The base value used in the gradient entries.
Definition gradientTraits.hpp:92
inlinesize_t constexpr dim()
Number of dimensions this gradient value has.
Definition gradientTraits.hpp:96
inlinetypename TraitsImplementation< Gradient >::Real & at(Gradient &gradient, size_t dim)
Get the entry at the given index.
Definition gradientTraits.hpp:102
inlinebool isTotalZero(Type const &v)
Function for checking if the value of the type is completely zero.
Definition realTraits.hpp:145
CoDiPack - Code Differentiation Package.
Definition codi.hpp:94
inlinevoid CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:54
Real const * getAdjointVec(Identifier const &index)
Get the adjoint entry.
Definition adjointVectorAccess.hpp:168
void setLhsTangent(Identifier const &index)
Definition adjointVectorAccess.hpp:121
void updateAdjointVec(Identifier const &index, Real const *const vec)
Update the adjoint entry.
Definition adjointVectorAccess.hpp:179
AdjointVectorAccess(AdjointVector adjointVector)
Constructor. See interface documentation for details about the adjoint vector.
Definition adjointVectorAccess.hpp:83
void setLhsAdjoint(Identifier const &index)
Definition adjointVectorAccess.hpp:107
void resetAdjoint(Identifier const &index, size_t dim)
Set the adjoint component to zero.
Definition adjointVectorAccess.hpp:144
void setPrimal(Identifier const &index, Real const &primal)
Set the primal value.
Definition adjointVectorAccess.hpp:190
AdjointVector adjointVector
Definition adjointVectorAccess.hpp:70
Real Real
Definition adjointVectorAccess.hpp:63
void getAdjointVec(Identifier const &index, Real *const vec)
Get the adjoint entry.
Definition adjointVectorAccess.hpp:161
VectorAccessInterface< Real, Identifier > * clone() const
Definition adjointVectorAccess.hpp:99
bool hasPrimals()
Set the primal value.
Definition adjointVectorAccess.hpp:204
void updateTangentWithLhs(Identifier const &index, Real const &jacobian)
Definition adjointVectorAccess.hpp:127
void resetAdjointVec(Identifier const &index)
Set the adjoint entry to zero.
Definition adjointVectorAccess.hpp:149
void setActiveVariableForIndirectAccess(size_t pos)
Definition adjointVectorAccess.hpp:135
Identifier Identifier
Definition adjointVectorAccess.hpp:64
void updateAdjoint(Identifier const &index, size_t dim, Real const &adjoint)
Update the adjoint component.
Definition adjointVectorAccess.hpp:174
Real getAdjoint(Identifier const &index, size_t dim)
Get the adjoint component.
Definition adjointVectorAccess.hpp:154
bool isLhsZero()
True if the adjoint set with setLhsAdjoint is zero.
Definition adjointVectorAccess.hpp:94
void updateAdjointWithLhs(Identifier const &index, Real const &jacobian)
Definition adjointVectorAccess.hpp:113
size_t getVectorSize() const
Vector size in the current tape evaluation.
Definition adjointVectorAccess.hpp:89
AdjointVectorTraits::Gradient< AdjointVector > Gradient
Definition adjointVectorAccess.hpp:65
AdjointVector AdjointVector
Definition adjointVectorAccess.hpp:66
Real getPrimal(Identifier const &index)
Get the primal value.
Definition adjointVectorAccess.hpp:196
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:94