Implementation of VectorAccessInterface for adjoint vectors. More...
#include <adjointVectorAccess.hpp>

Public Types | |
| using | AdjointVector = T_AdjointVector |
| See AdjointVectorAccess. | |
| using | Gradient = AdjointVectorTraits::Gradient<T_AdjointVector> |
| Adjoint vector entry type. | |
| 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 | |
| AdjointVectorAccess (AdjointVector adjointVector) | |
| Constructor. See interface documentation for details about the adjoint vector. | |
Misc | |
| size_t | getVectorSize () const |
| Vector size in the current tape evaluation. | |
| bool | isLhsZero () |
| True if the adjoint set with setLhsAdjoint is zero. | |
| VectorAccessInterface< Real, Identifier > * | clone () const |
Indirect adjoint access | |
| void | setLhsAdjoint (Identifier const &index) |
| void | updateAdjointWithLhs (Identifier const &index, Real const &jacobian) |
Indirect tangent access | |
| void | setLhsTangent (Identifier const &index) |
| void | updateTangentWithLhs (Identifier const &index, Real const &jacobian) |
Indirect adjoint/tangent access for functions with multiple outputs | |
| void | setActiveVariableForIndirectAccess (size_t pos) |
Direct adjoint access | |
| 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. | |
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 () |
| Set the primal value. | |
Public Member Functions inherited from codi::VectorAccessInterface< T_Real, T_Identifier > | |
| virtual | ~VectorAccessInterface () |
| Destructor. | |
Protected Attributes | |
| AdjointVector | adjointVector |
| Pointer/reference to an array-accessible collection of gradients. | |
Implementation of VectorAccessInterface for adjoint vectors.
The adjoint vector is used as is, it is assumed to have the correct size. No bounds checking is performed.
| 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_AdjointVector | Either a pointer type, for example Gradient*, or a reference to something that can be accessed like a gradient array, for example std::vector<Gradient>&. |
|
inlinevirtual |
Obtain a heap-allocated copy of the vector access inter- face. The user is responsible for deleting the pointer.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
Reimplemented in codi::PrimalAdjointVectorAccess< T_Real, T_Identifier, T_AdjointVector >, codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >, and codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >.
|
inlinevirtual |
Get the adjoint component.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Get the adjoint entry.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Get the adjoint entry.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Get the primal value.
Implementation: Not implemented, returns zero.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
Reimplemented in codi::PrimalAdjointVectorAccess< T_Real, T_Identifier, T_AdjointVector >, codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >, and codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >.
|
inlinevirtual |
Vector size in the current tape evaluation.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Set the primal value.
Implementation: Always returns false.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
Reimplemented in codi::PrimalAdjointVectorAccess< T_Real, T_Identifier, T_AdjointVector >, codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >, and codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >.
|
inlinevirtual |
True if the adjoint set with setLhsAdjoint is zero.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Set the adjoint component to zero.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Set the adjoint entry to zero.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Set ![$ w = wArray[pos]$](../../form_28.png)
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Identify the lhs variable 


Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Perform 
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Set the primal value.
Implementation: Not implemented, empty function.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
Reimplemented in codi::PrimalAdjointVectorAccess< T_Real, T_Identifier, T_AdjointVector >, codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >, and codi::PrimalAdjointVectorAccess< Real, Identifier, AdjointVector >.
|
inlinevirtual |
Update the adjoint component.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Update the adjoint entry.
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Perform 
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.
|
inlinevirtual |
Perform 
Implements codi::VectorAccessInterface< T_Real, T_Identifier >.