CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
dataManagementTapeInterface.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 <set>
38
39#include "../../config.h"
40#include "../../traits/realTraits.hpp"
41#include "../misc/tapeParameters.hpp"
42#include "../misc/vectorAccessInterface.hpp"
43
45namespace codi {
46
108 template<typename T_Real, typename T_Identifier>
110 public:
111
112 using Real = CODI_DD(T_Real, double);
113 using Identifier = CODI_DD(T_Identifier, int);
114
115 /*******************************************************************************/
117
118 void writeToFile(std::string const& filename) const;
119 void readFromFile(std::string const& filename);
120 void deleteData();
121
122 /*******************************************************************************/
124
125 std::set<TapeParameters> const& getAvailableParameters() const;
126 size_t getParameter(TapeParameters parameter) const;
127 bool hasParameter(TapeParameters parameter) const;
128 void setParameter(TapeParameters parameter, size_t value);
129
130 /*******************************************************************************/
132
134
136 template<typename Adjoint>
138
140
141 /*******************************************************************************/
143
148
149 /*******************************************************************************/
151
153
160 void resetHard();
161 };
162}
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
TapeParameters
Configuration options for a tape.
Definition tapeParameters.hpp:52
Provides file IO, information about internal tape vectors and allows to clear tape data.
Definition dataManagementTapeInterface.hpp:109
void setParameter(TapeParameters parameter, size_t value)
See Parameters functions.
T_Real Real
See DataManagementTapeInterface.
Definition dataManagementTapeInterface.hpp:112
void beginUseAdjointVector()
Declare that the adjoint vector is being used. See Adjoint vector management.
size_t getParameter(TapeParameters parameter) const
See Parameters functions.
void readFromFile(std::string const &filename)
See File IO functions.
bool hasParameter(TapeParameters parameter) const
See Parameters functions.
void resizeAdjointVector()
Explicitly trigger resizing of the adjoint vector. See Adjoint vector management.
void deleteVectorAccess(VectorAccessInterface< Real, Identifier > *access)
See Adjoint vector access.
VectorAccessInterface< Real, Identifier > * createVectorAccess()
See Adjoint vector access.
void writeToFile(std::string const &filename) const
See File IO functions.
void deleteData()
See File IO functions.
T_Identifier Identifier
See DataManagementTapeInterface.
Definition dataManagementTapeInterface.hpp:113
VectorAccessInterface< Real, Identifier > * createVectorAccessCustomAdjoints(Adjoint *data)
See Adjoint vector access.
void endUseAdjointVector()
Declare that the adjoint vector is no longer used. See Adjoint vector management.
void swap(DataManagementTapeInterface &other)
Swap all data with an other tape.
std::set< TapeParameters > const & getAvailableParameters() const
See Parameters functions.
void resetHard()
Delete everything and return to the state after construction, as far as possible.
void deleteAdjointVector()
Delete the adjoint vector. See Adjoint vector management.
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:91