CoDiPack  2.3.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
jacobianReuseTape.hpp
1/*
2 * CoDiPack, a Code Differentiation Package
3 *
4 * Copyright (C) 2015-2024 Chair for Scientific Computing (SciComp), University of Kaiserslautern-Landau
5 * Homepage: http://scicomp.rptu.de
6 * Contact: Prof. Nicolas R. Gauger (codi@scicomp.uni-kl.de)
7 *
8 * Lead developers: Max Sagebaum, Johannes Blühdorn (SciComp, University of Kaiserslautern-Landau)
9 *
10 * This file is part of CoDiPack (http://scicomp.rptu.de/software/codi).
11 *
12 * CoDiPack is free software: you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, either version 3 of the
15 * License, or (at your option) any later version.
16 *
17 * CoDiPack is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty
19 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * See the GNU General Public License for more details.
22 * You should have received a copy of the GNU
23 * General Public License along with CoDiPack.
24 * If not, see <http://www.gnu.org/licenses/>.
25 *
26 * For other licensing options please contact us.
27 *
28 * Authors:
29 * - SciComp, University of Kaiserslautern-Landau:
30 * - Max Sagebaum
31 * - Johannes Blühdorn
32 * - Former members:
33 * - Tim Albring
34 */
35#pragma once
36
37#include <algorithm>
38#include <fstream>
39#include <type_traits>
40
41#include "../config.h"
42#include "../expressions/lhsExpressionInterface.hpp"
43#include "../expressions/logic/compileTimeTraversalLogic.hpp"
44#include "../expressions/logic/traversalLogic.hpp"
45#include "../misc/macros.hpp"
46#include "../traits/expressionTraits.hpp"
47#include "data/chunk.hpp"
48#include "indices/indexManagerInterface.hpp"
49#include "interfaces/editingTapeInterface.hpp"
50#include "interfaces/reverseTapeInterface.hpp"
51#include "io/tapeReaderWriterInterface.hpp"
52#include "jacobianBaseTape.hpp"
53
55namespace codi {
56
64 template<typename T_TapeTypes>
66 : public JacobianBaseTape<T_TapeTypes, JacobianReuseTape<T_TapeTypes>>,
67 public EditingTapeInterface<typename JacobianBaseTape<T_TapeTypes, JacobianReuseTape<T_TapeTypes>>::Position> {
68 public:
69
70 using TapeTypes = CODI_DD(T_TapeTypes,
73
75 friend Base;
76
77 using Real = typename TapeTypes::Real;
78 using Gradient = typename TapeTypes::Gradient;
79 using IndexManager = typename TapeTypes::IndexManager;
80 using Identifier = typename TapeTypes::Identifier;
81 using Position = typename Base::Position;
82 using StatementData = typename TapeTypes::StatementData;
83
84 CODI_STATIC_ASSERT(!IndexManager::IsLinear, "This class requires an index manager with a reuse scheme.");
85
88
89 /*******************************************************************************/
92
94
96 void clearAdjoints(Position const& start, Position const& end,
98 if (AdjointsManagement::Automatic == adjointsManagement) {
99 this->adjoints.beginUse();
100 }
101
102 Identifier adjointsSize = (Identifier)this->adjoints.size();
103
104 auto clearFunc = [&adjointsSize, this](Identifier* index, Config::ArgumentSize* stmtSize) {
105 CODI_UNUSED(stmtSize);
106
107 if (*index < adjointsSize) {
108 this->adjoints[*index] = Gradient();
109 }
110 };
111
112 using StmtPosition = typename StatementData::Position;
113 StmtPosition startStmt = this->llfByteData.template extractPosition<StmtPosition>(start);
114 StmtPosition endStmt = this->llfByteData.template extractPosition<StmtPosition>(end);
115
116 this->statementData.forEachReverse(startStmt, endStmt, clearFunc);
117
118 if (AdjointsManagement::Automatic == adjointsManagement) {
119 this->adjoints.endUse();
120 }
121 }
122
124 template<typename AdjointVector>
125 void clearCustomAdjoints(Position const& start, Position const& end, AdjointVector&& data) {
126 auto clearFunc = [&data](Identifier* index, Config::ArgumentSize* stmtSize) {
127 CODI_UNUSED(stmtSize);
128 data[*index] = Gradient();
129 };
130
131 using StmtPosition = typename StatementData::Position;
132 StmtPosition startStmt = this->llfByteData.template extractPosition<StmtPosition>(start);
133 StmtPosition endStmt = this->llfByteData.template extractPosition<StmtPosition>(end);
134
135 this->statementData.forEachReverse(startStmt, endStmt, clearFunc);
136 }
137
139
140 protected:
141
142 /*******************************************************************************/
145
148 CODI_INLINE void pushStmtData(Identifier const& index, Config::ArgumentSize const& numberOfArguments) {
149 this->statementData.pushData(index, numberOfArguments);
150 }
151
153 template<typename AdjointVector>
155 /* data from call */
156 JacobianReuseTape& tape, AdjointVector&& adjointVector,
157 /* data from low level function byte data vector */
158 size_t& curLLFByteDataPos, size_t const& endLLFByteDataPos, char* dataPtr,
159 /* data from low level function info data vector */
160 size_t& curLLFInfoDataPos, size_t const& endLLFInfoDataPos, Config::LowLevelFunctionToken* const tokenPtr,
161 Config::LowLevelFunctionDataSize* const dataSizePtr,
162 /* data from jacobian vector */
163 size_t& curJacobianPos, size_t const& endJacobianPos, Real const* const rhsJacobians,
164 Identifier const* const rhsIdentifiers,
165 /* data from statement vector */
166 size_t& curStmtPos, size_t const& endStmtPos, Identifier const* const lhsIdentifiers,
167 Config::ArgumentSize const* const numberOfJacobians) {
168 CODI_UNUSED(endJacobianPos, endLLFByteDataPos, endLLFInfoDataPos);
169
171
172 typename Base::template VectorAccess<AdjointVector> vectorAccess(adjointVector);
173
174 while (curStmtPos < endStmtPos) CODI_Likely {
175 Config::ArgumentSize const argsSize = numberOfJacobians[curStmtPos];
176
178 Base::template callLowLevelFunction<LowLevelFunctionEntryCallKind::Forward>(
179 tape, true, curLLFByteDataPos, dataPtr, curLLFInfoDataPos, tokenPtr, dataSizePtr, &vectorAccess);
180 } else CODI_Likely {
181 Adjoint lhsAdjoint = Adjoint();
182 Base::template incrementTangents<AdjointVector>(adjointVector, lhsAdjoint, argsSize, curJacobianPos,
183 rhsJacobians, rhsIdentifiers);
184
185 adjointVector[lhsIdentifiers[curStmtPos]] = lhsAdjoint;
186
188 tape, lhsIdentifiers[curStmtPos], GradientTraits::dim<Adjoint>(),
189 GradientTraits::toArray(lhsAdjoint).data());
190 }
191
192 curStmtPos += 1;
193 }
194 }
195
197 template<typename AdjointVector>
199 /* data from call */
200 JacobianReuseTape& tape, AdjointVector&& adjointVector,
201 /* data from low level function byte data vector */
202 size_t& curLLFByteDataPos, size_t const& endLLFByteDataPos, char* dataPtr,
203 /* data from low level function info data vector */
204 size_t& curLLFInfoDataPos, size_t const& endLLFInfoDataPos, Config::LowLevelFunctionToken* const tokenPtr,
205 Config::LowLevelFunctionDataSize* const dataSizePtr,
206 /* data from jacobianData */
207 size_t& curJacobianPos, size_t const& endJacobianPos, Real const* const rhsJacobians,
208 Identifier const* const rhsIdentifiers,
209 /* data from statementData */
210 size_t& curStmtPos, size_t const& endStmtPos, Identifier const* const lhsIdentifiers,
211 Config::ArgumentSize const* const numberOfJacobians) {
212 CODI_UNUSED(endJacobianPos, endLLFByteDataPos, endLLFInfoDataPos);
213
215
216 typename Base::template VectorAccess<AdjointVector> vectorAccess(adjointVector);
217
218 while (curStmtPos > endStmtPos) CODI_Likely {
219 curStmtPos -= 1;
220
221 Config::ArgumentSize const argsSize = numberOfJacobians[curStmtPos];
222
224 Base::template callLowLevelFunction<LowLevelFunctionEntryCallKind::Reverse>(
225 tape, false, curLLFByteDataPos, dataPtr, curLLFInfoDataPos, tokenPtr, dataSizePtr, &vectorAccess);
226 } else CODI_Likely {
227 Adjoint const lhsAdjoint = adjointVector[lhsIdentifiers[curStmtPos]];
228
230 tape, lhsIdentifiers[curStmtPos], GradientTraits::dim<Adjoint>(),
231 GradientTraits::toArray(lhsAdjoint).data());
232
233 adjointVector[lhsIdentifiers[curStmtPos]] = Adjoint();
234 Base::incrementAdjoints(adjointVector, lhsAdjoint, argsSize, curJacobianPos, rhsJacobians, rhsIdentifiers);
235 }
236 }
237 }
238
240 template<typename TapeTypes>
242 /* file interface pointer*/
244 /* data from low level function byte data vector */
245 size_t& curLLFByteDataPos, size_t const& endLLFByteDataPos, char* dataPtr,
246 /* data from low level function info data vector */
247 size_t& curLLFInfoDataPos, size_t const& endLLFInfoDataPos, Config::LowLevelFunctionToken* const tokenPtr,
248 Config::LowLevelFunctionDataSize* const dataSizePtr,
249 /* data from jacobianData */
250 size_t& curJacobianPos, size_t const& endJacobianPos, Real const* const rhsJacobians,
251 Identifier const* const rhsIdentifiers,
252 /* data from statementData */
253 size_t& curStmtPos, size_t const& endStmtPos, Identifier const* const lhsIdentifiers,
254 Config::ArgumentSize const* const numberOfJacobians) {
255 CODI_UNUSED(endLLFByteDataPos, endLLFInfoDataPos, endJacobianPos);
256 Identifier curLhsIdentifier;
257 Config::ArgumentSize curNumberOfJacobians;
258
259 while (curStmtPos < endStmtPos) CODI_Likely {
260 curLhsIdentifier = lhsIdentifiers[curStmtPos];
261 curNumberOfJacobians = numberOfJacobians[curStmtPos];
262 if (Config::StatementLowLevelFunctionTag == curNumberOfJacobians) CODI_Unlikely {
263 writer->writeLowLevelFunction(curLLFByteDataPos, dataPtr, curLLFInfoDataPos, tokenPtr, dataSizePtr);
264 } else CODI_Likely {
265 writer->writeStatement(curLhsIdentifier, curJacobianPos, rhsJacobians, rhsIdentifiers,
266 curNumberOfJacobians);
267 curJacobianPos += numberOfJacobians[curStmtPos];
268 }
269 curStmtPos += 1;
270 }
271 }
273
274 public:
275
276 /*******************************************************************************/
279
283 CODI_INLINE void erase(Position const& start, Position const& end) {
284 JacobianReuseTape emptyTape;
285 erase(start, end, emptyTape);
286 }
287
288 // clang-format off
290 // clang-format on
291 CODI_INLINE void erase(Position const& start, Position const& end, JacobianReuseTape& emptyTape) {
292 // Store the tail after the part to be erased in the helper tape.
293 emptyTape.append(*this, end, this->getPosition());
294
295 // Reset the tape to before the erased part and re-append the tail. This accounts for external function position
296 // correction.
297
298 // Do not delete external function data for the part to be reappended.
299 this->llfByteData.resetTo(end);
300 clearAdjoints(end, this->getPosition());
301
302 // Delete external function data in the part to be erased.
303 this->resetTo(start);
304
305 this->append(emptyTape, emptyTape.getZeroPosition(), emptyTape.getPosition());
306
307 // Do not delete external function data in the helper tape.
308 emptyTape.llfByteData.reset();
309 }
310
312 CODI_INLINE void append(JacobianReuseTape& srcTape, Position const& start, Position const& end) {
313 srcTape.llfByteData.evaluateForward(start, end, JacobianReuseTape::internalAppend, this);
314 }
315
317 template<typename Func>
318 void editIdentifiers(Func&& modifyIdentifier, Position const& start, Position const& end) {
319 auto evalFunc = [&modifyIdentifier](
320 /* data from low level function byte data vector */
321 size_t&, size_t const&, char*,
322 /* data from low level function info data vector */
323 size_t&, size_t const&, Config::LowLevelFunctionToken* const,
325 /* data from jacobianData */
326 size_t& curJacobianPos, size_t const&, Real const* const, Identifier* const rhsIdentifiers,
327 /* data from statementData */
328 size_t& curStmtPos, size_t const& endStmtPos, Identifier* const lhsIdentifiers,
329 Config::ArgumentSize const* const numberOfJacobians) {
330 while (curStmtPos < endStmtPos) CODI_Likely {
331 Config::ArgumentSize const argsSize = numberOfJacobians[curStmtPos];
332
333 if (Config::StatementLowLevelFunctionTag != argsSize) CODI_Likely { // skip low-level functions
334 modifyIdentifier(lhsIdentifiers[curStmtPos]);
335
336 size_t endJacobianPos = curJacobianPos + argsSize;
337 while (curJacobianPos < endJacobianPos) CODI_Likely {
338 modifyIdentifier(rhsIdentifiers[curJacobianPos]);
339 curJacobianPos += 1;
340 }
341 }
342
343 curStmtPos += 1;
344 }
345 };
346
347 Base::llfByteData.evaluateForward(start, end, evalFunc);
348 }
349
351
352 private:
353
354 static CODI_INLINE void internalAppend(
355 /* data from call */
356 JacobianReuseTape* dstTape,
357 /* data from low level function byte data vector */
358 size_t& curLLFByteDataPos, size_t const& endLLFByteDataPos, char* dataPtr,
359 /* data from low level function info data vector */
360 size_t& curLLFInfoDataPos, size_t const& endLLFInfoDataPos, Config::LowLevelFunctionToken* const tokenPtr,
361 Config::LowLevelFunctionDataSize* const dataSizePtr,
362 /* data from jacobianData */
363 size_t& curJacobianPos, size_t const& endJacobianPos, Real const* const rhsJacobians,
364 Identifier const* const rhsIdentifiers,
365 /* data from statementData */
366 size_t& curStmtPos, size_t const& endStmtPos, Identifier const* const lhsIdentifiers,
367 Config::ArgumentSize const* const numberOfJacobians) {
368 CODI_UNUSED(endLLFByteDataPos, endLLFInfoDataPos, endJacobianPos);
369
370 while (curStmtPos < endStmtPos) {
371 Config::ArgumentSize const argsSize = numberOfJacobians[curStmtPos];
373 Config::LowLevelFunctionToken token = tokenPtr[curLLFInfoDataPos];
374 size_t dataSize = dataSizePtr[curLLFInfoDataPos];
375
376 // Create the store on the new tape.
377 ByteDataView dstDataStore = {};
378 dstTape->pushLowLevelFunction(token, dataSize, dstDataStore);
379
380 // Copy the data.
381 dstDataStore.write(&dataPtr[curLLFByteDataPos], dataSize);
382
383 curLLFInfoDataPos += 1;
384 curLLFByteDataPos += dataSize;
385 } else CODI_Likely {
386 // Manual statement push.
387 dstTape->statementData.reserveItems(1);
388 dstTape->jacobianData.reserveItems(numberOfJacobians[curStmtPos]);
389
390 dstTape->pushStmtData(lhsIdentifiers[curStmtPos], numberOfJacobians[curStmtPos]);
391 size_t curJacobianEnd = curJacobianPos + numberOfJacobians[curStmtPos];
392
393 while (curJacobianPos < curJacobianEnd) {
394 dstTape->jacobianData.pushData(rhsJacobians[curJacobianPos], rhsIdentifiers[curJacobianPos]);
395 ++curJacobianPos;
396 }
397 }
398
399 ++curStmtPos;
400 }
401 }
402 };
403}
#define CODI_Unlikely
Declare unlikely evaluation of an execution path.
Definition config.h:399
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define CODI_Likely
Declare likely evaluation of an execution path.
Definition config.h:397
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
#define CODI_STATIC_ASSERT(cond, message)
Static assert in CoDiPack.
Definition macros.hpp:123
#define CODI_T(...)
Abbreviation for CODI_TEMPLATE.
Definition macros.hpp:111
typename GradientImplementation< AdjointVector >::Gradient Gradient
Deduce the entry type from an adjoint vector type, usually identical to the gradient type of a tape.
Definition adjointVectorTraits.hpp:92
uint16_t LowLevelFunctionDataSize
Size store type for a low level function.
Definition config.h:98
uint16_t LowLevelFunctionToken
Token type for low level functions in the tapes.
Definition config.h:108
size_t constexpr StatementLowLevelFunctionTag
Statement tag for low level functions.
Definition config.h:126
uint8_t ArgumentSize
Type for the number of arguments in statements.
Definition config.h:117
std::array< AtomicTraits::RemoveAtomic< typename TraitsImplementation< Gradient >::Real >, TraitsImplementation< Gradient >::dim > toArray(Gradient const &gradient)
Converts the (possibly multi-component) gradient to an array of Reals.
Definition gradientTraits.hpp:116
CoDiPack - Code Differentiation Package.
Definition codi.hpp:91
void CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:46
AdjointsManagement
Policies for management of the tape's interal adjoints.
Definition tapeParameters.hpp:98
@ Automatic
Manage internal adjoints automatically, including locking, bounds checking, and resizing.
Represents a concrete lvalue in the CoDiPack expression tree.
Definition activeType.hpp:52
Implementation of VectorAccessInterface for adjoint vectors.
Definition adjointVectorAccess.hpp:61
Definition byteDataView.hpp:51
T * write(T const &data)
Write a single entry of type T.
Definition byteDataView.hpp:114
Data is stored chunk-wise in this DataInterface implementation. If a chunk runs out of space,...
Definition chunkedData.hpp:64
Position getPosition() const
Current position of the tape.
Definition commonTapeImplementation.hpp:665
Position getZeroPosition() const
Initial position of the tape.
Definition commonTapeImplementation.hpp:670
LowLevelFunctionByteData llfByteData
Byte data for low level functions.
Definition commonTapeImplementation.hpp:156
void resetTo(Position const &pos, bool resetAdjoints=true, AdjointsManagement adjointsManagement=AdjointsManagement::Automatic)
Reset the tape to the provided position.
Definition commonTapeImplementation.hpp:704
Edit tapes after they have been recorded.
Definition editingTapeInterface.hpp:65
static void notifyStatementEvaluateListeners(Tape &tape, Identifier const &lhsIdentifier, size_t sizeLhsAdjoint, Real const *lhsAdjoint)
Invoke callbacks for StatementEvaluate events.
Definition eventSystem.hpp:712
Indices enable the mapping of primal values to their adjoint counterparts.
Definition indexManagerInterface.hpp:78
Base class for all standard Jacobian tape implementations.
Definition jacobianBaseTape.hpp:128
JacobianData jacobianData
Data stream for argument specific data.
Definition jacobianBaseTape.hpp:174
typename Base::Position Position
See TapeTypesInterface.
Definition jacobianBaseTape.hpp:152
StatementData statementData
Data stream for statement specific data.
Definition jacobianBaseTape.hpp:173
Adjoints adjoints
Evaluation vector for AD.
Definition jacobianBaseTape.hpp:176
void clearAdjoints(AdjointsManagement adjointsManagement=AdjointsManagement::Automatic)
Clear all adjoint values, that is, set them to zero.
Definition jacobianBaseTape.hpp:471
void pushLowLevelFunction(Config::LowLevelFunctionToken token, size_t size, ByteDataView &data)
Push a low level function to the tape.
Definition jacobianBaseTape.hpp:848
static void incrementAdjoints(AdjointVector &adjointVector, AdjointVectorTraits::Gradient< AdjointVector > const &lhsAdjoint, Config::ArgumentSize const &numberOfArguments, size_t &curJacobianPos, Real const *const rhsJacobians, Identifier const *const rhsIdentifiers)
Performs the AD reverse equation for a statement.
Definition jacobianBaseTape.hpp:527
Final implementation for a Jacobian tape with a reuse index management.
Definition jacobianReuseTape.hpp:67
void erase(Position const &start, Position const &end)
Erase a part of the tape. It has to hold start <= end.
Definition jacobianReuseTape.hpp:283
void append(JacobianReuseTape &srcTape, Position const &start, Position const &end)
Definition jacobianReuseTape.hpp:312
static void internalEvaluateReverse_EvalStatements(JacobianReuseTape &tape, AdjointVector &&adjointVector, size_t &curLLFByteDataPos, size_t const &endLLFByteDataPos, char *dataPtr, size_t &curLLFInfoDataPos, size_t const &endLLFInfoDataPos, Config::LowLevelFunctionToken *const tokenPtr, Config::LowLevelFunctionDataSize *const dataSizePtr, size_t &curJacobianPos, size_t const &endJacobianPos, Real const *const rhsJacobians, Identifier const *const rhsIdentifiers, size_t &curStmtPos, size_t const &endStmtPos, Identifier const *const lhsIdentifiers, Config::ArgumentSize const *const numberOfJacobians)
Perform a reverse evaluation of the tape. Arguments are from the recursive eval methods of the DataIn...
Definition jacobianReuseTape.hpp:198
typename TapeTypes::Gradient Gradient
See TapeTypesInterface.
Definition jacobianReuseTape.hpp:78
typename TapeTypes::StatementData StatementData
See JacobianTapeTypes.
Definition jacobianReuseTape.hpp:82
void erase(Position const &start, Position const &end, JacobianReuseTape &emptyTape)
Erase a part of the tape. It has to hold start <= end. This variant of erase takes a reference to an ...
Definition jacobianReuseTape.hpp:291
T_TapeTypes TapeTypes
See JacobianReuseTape.
Definition jacobianReuseTape.hpp:70
void clearAdjoints(Position const &start, Position const &end, AdjointsManagement adjointsManagement=AdjointsManagement::Automatic)
Clear all adjoints that would be set in a tape evaluation from start to end. It has to hold start >= ...
Definition jacobianReuseTape.hpp:96
JacobianReuseTape()
Constructor.
Definition jacobianReuseTape.hpp:87
static void internalWriteTape(codi::TapeWriterInterface< TapeTypes > *writer, size_t &curLLFByteDataPos, size_t const &endLLFByteDataPos, char *dataPtr, size_t &curLLFInfoDataPos, size_t const &endLLFInfoDataPos, Config::LowLevelFunctionToken *const tokenPtr, Config::LowLevelFunctionDataSize *const dataSizePtr, size_t &curJacobianPos, size_t const &endJacobianPos, Real const *const rhsJacobians, Identifier const *const rhsIdentifiers, size_t &curStmtPos, size_t const &endStmtPos, Identifier const *const lhsIdentifiers, Config::ArgumentSize const *const numberOfJacobians)
Passes the statement to the writer.
Definition jacobianReuseTape.hpp:241
typename TapeTypes::Identifier Identifier
See TapeTypesInterface.
Definition jacobianReuseTape.hpp:80
friend Base
Allow the base class to call protected and private methods.
Definition jacobianReuseTape.hpp:75
typename TapeTypes::Real Real
See TapeTypesInterface.
Definition jacobianReuseTape.hpp:77
static void internalEvaluateForward_EvalStatements(JacobianReuseTape &tape, AdjointVector &&adjointVector, size_t &curLLFByteDataPos, size_t const &endLLFByteDataPos, char *dataPtr, size_t &curLLFInfoDataPos, size_t const &endLLFInfoDataPos, Config::LowLevelFunctionToken *const tokenPtr, Config::LowLevelFunctionDataSize *const dataSizePtr, size_t &curJacobianPos, size_t const &endJacobianPos, Real const *const rhsJacobians, Identifier const *const rhsIdentifiers, size_t &curStmtPos, size_t const &endStmtPos, Identifier const *const lhsIdentifiers, Config::ArgumentSize const *const numberOfJacobians)
Perform a forward evaluation of the tape. Arguments are from the recursive eval methods of the DataIn...
Definition jacobianReuseTape.hpp:154
void clearCustomAdjoints(Position const &start, Position const &end, AdjointVector &&data)
Clear all adjoint values, that is, set them to zero.
Definition jacobianReuseTape.hpp:125
typename TapeTypes::IndexManager IndexManager
See TapeTypesInterface.
Definition jacobianReuseTape.hpp:79
void pushStmtData(Identifier const &index, Config::ArgumentSize const &numberOfArguments)
Add statement specific data to the data streams.
Definition jacobianReuseTape.hpp:148
void editIdentifiers(Func &&modifyIdentifier, Position const &start, Position const &end)
Modify the identifiers in an already recorded tape.
Definition jacobianReuseTape.hpp:318
typename Base::Position Position
See TapeTypesInterface.
Definition jacobianReuseTape.hpp:81
Type definitions for the Jacobian tapes.
Definition jacobianBaseTape.hpp:78
The interface used by all the tape writers. The tape writers are used to generate text,...
Definition tapeReaderWriterInterface.hpp:128
virtual void writeLowLevelFunction(size_t &curLLFByteDataPos, char *dataPtr, size_t &curLLFInfoDataPos, Config::LowLevelFunctionToken *const tokenPtr, Config::LowLevelFunctionDataSize *const dataSizePtr)
Used for statements that contain a low level function.
Definition tapeReaderWriterInterface.hpp:169
virtual void writeStatement(Identifier const &curLhsIdentifier, size_t &curJacobianPos, Real const *const rhsJacobians, Identifier const *const rhsIdentifiers, Config::ArgumentSize const &nJacobians)
Called for each statement. The method writes the current statement to the file. This overload is used...
Definition tapeReaderWriterInterface.hpp:149