CoDiPack  3.1.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > > Struct Template Reference

#include <aggregatedTypeVectorAccessWrapper.hpp>

Inheritance diagram for codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >:

Public Types

using Identifier
 Identifier value of the aggregate.
 
using InnerInterface = VectorAccessInterface<typename InnerType::Real, typename InnerType::Identifier>
 Inner interface expected by this wrapper.
 
using InnerType = typename Type::InnerActiveType
 Active inner type of the aggregate.
 
using Real = typename RealTraits::DataExtraction<T_Type>::Real
 Real value of the aggregate.
 
using Traits = RealTraits::AggregatedTypeTraits<Real>
 Aggregated type traits.
 
using Type
 See AggregatedTypeVectorAccessWrapperBase.
 
using Type
 See AggregatedTypeVectorAccessWrapper.
 
- Public Types inherited from codi::VectorAccessInterface< int, int >
using Identifier
 See VectorAccessInterface.
 
using Real
 See VectorAccessInterface.
 
- Public Types inherited from codi::VectorAccessInterface< RealTraits::DataExtraction< T_Type >::Real, RealTraits::DataExtraction< T_Type >::Identifier >
using Identifier
 See VectorAccessInterface.
 
using Real
 See VectorAccessInterface.
 

Public Member Functions

 inlineAggregatedTypeVectorAccessWrapper (InnerInterface *innerInterface)
 Constructor.
 
Misc
inlinesize_t getVectorSize () const
 Vector size in the current tape evaluation.
 
inlinebool isLhsZero () const
 True if the adjoint set with setLhsAdjoint is zero.
 
VectorAccessInterface< Real, Identifier > * clone () const
 
Indirect adjoint access
inlinevoid setLhsAdjoint (Identifier const &index)
 
inlinevoid updateAdjointWithLhs (Identifier const &index, Real const &jacobian)
 
Indirect tangent access
inlinevoid setLhsTangent (Identifier const &index)
 
inlinevoid updateTangentWithLhs (Identifier const &index, Real const &jacobian)
 
Indirect adjoint/tangent access for functions with multiple outputs
inlinevoid setActiveVariableForIndirectAccess (size_t pos)
 
Direct adjoint access
inlinevoid resetAdjoint (Identifier const &index, size_t dim)
 Set the adjoint component to zero.
 
inlinevoid resetAdjointVec (Identifier const &index)
 Set the adjoint entry to zero.
 
inlineReal getAdjoint (Identifier const &index, size_t dim)
 Get the adjoint component.
 
inlinevoid getAdjointVec (Identifier const &index, Real *const vec)
 Get the adjoint entry.
 
Real const * getAdjointVec (Identifier const &index)
 Get the adjoint entry.
 
inlinevoid updateAdjoint (Identifier const &index, size_t dim, Real const &adjoint)
 Update the adjoint component.
 
inlinevoid updateAdjointVec (Identifier const &index, Real const *const vec)
 Update the adjoint entry.
 
Primal access
inlinebool hasPrimals ()
 True if the tape/vector interface has primal values.
 
inlinevoid setPrimal (Identifier const &index, Real const &primal)
 Set the primal value.
 
inlineReal getPrimal (Identifier const &index)
 Get the primal value.
 
- Public Member Functions inherited from codi::VectorAccessInterface< int, int >
virtual ~VectorAccessInterface ()
 Destructor.
 
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.
 
- Public Member Functions inherited from codi::VectorAccessInterface< RealTraits::DataExtraction< T_Type >::Real, RealTraits::DataExtraction< T_Type >::Identifier >
virtual ~VectorAccessInterface ()
 Destructor.
 

Public Attributes

std::vector< Realbuffer
 Temporary storage for getAdjointVec.
 
InnerInterfaceinnerInterface
 Reference to inner interface.
 
int lhsOffset
 Offset of indirect access if this aggregated type is part of an outer aggregated type.
 

Static Public Attributes

static int constexpr Elements = Type::Elements
 Number of elements in the aggregate.
 

Detailed Description

template<typename T_Type>
struct codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >

Specialization of AggregatedTypeVectorAccessWrapper for aggregated types.

Template Parameters
Theaggregated data type.

Member Typedef Documentation

◆ Identifier

template<typename T_Type>
using codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::Identifier
Initial value:
typename Type::Identifier Identifier
Type of a corresponding aggregate of identifiers.
Definition realTraits.hpp:172

Identifier value of the aggregate.

◆ Type

template<typename T_Type>
using codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::Type
Initial value:
T_Type

See AggregatedTypeVectorAccessWrapper.

Member Function Documentation

◆ clone()

template<typename T_Type>
VectorAccessInterface< Real, Identifier > * codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::clone ( ) const
inlinevirtual

Obtain a heap-allocated copy of the vector access inter- face. The user is responsible for deleting the pointer.

Implements codi::VectorAccessInterface< int, int >.

◆ getAdjoint()

template<typename T_Type>
inlineReal codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::getAdjoint ( Identifier const & index,
size_t dim )
inlinevirtual

◆ getAdjointVec() [1/2]

◆ getAdjointVec() [2/2]

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::getAdjointVec ( Identifier const & index,
Real *const vec )
inlinevirtual

◆ getPrimal()

◆ getVectorSize()

template<typename T_Type>
inlinesize_t codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::getVectorSize ( ) const
inlinevirtual

Vector size in the current tape evaluation.

Implements codi::VectorAccessInterface< int, int >.

◆ hasPrimals()

template<typename T_Type>
inlinebool codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::hasPrimals ( )
inlinevirtual

True if the tape/vector interface has primal values.

Implements codi::VectorAccessInterface< int, int >.

◆ isLhsZero()

template<typename T_Type>
inlinebool codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::isLhsZero ( ) const
inlinevirtual

True if the adjoint set with setLhsAdjoint is zero.

Implements codi::VectorAccessInterface< int, int >.

◆ resetAdjoint()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::resetAdjoint ( Identifier const & index,
size_t dim )
inlinevirtual

◆ resetAdjointVec()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::resetAdjointVec ( Identifier const & index)
inlinevirtual

◆ setActiveVariableForIndirectAccess()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::setActiveVariableForIndirectAccess ( size_t pos)
inlinevirtual

Set $ w = wArray[pos]$ for the other indirect access routines.

Implements codi::VectorAccessInterface< int, int >.

◆ setLhsAdjoint()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::setLhsAdjoint ( Identifier const & index)
inlinevirtual

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

Implements codi::VectorAccessInterface< RealTraits::DataExtraction< T_Type >::Real, RealTraits::DataExtraction< T_Type >::Identifier >.

◆ setLhsTangent()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::setLhsTangent ( Identifier const & index)
inlinevirtual

◆ setPrimal()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::setPrimal ( Identifier const & index,
Real const & primal )
inlinevirtual

◆ updateAdjoint()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::updateAdjoint ( Identifier const & index,
size_t dim,
Real const & adjoint )
inlinevirtual

◆ updateAdjointVec()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::updateAdjointVec ( Identifier const & index,
Real const *const vec )
inlinevirtual

◆ updateAdjointWithLhs()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::updateAdjointWithLhs ( Identifier const & index,
Real const & jacobian )
inlinevirtual

◆ updateTangentWithLhs()

template<typename T_Type>
inlinevoid codi::AggregatedTypeVectorAccessWrapper< T_Type, RealTraits::EnableIfAggregatedActiveType< T_Type > >::updateTangentWithLhs ( Identifier const & index,
Real const & jacobian )
inlinevirtual

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