Implementation of VectorAccessInterface for adjoint and primal vectors. More...
#include <primalAdjointVectorAccess.hpp>
Public Types | |
using | Base = AdjointVectorAccess<Real, Identifier, Gradient> |
Base class abbreviation. | |
using | Gradient = T_Gradient |
See PrimalAdjointVectorAccess. | |
using | Identifier = T_Identifier |
See PrimalAdjointVectorAccess. | |
using | Real = T_Real |
See PrimalAdjointVectorAccess. | |
Public Types inherited from codi::AdjointVectorAccess< T_Real, T_Identifier, T_Gradient > | |
using | Gradient = T_Gradient |
See AdjointVectorAccess. | |
using | Identifier = T_Identifier |
See AdjointVectorAccess. | |
using | Real = T_Real |
See AdjointVectorAccess. | |
Public Types inherited from codi::VectorAccessInterface< T_Real, T_Identifier > | |
using | Identifier = T_Identifier |
See VectorAccessInterface. | |
using | Real = T_Real |
See VectorAccessInterface. | |
Public Member Functions | |
PrimalAdjointVectorAccess (Gradient *adjointVector, Real *primalVector) | |
Constructor. See interface documentation for details about the vectors. | |
Misc | |
VectorAccessInterface< Real, Identifier > * | clone () const |
Primal access | |
void | setPrimal (Identifier const &index, Real const &primal) |
Set the primal value. | |
Real | getPrimal (Identifier const &index) |
Get the primal value. | |
bool | hasPrimals () |
True if the tape/vector interface has primal values. | |
Public Member Functions inherited from codi::AdjointVectorAccess< T_Real, T_Identifier, T_Gradient > | |
AdjointVectorAccess (Gradient *adjointVector) | |
Constructor. See interface documentation for details about the adjoint vector. | |
size_t | getVectorSize () const |
Vector size in the current tape evaluation. | |
bool | isLhsZero () |
True if the adjoint set with setLhsAdjoint is zero. | |
void | setLhsAdjoint (Identifier const &index) |
void | updateAdjointWithLhs (Identifier const &index, Real const &jacobian) |
void | setLhsTangent (Identifier const &index) |
void | updateTangentWithLhs (Identifier const &index, Real const &jacobian) |
void | resetAdjoint (Identifier const &index, size_t dim) |
Set the adjoint component to zero. | |
void | resetAdjointVec (Identifier const &index) |
Set the adjoint entry to zero. | |
Real | getAdjoint (Identifier const &index, size_t dim) |
Get the adjoint component. | |
void | getAdjointVec (Identifier const &index, Real *const vec) |
Get the adjoint entry. | |
Real const * | getAdjointVec (Identifier const &index) |
Get the adjoint entry. | |
void | updateAdjoint (Identifier const &index, size_t dim, Real const &adjoint) |
Update the adjoint component. | |
void | updateAdjointVec (Identifier const &index, Real const *const vec) |
Update the adjoint entry. | |
Public Member Functions inherited from codi::VectorAccessInterface< T_Real, T_Identifier > | |
virtual | ~VectorAccessInterface () |
Destructor. | |
Additional Inherited Members | |
Protected Attributes inherited from codi::AdjointVectorAccess< T_Real, T_Identifier, T_Gradient > | |
Gradient * | adjointVector |
Pointer to the gradient vector. | |
Implementation of VectorAccessInterface for adjoint and primal vectors.
Both vectors are used as is, they are assumed to have correct sizes. No bounds checking is performed.
Inherits from AdjointVectorAccess and overwrites all methods specific to the primals.
T_Real | The computation type of a tape, usually chosen as ActiveType::Real. |
T_Identifier | The adjoint/tangent identification of a tape, usually chosen as ActiveType::Identifier. |
T_Gradient | The gradient type of a tape, usually chosen as ActiveType::Gradient. |
|
inlinevirtual |
Obtain a heap-allocated copy of the vector access inter- face. The user is responsible for deleting the pointer.
Reimplemented from codi::AdjointVectorAccess< T_Real, T_Identifier, T_Gradient >.
|
inlinevirtual |
Get the primal value.
Reimplemented from codi::AdjointVectorAccess< T_Real, T_Identifier, T_Gradient >.
|
inlinevirtual |
True if the tape/vector interface has primal values.
Implementation: Always returns true.
Reimplemented from codi::AdjointVectorAccess< T_Real, T_Identifier, T_Gradient >.
|
inlinevirtual |
Set the primal value.
Reimplemented from codi::AdjointVectorAccess< T_Real, T_Identifier, T_Gradient >.