42#include "../../tools/data/direction.hpp"
43#include "../../traits/realTraits.hpp"
44#include "vectorAccessInterface.hpp"
58 template<
typename T_Real,
typename T_Identifier,
typename T_Gradient>
72 std::array<Real, GradientTraits::dim<Gradient>()> buffer;
84 return GradientTraits::dim<Gradient>();
155 return buffer.data();
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
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:90
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:59
void setLhsTangent(Identifier const &index)
Definition adjointVectorAccess.hpp:115
void updateTangentWithLhs(Identifier const &index, Real const &jacobian)
Definition adjointVectorAccess.hpp:121
T_Real Real
See AdjointVectorAccess.
Definition adjointVectorAccess.hpp:60
void updateAdjointWithLhs(Identifier const &index, Real const &jacobian)
Definition adjointVectorAccess.hpp:107
void updateAdjointVec(Identifier const &index, Real const *const vec)
Update the adjoint entry.
Definition adjointVectorAccess.hpp:164
void resetAdjoint(Identifier const &index, size_t dim)
Set the adjoint component to zero.
Definition adjointVectorAccess.hpp:129
Real getAdjoint(Identifier const &index, size_t dim)
Get the adjoint component.
Definition adjointVectorAccess.hpp:139
Real const * getAdjointVec(Identifier const &index)
Get the adjoint entry.
Definition adjointVectorAccess.hpp:153
size_t getVectorSize() const
Vector size in the current tape evaluation.
Definition adjointVectorAccess.hpp:83
bool hasPrimals()
Set the primal value.
Definition adjointVectorAccess.hpp:189
AdjointVectorAccess(Gradient *adjointVector)
Constructor. See interface documentation for details about the adjoint vector.
Definition adjointVectorAccess.hpp:77
VectorAccessInterface< Real, Identifier > * clone() const
Definition adjointVectorAccess.hpp:93
T_Identifier Identifier
See AdjointVectorAccess.
Definition adjointVectorAccess.hpp:61
Gradient * adjointVector
Pointer to the gradient vector.
Definition adjointVectorAccess.hpp:66
void setLhsAdjoint(Identifier const &index)
Definition adjointVectorAccess.hpp:101
void updateAdjoint(Identifier const &index, size_t dim, Real const &adjoint)
Update the adjoint component.
Definition adjointVectorAccess.hpp:159
T_Gradient Gradient
See AdjointVectorAccess.
Definition adjointVectorAccess.hpp:62
void getAdjointVec(Identifier const &index, Real *const vec)
Get the adjoint entry.
Definition adjointVectorAccess.hpp:146
void setPrimal(Identifier const &index, Real const &primal)
Set the primal value.
Definition adjointVectorAccess.hpp:175
void resetAdjointVec(Identifier const &index)
Set the adjoint entry to zero.
Definition adjointVectorAccess.hpp:134
bool isLhsZero()
True if the adjoint set with setLhsAdjoint is zero.
Definition adjointVectorAccess.hpp:88
Real getPrimal(Identifier const &index)
Get the primal value.
Definition adjointVectorAccess.hpp:181
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:91