CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
activeArgumentStoreTraits.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 "../../../config.h"
38#include "../../../expressions/lhsExpressionInterface.hpp"
39#include "../../../misc/byteDataView.hpp"
41#include "../../../misc/temporaryMemory.hpp"
42#include "../../../tapes/data/position.hpp"
43#include "../../../tapes/interfaces/fullTapeInterface.hpp"
44#include "../storeAndRestoreActions.hpp"
45
47namespace codi {
48
60 template<typename T_Real, typename T_Identifier, typename T_Gradient>
62 using Real = CODI_DD(T_Real, double);
63 using Identifier = CODI_DD(T_Identifier, int);
64 using Gradient = CODI_DD(T_Gradient, double);
65
66 virtual Real primal() = 0;
67 virtual Identifier identifierIn() = 0;
68 virtual Identifier identifierOut() = 0;
69 virtual Gradient gradientIn() = 0;
70 virtual Gradient gradientOut() = 0;
71
72 virtual Real oldPrimal() = 0;
73 };
74
82 template<typename T_Real, typename T_Identifier, typename T_Gradient>
83 struct ActiveArgumentPointerStore { // Extends ActiveArgumentStoreInterface.
84
85 using Real = CODI_DD(T_Real, double);
86 using Identifier = CODI_DD(T_Identifier, int);
87 using Gradient = CODI_DD(T_Gradient, double);
88
94
96
98
99 // clang-format off
100 Real* primal() { return value_v; }
105
106 Real* oldPrimal() { return oldPrimals; }
107 // clang-format on
108 };
109
115 template<typename T_PointerStore>
116 struct ActiveArgumentValueStore { // Extends ActiveArgumentStoreInterface.
119
120 using Real = typename PointerStore::Real;
121 using Identifier = typename PointerStore::Identifier;
122 using Gradient = typename PointerStore::Gradient;
123
125
126 // clang-format off
127 Real& primal() { return *base.primal(); }
128 Identifier& identifierIn() { return *base.identifierIn(); }
129 Identifier& identifierOut() { return *base.identifierOut(); }
130 Gradient& gradientIn() { return *base.gradientIn(); }
131 Gradient& gradientOut() { return *base.gradientOut(); }
132
133 Real& oldPrimal() { return *base.oldPrimal(); }
134 // clang-format on
135 };
136
203 template<typename T_T, typename = void>
205 using T = CODI_DD(T_T, CODI_DEFAULT_LHS_EXPRESSION);
206
207 using Real = double;
208 using Identifier = int;
209 using Gradient = Real;
210
213
223 CODI_INLINE static size_t countSize(T const& value, size_t size, StoreActions const& actions);
224
231 CODI_INLINE static void restore(ByteDataView* store, TemporaryMemory& allocator, size_t size,
232 RestoreActions const& actions, ArgumentStore& data);
233
244 CODI_INLINE static void store(ByteDataView* dataStore, TemporaryMemory& allocator, T const& value, size_t size,
245 StoreActions const& actions, ArgumentStore& data);
246
248 CODI_INLINE static bool isActive(T const& value, size_t size);
249
255 CODI_INLINE static void setExternalFunctionOutput(bool tapeActive, T& value, size_t size, Identifier& identifier,
256 Real& primal, Real& oldPrimals);
257
260 Identifier& identifier, Real& primal);
261
264 Identifier& identifier, Real& primal);
265
267 CODI_INLINE static void getGradients(VectorAccessInterface<Real, Identifier>* data, size_t size, bool reset,
268 Identifier& identifier, Gradient& gradient, size_t dim);
269
271 CODI_INLINE static void setGradients(VectorAccessInterface<Real, Identifier>* data, size_t size, bool update,
272 Identifier& identifier, Gradient& gradient, size_t dim);
273 };
274
275#ifndef DOXYGEN_DISABLE
276
278 template<typename T_T>
279 struct ActiveArgumentStoreTraits<T_T, typename std::enable_if<!std::is_pointer<T_T>::value>::type> {
280 using T = CODI_DD(T_T, CODI_DEFAULT_LHS_EXPRESSION);
281
282 using PointerTraits = ActiveArgumentStoreTraits<T*>;
283
284 using Real = typename PointerTraits::Real;
285 using Identifier = typename PointerTraits::Identifier;
286 using Gradient = typename PointerTraits::Gradient;
287
288 using ArgumentStore =
290
292 CODI_INLINE static size_t countSize(T const& value, size_t size, StoreActions const& actions) {
293 CODI_UNUSED(size);
294
295 return PointerTraits::countSize(&value, 1, actions);
296 }
297
299 CODI_INLINE static void restore(ByteDataView* store, TemporaryMemory& allocator, size_t size,
300 RestoreActions const& actions, ArgumentStore& data) {
301 CODI_UNUSED(size);
302
303 PointerTraits::restore(store, allocator, 1, actions, data.base);
304 }
305
307 CODI_INLINE static void store(ByteDataView* dataStore, TemporaryMemory& allocator, T const& value, size_t size,
308 StoreActions const& actions, ArgumentStore& data) {
309 CODI_UNUSED(size);
310
311 PointerTraits::store(dataStore, allocator, value, 1, actions, data.base);
312 }
313
315 CODI_INLINE static bool isActive(T const& value, size_t size) {
316 CODI_UNUSED(size);
317
318 return PointerTraits::isActive(&value, 1);
319 }
320
322 CODI_INLINE static void setExternalFunctionOutput(bool tapeActive, T& value, size_t size, Identifier& identifier,
323 Real& primal, Real& oldPrimals) {
324 CODI_UNUSED(size);
325
326 PointerTraits::setExternalFunctionOutput(tapeActive, &value, 1, &identifier, &primal, &oldPrimals);
327 }
328
330 CODI_INLINE static void getPrimalsFromVector(VectorAccessInterface<Real, Identifier>* data, size_t size,
331 Identifier& identifier, Real& primal) {
332 CODI_UNUSED(size);
333
334 PointerTraits::getPrimalsFromVector(data, 1, &identifier, &primal);
335 }
336
338 CODI_INLINE static void setPrimalsIntoVector(VectorAccessInterface<Real, Identifier>* data, size_t size,
339 Identifier& identifier, Real& primal) {
340 CODI_UNUSED(size);
341
342 PointerTraits::setPrimalsIntoVector(data, 1, &identifier, &primal);
343 }
344
346 CODI_INLINE static void getGradients(VectorAccessInterface<Real, Identifier>* data, size_t size, bool reset,
347 Identifier& identifier, Gradient& gradient, size_t dim) {
348 CODI_UNUSED(size);
349
350 PointerTraits::getGradients(data, 1, reset & identifier, &gradient, dim);
351 }
352
354 CODI_INLINE static void setGradients(VectorAccessInterface<Real, Identifier>* data, size_t size, bool update,
355 Identifier& identifier, Gradient& gradient, size_t dim) {
356 CODI_UNUSED(size);
357
358 PointerTraits::setGradients(data, 1, update, &identifier, &gradient, dim);
359 }
360 };
361
363 template<typename T_T>
364 struct ActiveArgumentStoreTraits<T_T*, ExpressionTraits::EnableIfLhsExpression<T_T>> {
365 using T = CODI_DD(T_T, CODI_DEFAULT_LHS_EXPRESSION);
366
367 using Tape = typename T::Tape;
368
369 using Real = typename T::Real;
370 using Identifier = typename T::Identifier;
371 using Gradient = Real;
373
374 using ArgumentStore = ActiveArgumentPointerStore<Real, Identifier, Gradient>;
375
377 CODI_INLINE static size_t countSize(T const* value, size_t size, StoreActions const& actions) {
378 CODI_UNUSED(value);
379
380 size_t dataSize = 0;
381 if (actions.test(StoreAction::InputIdentifierCreateAndStore)) {
382 dataSize += size * sizeof(typename T::Identifier); // var_i_in
383 }
384 if (actions.test(StoreAction::PrimalCreateOnTape)) {
385 if (Tape::HasPrimalValues) {
386 // Primal value tapes only store the passive primal values.
387 int passiveIdentifiers = countPassive(value, size);
388 dataSize += sizeof(int); // Number of passive identifiers
389 dataSize += passiveIdentifiers * sizeof(typename T::Real);
390 } else {
391 // Jacobian tape stores full primal values.
392 dataSize += size * sizeof(typename T::Real); // var_v_in
393 }
394 }
395 if (actions.test(StoreAction::OutputIdentifierCreate)) {
396 dataSize += size * sizeof(typename T::Identifier); // var_i_out
397
398 if (Tape::HasPrimalValues && Tape::HasPrimalValues && !Tape::LinearIndexHandling) {
399 dataSize += size * sizeof(Real); // Primal value tapes need to store the old values.
400 }
401 }
402
403 return dataSize;
404 }
405
407 CODI_INLINE static void restore(ByteDataView* store, TemporaryMemory& allocator, size_t size,
408 RestoreActions const& actions, ArgumentStore& data) {
409 Real* passiveValues = nullptr;
410
411 if (Tape::HasPrimalValues && actions.test(RestoreAction::PrimalRestore)) {
412 data.passiveValuesCount = store->template read<int>();
413 }
414
415 if (actions.test(RestoreAction::PrimalRestore)) {
416 restoreValue(store, allocator, size, data, passiveValues);
417 }
418 if (actions.test(RestoreAction::InputIdentifierRestore)) {
419 data.value_i_in = store->template read<Identifier>(size);
420 }
421 if (actions.test(RestoreAction::OutputIdentifierRestore)) {
422 data.value_i_out = store->template read<Identifier>(size);
423 if (Tape::HasPrimalValues && !Tape::LinearIndexHandling) {
424 data.oldPrimals = store->template read<Real>(size);
425 }
426 }
427
428 if (actions.test(RestoreAction::PrimalRestore)) {
429 restorePassiveValues(size, data, passiveValues);
430 }
431
432 if (actions.test(RestoreAction::PrimalCreate)) {
433 data.value_v = allocator.template alloc<Real>(size);
434 }
435
436 if (actions.test(RestoreAction::InputGradientCreate)) {
437 data.value_deriv_in = allocator.template alloc<Gradient>(size);
438 }
439 if (actions.test(RestoreAction::OutputGradientCreate)) {
440 data.value_deriv_out = allocator.template alloc<Gradient>(size);
441 }
442 }
443
445 CODI_INLINE static void restoreValue(ByteDataView* store, TemporaryMemory& allocator, size_t size,
446 ArgumentStore& data, Real*& passiveValues) {
447 if (Tape::HasPrimalValues) {
448 // Primal value tapes restore from the tape.
449 passiveValues = store->template read<Real>(data.passiveValuesCount);
450 if ((size_t)data.passiveValuesCount == size) {
451 data.value_v = passiveValues; // Use the full vector.
452 } else {
453 // Put the passive primal values at the positions where the identifiers are passive.
454 data.value_v = allocator.template alloc<Real>(size);
455
456 // Wait with the restore until the ids are also read. See restorePassiveValues().
457 }
458 } else {
459 // Jacobian tapes read the full vector.
460 data.value_v = store->template read<Real>(size);
461 }
462 }
463
465 CODI_INLINE static void restorePassiveValues(size_t size, ArgumentStore& data, Real* passiveValues) {
466 typename T::Tape& tape = T::getTape();
467
468 if (Tape::HasPrimalValues && (size_t)data.passiveValuesCount != size) {
469 // Only restore if we did not use the full vector.
470 int passivePos = 0;
471 for (size_t i = 0; i < size; i += 1) {
472 if (!tape.isIdentifierActive(data.value_i_in[i])) {
473 data.value_v[i] = passiveValues[passivePos];
474 passivePos += 1;
475 }
476 }
477 }
478 }
479
481 CODI_INLINE static void store(ByteDataView* dataStore, TemporaryMemory& allocator, T const* value, size_t size,
482 StoreActions const& actions, ArgumentStore& data) {
483 if (dataStore == nullptr) {
484 codiAssert(!actions.test(StoreAction::PrimalCreateOnTape) &&
485 !actions.test(StoreAction::InputIdentifierCreateAndStore) &&
486 !actions.test(StoreAction::OutputIdentifierCreate));
487 }
488
489 Real* passiveValues = nullptr;
490 if (actions.test(StoreAction::PrimalCreateOnTape)) {
491 if (Tape::HasPrimalValues) {
492 int passiveIdentifiers = countPassive(value, size);
493 dataStore->write(passiveIdentifiers);
494 passiveValues = dataStore->template reserve<Real>(passiveIdentifiers);
495 data.value_v = allocator.template alloc<Real>(size);
496 } else {
497 // Jacobian tape stores full primal values.
498 data.value_v = dataStore->template reserve<Real>(size);
499 }
500
501 } else {
502 data.value_v = allocator.template alloc<Real>(size);
503 }
504
505 if (actions.test(StoreAction::PrimalExtract)) {
506 typename T::Tape& tape = T::getTape();
507 int passiveValuesPos = 0;
508
509 for (size_t i = 0; i < size; i += 1) {
510 (data.value_v)[i] = value[i].getValue();
511
512 if (actions.test(StoreAction::PrimalCreateOnTape) && Tape::HasPrimalValues &&
513 !tape.isIdentifierActive(value[i].getIdentifier())) {
514 passiveValues[passiveValuesPos] = value[i].getValue();
515 passiveValuesPos += 1;
516 }
517 }
518 }
519
520 if (actions.test(StoreAction::InputIdentifierCreateAndStore)) {
521 data.value_i_in = dataStore->template reserve<Identifier>(size);
522 for (size_t i = 0; i < size; i += 1) {
523 data.value_i_in[i] = value[i].getIdentifier();
524 }
525 }
526
527 if (actions.test(StoreAction::OutputIdentifierCreate)) {
528 data.value_i_out = dataStore->template reserve<Identifier>(size);
529 for (size_t i = 0; i < size; i += 1) {
530 data.value_i_out[i] = -1;
531 }
532
533 if (Tape::HasPrimalValues && !Tape::LinearIndexHandling) {
534 data.oldPrimals = dataStore->template reserve<Real>(size);
535 }
536 }
537 }
538
540 CODI_INLINE static bool isActive(T const* value, size_t size) {
541 typename T::Tape& tape = T::getTape();
542 bool active = false;
543 for (size_t i = 0; i < size && !active; i += 1) {
544 active |= tape.isIdentifierActive(value[i].getIdentifier());
545 }
546 return active;
547 }
548
550 CODI_INLINE static void setExternalFunctionOutput(bool tapeActive, T* value, size_t size, Identifier* identifier,
551 Real* primal, Real* oldPrimals) {
552 typename T::Tape& tape = T::getTape();
553 for (size_t i = 0; i < size; i += 1) {
554 value[i].setValue(primal[i]);
555
556 if (tapeActive && 0 != identifier[i]) {
557 Real oldValue = tape.registerExternalFunctionOutput(value[i]);
558 identifier[i] = value[i].getIdentifier();
559
560 if (Tape::HasPrimalValues && !Tape::LinearIndexHandling) {
561 oldPrimals[i] = oldValue;
562 }
563 }
564 }
565 }
566
568 CODI_INLINE static void getPrimalsFromVector(VectorAccessInterface<Real, Identifier>* data, size_t size,
569 Identifier* identifier, Real* primal) {
570 typename T::Tape& tape = T::getTape();
571
572 for (size_t i = 0; i < size; i += 1) {
573 if (tape.isIdentifierActive(identifier[i])) {
574 primal[i] = data->getPrimal(identifier[i]);
575 }
576 }
577 }
578
580 CODI_INLINE static void setPrimalsIntoVector(VectorAccessInterface<Real, Identifier>* data, size_t size,
581 Identifier* identifier, Real* primal) {
582 typename T::Tape& tape = T::getTape();
583
584 for (size_t i = 0; i < size; i += 1) {
585 if (tape.isIdentifierActive(identifier[i])) {
586 data->setPrimal(identifier[i], primal[i]);
587 }
588 }
589 }
590
592 CODI_INLINE static void getGradients(VectorAccessInterface<Real, Identifier>* data, size_t size, bool reset,
593 Identifier* identifier, Gradient* gradient, size_t dim) {
594 for (size_t i = 0; i < size; i += 1) {
595 gradient[i] = data->getAdjoint(identifier[i], dim);
596 if (reset) {
597 data->resetAdjoint(identifier[i], dim);
598 }
599 }
600 }
601
603 CODI_INLINE static void setGradients(VectorAccessInterface<Real, Identifier>* data, size_t size, bool update,
604 Identifier* identifier, Real* gradient, size_t dim) {
605 for (size_t i = 0; i < size; i += 1) {
606 if (!update) {
607 data->resetAdjoint(identifier[i], dim);
608 }
609 data->updateAdjoint(identifier[i], dim, gradient[i]);
610 }
611 }
612
613 private:
614 CODI_INLINE static int countPassive(T const* value, size_t size) {
615 typename T::Tape& tape = T::getTape();
616
617 int count = 0;
618 for (size_t i = 0; i < size; i += 1) {
619 if (!tape.isIdentifierActive(value[i].getIdentifier())) {
620 count += 1;
621 }
622 }
623
624 return count;
625 }
626 };
627#endif
628}
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define codiAssert(x)
See codi::Config::EnableAssert.
Definition config.h:432
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
#define CODI_T(...)
Abbreviation for CODI_TEMPLATE.
Definition macros.hpp:111
DataExtraction< Type >::Identifier getIdentifier(Type const &v)
Extract the identifiers from a type of aggregated active types.
Definition realTraits.hpp:216
DataExtraction< Type >::Real getValue(Type const &v)
Extract the primal values from a type of aggregated active types.
Definition realTraits.hpp:210
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
void CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:46
EnumBitset< StoreAction > StoreActions
Action set for a variable during a store. See Store actions for a detailed description.
Definition storeAndRestoreActions.hpp:71
EnumBitset< RestoreAction > RestoreActions
Action set for a variable during a store. See Restore actions for a detailed description.
Definition storeAndRestoreActions.hpp:56
Declares all variables that may be needed to store/restore an active argument which has a pointer typ...
Definition activeArgumentStoreTraits.hpp:83
Real * primal()
Get the primal values.
Definition activeArgumentStoreTraits.hpp:100
Identifier * identifierIn()
Get the input identifiers.
Definition activeArgumentStoreTraits.hpp:101
T_Real Real
See ActiveArgumentPointerStore.
Definition activeArgumentStoreTraits.hpp:85
Gradient * value_deriv_out
Gradient vector of an output argument.
Definition activeArgumentStoreTraits.hpp:93
Gradient * value_deriv_in
Gradient vector of an input argument.
Definition activeArgumentStoreTraits.hpp:92
T_Identifier Identifier
See ActiveArgumentPointerStore.
Definition activeArgumentStoreTraits.hpp:86
Identifier * value_i_out
Identifier vector of an output argument.
Definition activeArgumentStoreTraits.hpp:91
Gradient * gradientIn()
Get the input gradients.
Definition activeArgumentStoreTraits.hpp:103
int passiveValuesCount
Number of passive values.
Definition activeArgumentStoreTraits.hpp:97
Identifier * value_i_in
Identifier vector of an input argument.
Definition activeArgumentStoreTraits.hpp:90
Identifier * identifierOut()
Get the output identifiers.
Definition activeArgumentStoreTraits.hpp:102
T_Gradient Gradient
See ActiveArgumentPointerStore.
Definition activeArgumentStoreTraits.hpp:87
Real * value_v
Primal value vector.
Definition activeArgumentStoreTraits.hpp:89
Real * oldPrimal()
Get old primal values.
Definition activeArgumentStoreTraits.hpp:106
Real * oldPrimals
Old primal values in primal value tape setting.
Definition activeArgumentStoreTraits.hpp:95
Gradient * gradientOut()
Get the output gradients.
Definition activeArgumentStoreTraits.hpp:104
Interface for restored data for an argument. The functions should return a compatible type that can b...
Definition activeArgumentStoreTraits.hpp:61
virtual Real primal()=0
Get the primal values.
virtual Identifier identifierOut()=0
Get the output identifiers.
T_Identifier Identifier
See ActiveArgumentStoreInterface.
Definition activeArgumentStoreTraits.hpp:63
virtual Gradient gradientOut()=0
Get the output gradients.
T_Gradient Gradient
See ActiveArgumentStoreInterface.
Definition activeArgumentStoreTraits.hpp:64
virtual Gradient gradientIn()=0
Get the input gradients.
virtual Identifier identifierIn()=0
Get the input identifiers.
T_Real Real
See ActiveArgumentStoreInterface.
Definition activeArgumentStoreTraits.hpp:62
virtual Real oldPrimal()=0
Get old primal values.
Traits for storing active arguments in byte streams.
Definition activeArgumentStoreTraits.hpp:204
static void store(ByteDataView *dataStore, TemporaryMemory &allocator, T const &value, size_t size, StoreActions const &actions, ArgumentStore &data)
Store all data for this type.
double Real
The type with no CoDiPack values.
Definition activeArgumentStoreTraits.hpp:207
static void getGradients(VectorAccessInterface< Real, Identifier > *data, size_t size, bool reset, Identifier &identifier, Gradient &gradient, size_t dim)
Get the gradients from data and store them in gradient.
ActiveArgumentStoreInterface< Real, Identifier, Gradient > ArgumentStore
Data for holding all necessary values.
Definition activeArgumentStoreTraits.hpp:212
static bool isActive(T const &value, size_t size)
Should return true when one element in the type is active.
int Identifier
The type for holding the identifiers.
Definition activeArgumentStoreTraits.hpp:208
T_T T
See ActiveArgumentStoreTraits.
Definition activeArgumentStoreTraits.hpp:205
static void restore(ByteDataView *store, TemporaryMemory &allocator, size_t size, RestoreActions const &actions, ArgumentStore &data)
Restore the data for this type.
static void setPrimalsIntoVector(VectorAccessInterface< Real, Identifier > *data, size_t size, Identifier &identifier, Real &primal)
Extract the primal values from primal and store them in data.
static void setGradients(VectorAccessInterface< Real, Identifier > *data, size_t size, bool update, Identifier &identifier, Gradient &gradient, size_t dim)
Extract the gradients from gradient and store them in data.
static size_t countSize(T const &value, size_t size, StoreActions const &actions)
Counts the binary size for the data stream.
Real Gradient
The type that can represent the gradient values.
Definition activeArgumentStoreTraits.hpp:209
static void setExternalFunctionOutput(bool tapeActive, T &value, size_t size, Identifier &identifier, Real &primal, Real &oldPrimals)
static void getPrimalsFromVector(VectorAccessInterface< Real, Identifier > *data, size_t size, Identifier &identifier, Real &primal)
Get the primal values from data and store them in primal.
Declares all variables that may be needed to store/restore an active argument which has a value type.
Definition activeArgumentStoreTraits.hpp:116
typename PointerStore::Identifier Identifier
See ActiveArgumentPointerStore.
Definition activeArgumentStoreTraits.hpp:121
Identifier & identifierIn()
Get the input identifiers.
Definition activeArgumentStoreTraits.hpp:128
PointerStore base
Declaration of base.
Definition activeArgumentStoreTraits.hpp:124
typename PointerStore::Real Real
See ActiveArgumentPointerStore.
Definition activeArgumentStoreTraits.hpp:120
T_PointerStore PointerStore
See ActiveArgumentValueStore.
Definition activeArgumentStoreTraits.hpp:118
Gradient & gradientOut()
Get the output gradients.
Definition activeArgumentStoreTraits.hpp:131
Real & primal()
Get the primal values.
Definition activeArgumentStoreTraits.hpp:127
Identifier & identifierOut()
Get the output identifiers.
Definition activeArgumentStoreTraits.hpp:129
Real & oldPrimal()
Get old primal values.
Definition activeArgumentStoreTraits.hpp:133
Gradient & gradientIn()
Get the input gradients.
Definition activeArgumentStoreTraits.hpp:130
typename PointerStore::Gradient Gradient
See ActiveArgumentPointerStore.
Definition activeArgumentStoreTraits.hpp:122
Identifier & getIdentifier()
Definition activeTypeBase.hpp:156
Represents a concrete lvalue in the CoDiPack expression tree.
Definition activeType.hpp:52
Definition byteDataView.hpp:51
A bitset with enum items as flags.
Definition enumBitset.hpp:64
Real const & getValue() const
Get the primal value of this lvalue.
Definition lhsExpressionInterface.hpp:125
Allocator for temporary used memory.
Definition temporaryMemory.hpp:54
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:91