CoDiPack  2.3.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::ReadWriteTapeInterface< T_Real, T_Gradient, T_Identifier, T_Position > Struct Template Reference

Write a tape to a file using a writer from the codi::TapeWriterInterface. When reading a stored tape, create a primal or a Jacobian statement on the tape. More...

#include <readWriteTapeInterface.hpp>

Inheritance diagram for codi::ReadWriteTapeInterface< T_Real, T_Gradient, T_Identifier, T_Position >:

Public Types

using EvalHandle = void*
 See PrimalValueTapeTypes.
 
using Gradient = T_Gradient
 See ReadWriteTapeInterface.
 
using Identifier = T_Identifier
 See ReadWriteTapeInterface.
 
using Position = T_Position
 See ReadWriteTapeInterface.
 
using Real = T_Real
 See ReadWriteTapeInterface.
 
using Type = int
 Provided by the template arguments in the writeTape methods.
 
using WriterInterface = TapeWriterInterface<Type>
 Writer interface.
 
using WriterInterfaceUniquePtr = std::unique_ptr<TapeWriterInterface<Type>>
 Unique pointer to writer.
 

Public Member Functions

Tape writing
template<typename Type >
void writeTape (WriterInterfaceUniquePtr writer)
 For full-tape writers using a smart pointer.
 
template<typename Type >
void writeTape (WriterInterfaceUniquePtr writer, Position const &start, Position const &end)
 For partial-tape writers using a smart pointer.
 
template<typename Type >
void writeTape (WriterInterface &writeToFileRef)
 For full-tape writers using a manually generated writers.
 
template<typename Type >
void writeTape (WriterInterface &writeToFileRef, Position const &start, Position const &end)
 For partial-tape writers using a manually generated writers.
 
template<typename Type >
void writeTape (WriterInterface *writer, Position const &start, Position const &end)
 For full or partial tapes using a pointer to the writer.
 
Tape Reading
void createStatementManual (Real const &lhsValue, Identifier &lhsIndex, Config::ArgumentSize const &size, Real const *jacobians, Identifier const *rhsIdentifiers)
 
void createStatementManual (Identifier const &lhsIndex, Real const &lhsValue, Config::ArgumentSize const &nActiveValues, Identifier const *const rhsIdentifiers, Config::ArgumentSize const &nPassiveValues, Real const *const rhsPrimals, Config::ArgumentSize const &nConstants, Real const *const rhsConstant, EvalHandle const &evalHandle)
 

Detailed Description

template<typename T_Real, typename T_Gradient, typename T_Identifier, typename T_Position>
struct codi::ReadWriteTapeInterface< T_Real, T_Gradient, T_Identifier, T_Position >

Write a tape to a file using a writer from the codi::TapeWriterInterface. When reading a stored tape, create a primal or a Jacobian statement on the tape.

See codi::TapeWriterInterface and codi::TapeReaderInterface for details.

Template Parameters
T_RealThe computation type of a tape, usually chosen as ActiveType::Real.
T_GradientThe gradient type of a tape usually, chosen as ActiveType::Gradient.
T_IdentifierThe adjoint/tangent identification type of a tape, usually chosen as ActiveType::Identifier.
T_PositionGlobal tape position, usually chosen as Tape::Position.

Member Function Documentation

◆ createStatementManual() [1/2]

template<typename T_Real , typename T_Gradient , typename T_Identifier , typename T_Position >
void codi::ReadWriteTapeInterface< T_Real, T_Gradient, T_Identifier, T_Position >::createStatementManual ( Identifier const & lhsIndex,
Real const & lhsValue,
Config::ArgumentSize const & nActiveValues,
Identifier const *const rhsIdentifiers,
Config::ArgumentSize const & nPassiveValues,
Real const *const rhsPrimals,
Config::ArgumentSize const & nConstants,
Real const *const rhsConstant,
EvalHandle const & evalHandle )

Initialize the statement and the rhs vectors from a file. It is especially important that the Identifiers are valid when using this method. This overload is used for Primal tapes.

◆ createStatementManual() [2/2]

template<typename T_Real , typename T_Gradient , typename T_Identifier , typename T_Position >
void codi::ReadWriteTapeInterface< T_Real, T_Gradient, T_Identifier, T_Position >::createStatementManual ( Real const & lhsValue,
Identifier & lhsIndex,
Config::ArgumentSize const & size,
Real const * jacobians,
Identifier const * rhsIdentifiers )

Initialize the statement from a file. It is especially important that the lhsIndex is valid when using this method. This overload is used for Jacobian tapes.


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