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

Adjoint variables owned by a tape instance. More...

#include <localAdjoints.hpp>

Inheritance diagram for codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >:

Public Types

using Gradient = T_Gradient
 See LocalAdjoints.
 
using Identifier = T_Identifier
 See LocalAdjoints.
 
using Tape
 See LocalAdjoints.
 
- Public Types inherited from codi::InternalAdjointsInterface< T_Gradient, T_Identifier, T_Tape >
using Gradient = T_Gradient
 See InternalAdjointsInterface.
 
using Identifier = T_Identifier
 See InternalAdjointsInterface.
 
using Tape = T_Tape
 See InternalAdjointsInterface.
 

Public Member Functions

void beginUse ()
 Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.
 
Gradientdata ()
 Pointer to an underlying array implementation.
 
void endUse ()
 Declare that the adjoints are no longer occupied.
 
 LocalAdjoints (size_t initialSize)
 Constructor.
 
Gradientoperator[] (Identifier const &identifier)
 Reference access to the adjoint variable identified by identifier.
 
Gradient const & operator[] (Identifier const &identifier) const
 Constant reference access to the adjoint variable identified by identifier.
 
void resize (Identifier const &newSize)
 Ensure that identifiers up to newSize can be passed to operator[] without error.
 
size_t size () const
 Returns the number of adjoint variables. Internally, declares usage of the adjoints.
 
void swap (LocalAdjoints &other)
 Swap two sets of adjoint variables. Internally, declares usage of the adjoints.
 
void zeroAll ()
 Set all adjoint variables to Gradient().
 
- Public Member Functions inherited from codi::InternalAdjointsInterface< T_Gradient, T_Identifier, T_Tape >
void beginUse ()
 Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.
 
Gradientdata ()
 Pointer to an underlying array implementation.
 
void endUse ()
 Declare that the adjoints are no longer occupied.
 
 InternalAdjointsInterface (size_t initialSize)
 
Gradientoperator[] (Identifier const &identifier)
 Reference access to the adjoint variable identified by identifier.
 
Gradient const & operator[] (Identifier const &identifier) const
 Constant reference access to the adjoint variable identified by identifier.
 
void resize (Identifier const &newSize)
 Ensure that identifiers up to newSize can be passed to operator[] without error.
 
size_t size () const
 Returns the number of adjoint variables. Internally, declares usage of the adjoints.
 
template<typename Impl >
void swap (Impl &other)
 Swap two sets of adjoint variables. Internally, declares usage of the adjoints.
 
void zeroAll ()
 Set all adjoint variables to Gradient().
 

Detailed Description

template<typename T_Gradient, typename T_Identifier, typename T_Tape>
struct codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >

Adjoint variables owned by a tape instance.

Template Parameters
T_GradientThe gradient type of a tape, usually chosen as ActiveType::Gradient.
T_IdentifierThe adjoint/tangent identification of a tape, usually chosen as ActiveType::Identifier.
T_TapeThe associated tape type.

Member Typedef Documentation

◆ Tape

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
using codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::Tape
Initial value:
T_Tape

See LocalAdjoints.

Member Function Documentation

◆ beginUse()

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
void codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::beginUse ( )
inline

Declare that the adjoints are in use, e.g., during a tape evaluation, and cannot be resized right now.

◆ data()

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
Gradient * codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::data ( )
inline

Pointer to an underlying array implementation.

◆ endUse()

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
void codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::endUse ( )
inline

Declare that the adjoints are no longer occupied.

◆ operator[]() [1/2]

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
Gradient & codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::operator[] ( Identifier const & identifier)
inline

Reference access to the adjoint variable identified by identifier.

◆ operator[]() [2/2]

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
Gradient const & codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::operator[] ( Identifier const & identifier) const
inline

Constant reference access to the adjoint variable identified by identifier.

◆ resize()

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
void codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::resize ( Identifier const & newSize)
inline

Ensure that identifiers up to newSize can be passed to operator[] without error.

◆ size()

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
size_t codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::size ( ) const
inline

Returns the number of adjoint variables. Internally, declares usage of the adjoints.

◆ swap()

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
void codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::swap ( LocalAdjoints< T_Gradient, T_Identifier, T_Tape > & other)
inline

Swap two sets of adjoint variables. Internally, declares usage of the adjoints.

◆ zeroAll()

template<typename T_Gradient , typename T_Identifier , typename T_Tape >
void codi::LocalAdjoints< T_Gradient, T_Identifier, T_Tape >::zeroAll ( )
inline

Set all adjoint variables to Gradient().


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