CoDiPack  3.1.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::ApplyIdentifierModification< T_Tape, T_Impl > Struct Template Reference

Helper class for iterating or changing the identifiers of a tape. More...

#include <identifierCacheOptimizer.hpp>

Inheritance diagram for codi::ApplyIdentifierModification< T_Tape, T_Impl >:

Public Types

using EvalHandle = typename Tape::EvalHandle
 See FullTapeInterface.
 
using Identifier = typename Tape::Identifier
 See FullTapeInterface.
 
using Impl = T_Impl
 See ApplyIdentifierModification.
 
using Real = typename Tape::Real
 See FullTapeInterface.
 
using Tape = T_Tape
 See ApplyIdentifierModification.
 
- Public Types inherited from codi::CallbacksInterface< T_Tape::Real, T_Tape::Identifier >
using EvalHandle
 See PrimalValueTapeTypes.
 
using Identifier
 See ReadWriteTapeInterface.
 
using Real
 See ReadWriteTapeInterface.
 
using Tape
 Any CoDiPack tape implementation.
 

Public Member Functions

 ApplyIdentifierModification (Tape &tape)
 Constructor.
 
inlinevoid applyPostInputLogic ()
 Called after applyToInput has been called for all inputs.
 
inlinevoid applyPostOutputLogic ()
 Called after applyToOutput has been called for all outputs.
 
inlinevoid applyToInput (Identifier &id)
 Called for each input of each statement or low level function.
 
inlinevoid applyToOutput (Identifier &id)
 Called for each output of each statement or low level function.
 
inlinevoid handleLowLevelFunction (codi::LowLevelFunctionEntry< Tape, Real, Identifier > const &func, codi::ByteDataView &llfData)
 
inlinevoid handleStatement (EvalHandle const &evalHandle, codi::Config::ArgumentSize const &nPassiveValues, size_t &linearAdjointPosition, char *stmtData)
 
inlinevoid handleStatement (Identifier &lhsIndex, codi::Config::ArgumentSize const &size, Real const *jacobians, Identifier *rhsIdentifiers)
 
- Public Member Functions inherited from codi::CallbacksInterface< T_Tape::Real, T_Tape::Identifier >
void handleLowLevelFunction (LowLevelFunctionEntry< Tape, Real, Identifier > const &func, ByteDataView &llfData)
 Called for each low level function.
 
void handleStatement (EvalHandle const &evalHandle, Config::ArgumentSize const &nPassiveValues, size_t &linearAdjointPosition, char *stmtData)
 Called for each statement in a primal value tape.
 
void handleStatement (Identifier &lhsIndex, Config::ArgumentSize const &size, Real const *jacobians, Identifier const *rhsIdentifiers)
 Called for each statement in a Jacobian tape.
 

Detailed Description

template<typename T_Tape, typename T_Impl>
struct codi::ApplyIdentifierModification< T_Tape, T_Impl >

Helper class for iterating or changing the identifiers of a tape.

This class implements the CallbacksInterface and can be used in a custom tape evaluation.

Implementations may overwrite these methods:

  • applyToInput
  • applyPostInputLogic
  • applyToOutput
  • applyPostOutputLogic

They are called in the same order as listed above. See the method documentation for further information.

Template Parameters
T_TapeTape tape on which the modification is applied.
T_ImplFinal implementation of the modification.

Member Function Documentation

◆ handleLowLevelFunction()

template<typename T_Tape, typename T_Impl>
inlinevoid codi::ApplyIdentifierModification< T_Tape, T_Impl >::handleLowLevelFunction ( codi::LowLevelFunctionEntry< Tape, Real, Identifier > const & func,
codi::ByteDataView & llfData )
inline

Implementation of CallbacksInterface::handleLowLevelFunction.

Calls applyToInput for all inputs, then applyPostInputLogic, afterwards applyToOutput for all outputs, and finally applyPostOutputLogic.

◆ handleStatement() [1/2]

template<typename T_Tape, typename T_Impl>
inlinevoid codi::ApplyIdentifierModification< T_Tape, T_Impl >::handleStatement ( EvalHandle const & evalHandle,
codi::Config::ArgumentSize const & nPassiveValues,
size_t & linearAdjointPosition,
char * stmtData )
inline

Implementation of CallbacksInterface::handleStatement for primal value tapes.

Calls applyToInput for all inputs, then applyPostInputLogic, afterwards applyToOutput, and finally applyPostOutputLogic.

◆ handleStatement() [2/2]

template<typename T_Tape, typename T_Impl>
inlinevoid codi::ApplyIdentifierModification< T_Tape, T_Impl >::handleStatement ( Identifier & lhsIndex,
codi::Config::ArgumentSize const & size,
Real const * jacobians,
Identifier * rhsIdentifiers )
inline

Implementation of CallbacksInterface::handleStatement for Jacobian tapes.

Calls applyToInput for all inputs, then applyPostInputLogic, afterwards applyToOutput, and finally applyPostOutputLogic.


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