37#include "../interfaces/fullTapeInterface.hpp"
38#include "../misc/adjointVectorAccess.hpp"
39#include "tagTapeBase.hpp"
54 template<
typename T_Real,
typename T_Tag>
56 public TagTapeBase<T_Real, T_Tag, T_Real, TagTapeReverse<T_Real, T_Tag>> {
84 std::set<TapeParameters> parameters;
102 template<
typename Adjo
int>
108 template<
typename Adjo
int>
161 template<
typename Adjo
int>
174 std::swap(active, other.active);
175 std::swap(parameters, other.parameters);
191 template<
typename Lhs>
275 template<
typename Lhs>
392 template<
typename Lhs>
399 template<
typename Lhs>
430 void reset(
bool resetAdjoints =
true) {
435 template<
typename Stream = std::ostream>
441 template<
typename Stream = std::ostream>
447 template<
typename Stream = std::ostream>
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:97
uint8_t ArgumentSize
Type for the number of arguments in statements.
Definition config.h:117
typename TraitsImplementation< Type >::PassiveReal PassiveReal
The original computation type that was used in the application.
Definition realTraits.hpp:123
CoDiPack - Code Differentiation Package.
Definition codi.hpp:97
TapeParameters
Configuration options for a tape.
Definition tapeParameters.hpp:52
inlinevoid CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:55
AdjointsManagement
Policies for management of the tape's interal adjoints.
Definition tapeParameters.hpp:100
@ Automatic
Manage internal adjoints automatically, including locking, bounds checking, and resizing.
Definition tapeParameters.hpp:102
Empty Position with no nested data.
Definition position.hpp:47
User-defined evaluation functions for the taping process.
Definition externalFunction.hpp:118
Full tape interface that supports all features of CoDiPack.
Definition fullTapeInterface.hpp:89
static Index constexpr InactiveIndex
Default inactive index for all index managers.
Definition indexManagerInterface.hpp:87
static Index constexpr InvalidIndex
Default invalid index for all index mangers (max value for unsigned types).
Definition indexManagerInterface.hpp:88
Base class for all CoDiPack lvalue expression.
Definition lhsExpressionInterface.hpp:63
TapeData const & getTapeData() const
Get the data of the tape stored in this lhs expression.
inlineImpl & cast()
Cast to the implementation.
Definition lhsExpressionInterface.hpp:103
Data for a tag.
Definition tagData.hpp:56
Tag tag
Current tag of the value.
Definition tagData.hpp:61
inlinevoid setTag(Tag &tag) const
Definition tagTapeBase.hpp:452
static bool constexpr AllowJacobianOptimization
Definition tagTapeBase.hpp:169
void destroyTapeData(Real &value, ActiveTypeTapeData &data)
Definition tagTapeBase.hpp:180
inlinevoid checkLhsError(Real &lhsValue, ActiveTypeTapeData &lhsData, const Real &rhs) const
Definition tagTapeBase.hpp:410
inlineIdentifier const & getIdentifier(ActiveTypeTapeData const &data)
Definition tagTapeBase.hpp:150
TagTapeBase()
Definition tagTapeBase.hpp:112
static Tag constexpr PassiveTag
Definition tagTapeBase.hpp:89
void initTapeData(Real &value, ActiveTypeTapeData &data)
Definition tagTapeBase.hpp:173
inlinevoid verifyRegisterValue(LhsExpressionInterface< Real, Gradient, Impl, Lhs > &value, ActiveTypeTapeData const &tag)
Definition tagTapeBase.hpp:440
void swap(Impl &other)
Definition tagTapeBase.hpp:135
Required definition for event system.
Definition tagTapeReverse.hpp:63
int Index
Required definition for event system.
Definition tagTapeReverse.hpp:65
Required definition for event system.
Definition tagTapeReverse.hpp:61
TagTapeReverse()
Constructor.
Definition tagTapeReverse.hpp:89
void resetHard()
Do nothing.
Definition tagTapeReverse.hpp:178
void deleteAdjointVector()
Do nothing.
Definition tagTapeReverse.hpp:180
void clearAdjoints(Position const &start, Position const &end)
Do nothing.
Definition tagTapeReverse.hpp:309
bool hasParameter(TapeParameters parameter) const
Do nothing.
Definition tagTapeReverse.hpp:144
void evaluate()
Do nothing.
Definition tagTapeReverse.hpp:424
Real const & primal(Identifier const &identifier) const
Do nothing.
Definition tagTapeReverse.hpp:376
void deleteVectorAccess(VectorAccessInterface< Real, Identifier > *access)
Do nothing.
Definition tagTapeReverse.hpp:168
void printTableRow(Stream &out=std::cout) const
Do nothing.
Definition tagTapeReverse.hpp:448
void resizeAdjointVector()
Do nothing.
Definition tagTapeReverse.hpp:181
void deleteData()
Do nothing.
Definition tagTapeReverse.hpp:129
void setPassive()
Set tape to passive.
Definition tagTapeReverse.hpp:410
Identifier getInvalidIndex() const
-1 id.
Definition tagTapeReverse.hpp:265
void evaluateForward(Position const &start, Position const &end, Adjoint *data)
Do nothing.
Definition tagTapeReverse.hpp:109
Real & primal(Identifier const &identifier)
Do nothing.
Definition tagTapeReverse.hpp:370
TapeValues getTapeValues() const
Do nothing.
Definition tagTapeReverse.hpp:453
void setParameter(TapeParameters parameter, size_t value)
Do nothing.
Definition tagTapeReverse.hpp:151
TagData< Tag > ActiveTypeTapeData
See TapeTypesInterface.
Definition tagTapeReverse.hpp:71
int Identifier
See TapeTypesInterface.
Definition tagTapeReverse.hpp:70
Gradient const & getGradient(Identifier const &identifier, AdjointsManagement adjointsManagement=AdjointsManagement::Automatic) const
Verify tag.
Definition tagTapeReverse.hpp:228
VectorAccessInterface< Real, Identifier > * createVectorAccessCustomAdjoints(Adjoint *data)
Do nothing.
Definition tagTapeReverse.hpp:162
bool isActive() const
Check if tape is active.
Definition tagTapeReverse.hpp:415
Gradient & gradient(Identifier const &identifier, AdjointsManagement adjointsManagement=AdjointsManagement::Automatic)
Verify tag.
Definition tagTapeReverse.hpp:236
void setActive()
Set tape to active.
Definition tagTapeReverse.hpp:405
void endUseAdjointVector()
Do nothing.
Definition tagTapeReverse.hpp:183
Position getPosition() const
Do nothing.
Definition tagTapeReverse.hpp:314
void clearAdjoints()
Do nothing.
Definition tagTapeReverse.hpp:427
void pushJacobiManual(Real const &jacobian, Real const &value, ActiveTypeTapeData const &index)
Do nothing.
Definition tagTapeReverse.hpp:286
size_t getParameter(TapeParameters parameter) const
Do nothing.
Definition tagTapeReverse.hpp:137
Identifier getPassiveIndex() const
Zero id.
Definition tagTapeReverse.hpp:260
static bool constexpr LinearIndexHandling
Behave as linear index handler.
Definition tagTapeReverse.hpp:257
void revertPrimals(Position const &pos)
Do nothing.
Definition tagTapeReverse.hpp:382
void pushExternalFunction(ExternalFunction< TagTapeReverse > const &extFunc)
Do nothing.
Definition tagTapeReverse.hpp:199
void evaluatePrimal()
Do nothing.
Definition tagTapeReverse.hpp:356
T_Real Real
See TagTapeReverse.
Definition tagTapeReverse.hpp:57
void registerOutput(LhsExpressionInterface< Real, Gradient, TagTapeReverse, Lhs > &value)
Verify tag.
Definition tagTapeReverse.hpp:400
void setPrimal(Identifier const &identifier, Real const &gradient)
Do nothing.
Definition tagTapeReverse.hpp:359
static bool constexpr HasPrimalValues
No primal values.
Definition tagTapeReverse.hpp:347
Real registerExternalFunctionOutput(LhsExpressionInterface< Real, Gradient, TagTapeReverse, Lhs > &value)
Verifies tag properties.
Definition tagTapeReverse.hpp:192
void evaluateForward()
Do nothing.
Definition tagTapeReverse.hpp:214
void reset(bool resetAdjoints=true)
Do nothing.
Definition tagTapeReverse.hpp:430
Real const & getPrimal(Identifier const &identifier) const
Do nothing.
Definition tagTapeReverse.hpp:364
Position getZeroPosition() const
Do nothing.
Definition tagTapeReverse.hpp:319
void beginUseAdjointVector()
Do nothing.
Definition tagTapeReverse.hpp:182
void storeManual(Real const &lhsValue, ActiveTypeTapeData &lhsIndex, Config::ArgumentSize const &size)
Set tag on lhs.
Definition tagTapeReverse.hpp:291
void swap(TagTapeReverse &other)
Swap members.
Definition tagTapeReverse.hpp:173
std::set< TapeParameters > const & getAvailableParameters() const
Empty set.
Definition tagTapeReverse.hpp:132
void evaluateKeepState(Position const &start, Position const &end)
Do nothing.
Definition tagTapeReverse.hpp:334
Gradient const & gradient(Identifier const &identifier, AdjointsManagement adjointsManagement=AdjointsManagement::Automatic) const
Verify tag.
Definition tagTapeReverse.hpp:244
void evaluate(Position const &start, Position const &end, Adjoint *data)
Do nothing.
Definition tagTapeReverse.hpp:103
void writeToFile(std::string const &filename) const
Do nothing.
Definition tagTapeReverse.hpp:119
void evaluate(Position const &start, Position const &end)
Do nothing.
Definition tagTapeReverse.hpp:304
T_Tag Tag
See TagTapeReverse.
Definition tagTapeReverse.hpp:58
RealTraits::PassiveReal< Real > PassiveReal
Basic computation type.
Definition tagTapeReverse.hpp:74
void setGradient(Identifier const &identifier, Gradient const &gradient, AdjointsManagement adjointsManagement=AdjointsManagement::Automatic)
Verify tag.
Definition tagTapeReverse.hpp:222
void deactivateValue(LhsExpressionInterface< Real, Gradient, TagTapeReverse, Lhs > &value)
Set tag to passive.
Definition tagTapeReverse.hpp:276
void evaluateForward(Position const &start, Position const &end)
Do nothing.
Definition tagTapeReverse.hpp:209
VectorAccessInterface< Real, Identifier > * createVectorAccess()
Do nothing.
Definition tagTapeReverse.hpp:156
void resetTo(Position const &pos, bool resetAdjoints=true)
Do nothing.
Definition tagTapeReverse.hpp:324
void evaluateForwardKeepState(Position const &start, Position const &end)
Do nothing.
Definition tagTapeReverse.hpp:338
void evaluatePrimal(Position const &start, Position const &end)
Do nothing.
Definition tagTapeReverse.hpp:351
void registerInput(LhsExpressionInterface< Real, Gradient, TagTapeReverse, Lhs > &value)
Verify value properties.
Definition tagTapeReverse.hpp:393
void printStatistics(Stream &out=std::cout) const
Do nothing.
Definition tagTapeReverse.hpp:436
bool isActive(Identifier const &identifier) const
Default check.
Definition tagTapeReverse.hpp:420
bool isIdentifierActive(Identifier const &index) const
Verify tag.
Definition tagTapeReverse.hpp:270
TagTapeBase< T_Real, T_Tag, T_Real, TagTapeReverse > Base
Base class abbreviation.
Definition tagTapeReverse.hpp:76
Real Gradient
See TapeTypesInterface.
Definition tagTapeReverse.hpp:69
static bool constexpr RequiresPrimalRestore
No primal values.
Definition tagTapeReverse.hpp:348
EmptyPosition Position
See TapeTypesInterface.
Definition tagTapeReverse.hpp:72
void readFromFile(std::string const &filename)
Do nothing.
Definition tagTapeReverse.hpp:124
void printTableHeader(Stream &out=std::cout) const
Do nothing.
Definition tagTapeReverse.hpp:442
Tape information that can be printed in a pretty print format or a table format.
Definition tapeValues.hpp:75
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:94