CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
fullTapeInterface.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://www.scicomp.uni-kl.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://www.scicomp.uni-kl.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 "../../misc/macros.hpp"
39#include "customAdjointVectorEvaluationTapeInterface.hpp"
40#include "dataManagementTapeInterface.hpp"
41#include "externalFunctionTapeInterface.hpp"
42#include "forwardEvaluationTapeInterface.hpp"
43#include "gradientAccessTapeInterface.hpp"
44#include "identifierInformationTapeInterface.hpp"
45#include "internalStatementRecordingTapeInterface.hpp"
46#include "lowLevelFunctionTapeInterface.hpp"
47#include "manualStatementPushTapeInterface.hpp"
48#include "positionalEvaluationTapeInterface.hpp"
49#include "preaccumulationEvaluationTapeInterface.hpp"
50#include "primalEvaluationTapeInterface.hpp"
51#include "reverseTapeInterface.hpp"
52
54namespace codi {
55
68 template<typename T_Real, typename T_Gradient, typename T_Identifier, typename T_Position>
70 : public virtual CustomAdjointVectorEvaluationTapeInterface<T_Position>,
71 public virtual DataManagementTapeInterface<T_Real, T_Identifier>,
72 public virtual ExternalFunctionTapeInterface<T_Real, T_Gradient, T_Identifier>,
73 public virtual ForwardEvaluationTapeInterface<T_Position>,
74 public virtual GradientAccessTapeInterface<T_Gradient, T_Identifier>,
75 public virtual IdentifierInformationTapeInterface<T_Real, T_Gradient, T_Identifier>,
76 public virtual InternalStatementRecordingTapeInterface<T_Identifier>,
77 public virtual LowLevelFunctionTapeInterface<T_Real, T_Gradient, T_Identifier>,
78 public virtual ManualStatementPushTapeInterface<T_Real, T_Gradient, T_Identifier>,
79 public virtual PositionalEvaluationTapeInterface<T_Position>,
80 public virtual PreaccumulationEvaluationTapeInterface<T_Real, T_Gradient, T_Identifier, T_Position>,
81 public virtual PrimalEvaluationTapeInterface<T_Real, T_Identifier, T_Position>,
82 public virtual ReverseTapeInterface<T_Real, T_Gradient, T_Identifier> {
83 public:
84
85 using Real = CODI_DD(T_Real, double);
86 using Gradient = CODI_DD(T_Gradient, double);
87 using Identifier = CODI_DD(T_Identifier, int);
88 using Position = CODI_DD(T_Position, EmptyPosition);
89
90#if CODI_IDE
91 using TapeTypes = CODI_ANY;
92#endif
93
95 using ReverseTapeInterface<T_Real, T_Gradient, T_Identifier>::clearAdjoints;
96
98 using ReverseTapeInterface<T_Real, T_Gradient, T_Identifier>::evaluate;
100
103 };
104}
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition: macros.hpp:94
#define CODI_ANY
Used in default declarations of expression templates.
Definition: macros.hpp:98
CoDiPack - Code Differentiation Package.
Definition: codi.hpp:90
Allows user defined vectors for the forward and adjoint evaluation.
Definition: customAdjointVectorEvaluationTapeInterface.hpp:65
void evaluate(Position const &start, Position const &end, Adjoint *data)
Perform a reverse evaluation for a part of the tape. It hast to hold start >= end.
void evaluateForward(Position const &start, Position const &end, Adjoint *data)
Perform a forward evaluation of a part of the tape. It has to hold start <= end.
Provides file IO, information about internal tape vectors and allows to clear tape data.
Definition: dataManagementTapeInterface.hpp:109
Empty Position with no nested data.
Definition: position.hpp:47
Add user defined functions to the tape evaluation.
Definition: externalFunctionTapeInterface.hpp:76
Forward AD evaluation of a recorded tape.
Definition: forwardEvaluationTapeInterface.hpp:57
Full tape interface that supports all features of CoDiPack.
Definition: fullTapeInterface.hpp:82
T_Gradient Gradient
See FullTapeInterface.
Definition: fullTapeInterface.hpp:86
T_Position Position
See FullTapeInterface.
Definition: fullTapeInterface.hpp:88
T_Real Real
See FullTapeInterface.
Definition: fullTapeInterface.hpp:85
T_Identifier Identifier
See FullTapeInterface.
Definition: fullTapeInterface.hpp:87
Allow for a direct access to the gradient information computed by the tape.
Definition: gradientAccessTapeInterface.hpp:67
General information about the identifiers and checks if variables are active.
Definition: identifierInformationTapeInterface.hpp:63
Internal tape interface that is used by active types to trigger the storing of an expression.
Definition: internalStatementRecordingTapeInterface.hpp:65
Add functions with custom derivatives to the tape. Can, e.g, be used to optimize small recurring func...
Definition: lowLevelFunctionTapeInterface.hpp:68
Add derivative information for custom operations to the tape.
Definition: manualStatementPushTapeInterface.hpp:73
Reverse AD evaluation for parts of a recorded tape.
Definition: positionalEvaluationTapeInterface.hpp:59
Perform tape evaluations but ensure that the state prior to evaluation equals the state after evaluat...
Definition: preaccumulationEvaluationTapeInterface.hpp:69
Perform a primal reevaluation of the tape.
Definition: primalEvaluationTapeInterface.hpp:70
Minimum tape interface for a working reverse tape implementation.
Definition: reverseTapeInterface.hpp:78
void clearAdjoints(AdjointsManagement adjointsManagement=AdjointsManagement::Automatic)
Clear all adjoint values, that is, set them to zero.