CoDiPack  3.0.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::AdjointVectorWithOffset< T_Identifier, T_Gradient > Struct Template Reference

Implementation of vector-based adjoints that take into account an offset when addressing into the vector. More...

#include <customAdjoints.hpp>

Public Types

using Gradient = T_Gradient
 See AdjointVectorWithOffset.
 
using Identifier = T_Identifier
 See AdjointVectorWithOffset.
 

Public Member Functions

 AdjointVectorWithOffset (Gradient *adjoints, Identifier const &offset)
 Constructor.
 
inlineGradient & operator[] (Identifier const &identifier)
 Access operator in non-constant call contexts.
 
inlineGradient const & operator[] (Identifier const &identifier) const
 Access operator in constant call contexts.
 

Public Attributes

Gradientadjoints
 Points to user-provided adjoints memory.
 
Identifier const offset
 Offset that is subtracted when addressing into the adjoints memory.
 

Detailed Description

template<typename T_Identifier, typename T_Gradient>
struct codi::AdjointVectorWithOffset< T_Identifier, T_Gradient >

Implementation of vector-based adjoints that take into account an offset when addressing into the vector.

Useful if resizing adjoint vectors based on non-local information would result in a large overallocation. Can be used as custom adjoints for tape evaluations, see CustomAdjointVectorEvaluationTapeInterface. Can also be used for Jacobian computations with custom adjoints, see Algorithms::computeJacobianCustomAdjoints().

The user is responsible for providing memory with adequate size, no bounds checking is performed.

Template Parameters
T_IdentifierIdentifier type, usually chosen as Tape::Identifier.
T_GradientGradient type, usually chosen as Tape::Gradient.

The documentation for this struct was generated from the following file: