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>
76 std::array<Real, GradientTraits::dim<Gradient>()> buffer;
88 return GradientTraits::dim<Gradient>();
159 return buffer.data();
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
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
TraitsImplementation< Gradient >::Real & at(Gradient &gradient, size_t dim)
Get the entry at the given index.
Definition gradientTraits.hpp:102
bool isTotalZero(Type const &v)
Function for checking if the value of the type is completely zero.
Definition realTraits.hpp:139
CoDiPack - Code Differentiation Package.
Definition codi.hpp:91
void CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:46
Implementation of VectorAccessInterface for adjoint vectors.
Definition adjointVectorAccess.hpp:61
Real const * getAdjointVec(Identifier const &index)
Get the adjoint entry.
Definition adjointVectorAccess.hpp:157
void setLhsTangent(Identifier const &index)
Definition adjointVectorAccess.hpp:119
void updateAdjointVec(Identifier const &index, Real const *const vec)
Update the adjoint entry.
Definition adjointVectorAccess.hpp:168
AdjointVectorAccess(AdjointVector adjointVector)
Constructor. See interface documentation for details about the adjoint vector.
Definition adjointVectorAccess.hpp:81
void setLhsAdjoint(Identifier const &index)
Definition adjointVectorAccess.hpp:105
void resetAdjoint(Identifier const &index, size_t dim)
Set the adjoint component to zero.
Definition adjointVectorAccess.hpp:133
void setPrimal(Identifier const &index, Real const &primal)
Set the primal value.
Definition adjointVectorAccess.hpp:179
AdjointVector adjointVector
Pointer/reference to an array-accessible collection of gradients.
Definition adjointVectorAccess.hpp:70
T_Real Real
See AdjointVectorAccess.
Definition adjointVectorAccess.hpp:63
void getAdjointVec(Identifier const &index, Real *const vec)
Get the adjoint entry.
Definition adjointVectorAccess.hpp:150
VectorAccessInterface< Real, Identifier > * clone() const
Definition adjointVectorAccess.hpp:97
bool hasPrimals()
Set the primal value.
Definition adjointVectorAccess.hpp:193
void updateTangentWithLhs(Identifier const &index, Real const &jacobian)
Definition adjointVectorAccess.hpp:125
void resetAdjointVec(Identifier const &index)
Set the adjoint entry to zero.
Definition adjointVectorAccess.hpp:138
T_Identifier Identifier
See AdjointVectorAccess.
Definition adjointVectorAccess.hpp:64
void updateAdjoint(Identifier const &index, size_t dim, Real const &adjoint)
Update the adjoint component.
Definition adjointVectorAccess.hpp:163
Real getAdjoint(Identifier const &index, size_t dim)
Get the adjoint component.
Definition adjointVectorAccess.hpp:143
bool isLhsZero()
True if the adjoint set with setLhsAdjoint is zero.
Definition adjointVectorAccess.hpp:92
void updateAdjointWithLhs(Identifier const &index, Real const &jacobian)
Definition adjointVectorAccess.hpp:111
size_t getVectorSize() const
Vector size in the current tape evaluation.
Definition adjointVectorAccess.hpp:87
AdjointVectorTraits::Gradient< T_AdjointVector > Gradient
Adjoint vector entry type.
Definition adjointVectorAccess.hpp:65
T_AdjointVector AdjointVector
See AdjointVectorAccess.
Definition adjointVectorAccess.hpp:66
Real getPrimal(Identifier const &index)
Get the primal value.
Definition adjointVectorAccess.hpp:185
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:91