CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface > Struct Template Reference

Implements all methods from AggregatedTypeVectorAccessWrapper, that can be implemented with combinations of other methods. More...

#include <aggregatedTypeVectorAccessWrapper.hpp>

Inheritance diagram for codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >:

Public Types

using Identifier = T_Identifier
 See RealTraits::DataExtraction::Identifier.
 
using InnerInterface = T_InnerInterface
 See AggregatedTypeVectorAccessWrapperBase.
 
using Real = T_Real
 See RealTraits::DataExtraction::Real.
 
- Public Types inherited from codi::VectorAccessInterface< T_Real, T_Identifier >
using Identifier = CODI_DD(T_Identifier, int)
 See VectorAccessInterface.
 
using Real = CODI_DD(T_Real, double)
 See VectorAccessInterface.
 

Public Member Functions

 AggregatedTypeVectorAccessWrapperBase (InnerInterface *innerInterface)
 Constructor.
 
Misc
size_t getVectorSize () const
 Vector size in the current tape evaluation.
 
bool isLhsZero ()
 True if the adjoint set with setLhsAdjoint is zero.
 
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)
 
Direct adjoint access
void getAdjointVec (Identifier const &index, Real *const vec)
 Get the adjoint entry.
 
Real const * getAdjointVec (Identifier const &index)
 Get the adjoint entry.
 
void updateAdjointVec (Identifier const &index, Real const *const vec)
 Update the adjoint entry.
 
Primal access
bool hasPrimals ()
 True if the tape/vector interface has primal values.
 
- Public Member Functions inherited from codi::VectorAccessInterface< T_Real, T_Identifier >
virtual ~VectorAccessInterface ()
 Destructor.
 
virtual VectorAccessInterfaceclone () const =0
 
virtual void setLhsAdjoint (Identifier const &index)=0
 
virtual void updateAdjointWithLhs (Identifier const &index, Real const &jacobian)=0
 
virtual void setLhsTangent (Identifier const &index)=0
 
virtual void updateTangentWithLhs (Identifier const &index, Real const &jacobian)=0
 
virtual void resetAdjoint (Identifier const &index, size_t dim)=0
 Set the adjoint component to zero.
 
virtual void resetAdjointVec (Identifier const &index)=0
 Set the adjoint entry to zero.
 
virtual Real getAdjoint (Identifier const &index, size_t dim)=0
 Get the adjoint component.
 
virtual void getAdjointVec (Identifier const &index, Real *const vec)=0
 Get the adjoint entry.
 
virtual Real const * getAdjointVec (Identifier const &index)=0
 Get the adjoint entry.
 
virtual void updateAdjoint (Identifier const &index, size_t dim, Real const &adjoint)=0
 Update the adjoint component.
 
virtual void updateAdjointVec (Identifier const &index, Real const *const vec)=0
 Update the adjoint entry.
 
virtual void setPrimal (Identifier const &index, Real const &primal)=0
 Set the primal value.
 
virtual Real getPrimal (Identifier const &index)=0
 Get the primal value.
 

Protected Attributes

std::vector< Realbuffer
 Temporary storage for getAdjointVec access.
 
InnerInterfaceinnerInterface
 Reference to the accessor of the underlying tape.
 
std::vector< Reallhs
 Temporary storage for indirect adjoint or tangent updates.
 

Detailed Description

template<typename T_Real, typename T_Identifier, typename T_InnerInterface>
struct codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >

Implements all methods from AggregatedTypeVectorAccessWrapper, that can be implemented with combinations of other methods.

Template Parameters
T_RealPrimal value type of the combined type.
T_IdentifierIdentifier type type of the combined type.
T_InnerInterfaceThe VectorAccessInterface of the underlying tape.

Member Function Documentation

◆ getAdjointVec() [1/2]

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
Real const * codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::getAdjointVec ( Identifier const &  index)
inline

Get the adjoint entry.

◆ getAdjointVec() [2/2]

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
void codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::getAdjointVec ( Identifier const &  index,
Real *const  vec 
)
inline

Get the adjoint entry.

◆ getVectorSize()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
size_t codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::getVectorSize ( ) const
inlinevirtual

Vector size in the current tape evaluation.

Implements codi::VectorAccessInterface< T_Real, T_Identifier >.

◆ hasPrimals()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
bool codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::hasPrimals ( )
inlinevirtual

True if the tape/vector interface has primal values.

Implements codi::VectorAccessInterface< T_Real, T_Identifier >.

◆ isLhsZero()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
bool codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::isLhsZero ( )
inlinevirtual

True if the adjoint set with setLhsAdjoint is zero.

Implements codi::VectorAccessInterface< T_Real, T_Identifier >.

◆ setLhsAdjoint()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
void codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::setLhsAdjoint ( Identifier const &  index)
inline

Identify the lhs variable $ w $. Create an internal copy of $ \bar w $ and set $ \bar w $ to zero.

◆ setLhsTangent()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
void codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::setLhsTangent ( Identifier const &  index)
inline

Perform $ \dot w = \text{internalMem} $. Internal memory is reset afterwards.

◆ updateAdjointVec()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
void codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::updateAdjointVec ( Identifier const &  index,
Real const *const  vec 
)
inline

Update the adjoint entry.

◆ updateAdjointWithLhs()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
void codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::updateAdjointWithLhs ( Identifier const &  index,
Real const &  jacobian 
)
inline

Perform $ \bar u_{\text{index}} \aeq
                  \text{jacobian} * \bar w $

◆ updateTangentWithLhs()

template<typename T_Real , typename T_Identifier , typename T_InnerInterface >
void codi::AggregatedTypeVectorAccessWrapperBase< T_Real, T_Identifier, T_InnerInterface >::updateTangentWithLhs ( Identifier const &  index,
Real const &  jacobian 
)
inline

Perform $ \text{internalMem} \aeq jacobian *
                 < \dot
                  u_{\text{index}} $.


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