38#include "../../traits/tapeTraits.hpp"
39#include "commonReaderWriterBase.hpp"
59 template<
typename T_Type>
64 using Tape =
typename Type::Tape;
66 using Real =
typename Type::Real;
72 std::vector<Identifier>
const& out,
bool ifJacobians)
93 for (
size_t argCount = 0; argCount < nJacobians; argCount++) {
94 std::string labelText =
"";
96 labelText = std::to_string(rhsJacobians[curJacobianPos + argCount]);
123 template<
typename T_Type>
128 using Tape =
typename Type::Tape;
130 using Real =
typename Type::Real;
135 std::vector<Identifier>
const& out)
136 :
Base(true, name, in, out) {};
145 Real const*
const passiveValues,
Real const*
const constantValues,
147 CODI_UNUSED(primalValues, passiveValues, constantValues, stmtEvalHandle);
158 std::string mathRep =
#define CODI_Unlikely
Declare unlikely evaluation of an execution path.
Definition config.h:408
#define CODI_Likely
Declare likely evaluation of an execution path.
Definition config.h:406
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:96
uint8_t ArgumentSize
Type for the number of arguments in statements.
Definition config.h:117
size_t constexpr StatementInputTag
Tag for statements that are inputs. Used in linear index management context.
Definition config.h:123
CoDiPack - Code Differentiation Package.
Definition codi.hpp:94
inlinevoid CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:54
std::string modifyMathRep(std::string const &mathRep, Identifier const *const rhsIdentifiers, size_t const &nActiveValues)
Replaces all general identifiers in the math representation with the input, output or temporary annot...
Definition commonReaderWriterBase.hpp:401
CommonTextTapeWriter(bool writeDotHeaderFooter, std::string const &name, std::vector< Identifier > const &in, std::vector< Identifier > const &out)
Constructor.
Definition commonReaderWriterBase.hpp:251
std::string createNode(size_t nIdentifiers, Identifier const *identifiers, std::string const &label)
Creates a new node for a given Identifier and label.
Definition commonReaderWriterBase.hpp:336
void createEdge(Identifier const &from, std::string const &to, std::string const &label="")
Return a string that creates an edge between two nodes in the .dot language.
Definition commonReaderWriterBase.hpp:429
void updateLhsIdentifiers(size_t nIdentifiers, Identifier const *identifiers)
Update the identifiers extension and the prefix.
Definition commonReaderWriterBase.hpp:440
void placeUnusedRhsNodes(Identifier const *const rhsIdentifiers, Config::ArgumentSize const &nArguments)
Ensure that all the nodes on the rhs have been placed in the .dot file before creating edges to them.
Definition commonReaderWriterBase.hpp:417
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 graphWriters.hpp:79
typename Type::Real Real
See TapeWriterInterface.
Definition graphWriters.hpp:66
typename Type::Tape Tape
See TapeWriterInterface.
Definition graphWriters.hpp:64
CommonTextTapeWriter< T_Type > Base
See CommonTextTapeWriter.
Definition graphWriters.hpp:62
JacobianGraphTapeWriter(std::string const &name, std::vector< Identifier > const &in, std::vector< Identifier > const &out, bool ifJacobians)
Constructor.
Definition graphWriters.hpp:71
T_Type Type
See TapeWriterInterface.
Definition graphWriters.hpp:61
bool printJacobians
Flag that enables the jacobians on the edges in the graph.
Definition graphWriters.hpp:68
typename Type::Identifier Identifier
See TapeWriterInterface.
Definition graphWriters.hpp:65
typename Type::Tape Tape
See TapeWriterInterface.
Definition graphWriters.hpp:128
T_Type Type
See TapeWriterInterface.
Definition graphWriters.hpp:125
CommonTextTapeWriter< T_Type > Base
See CommonTextTapeWriter.
Definition graphWriters.hpp:126
typename Type::Identifier Identifier
See TapeWriterInterface.
Definition graphWriters.hpp:129
typename Tape::EvalHandle EvalHandle
See TapeWriterInterface.
Definition graphWriters.hpp:131
PrimalGraphTapeWriter(std::string const &name, std::vector< Identifier > const &in, std::vector< Identifier > const &out)
Constructor.
Definition graphWriters.hpp:134
typename Type::Real Real
See TapeWriterInterface.
Definition graphWriters.hpp:130
void writeStatement(WriteInfo const &info, Identifier const *lhsIdentifiers, Real const *primalValues, Config::ArgumentSize const &nPassiveValues, Identifier const *const rhsIdentifiers, Real const *const passiveValues, Real const *const constantValues, EvalHandle stmtEvalHandle)
Called for each statement. The method writes the current statement to the file. This overload is used...
Definition graphWriters.hpp:143
This class is used during the writing process of a primal value tape. The WriteInfo is returned by St...
Definition tapeReaderWriterInterface.hpp:69
size_t numberOfActiveArguments
Number of active arguments.
Definition tapeReaderWriterInterface.hpp:71
size_t numberOfOutputArguments
Number of output arguments.
Definition tapeReaderWriterInterface.hpp:70
std::string mathRepresentation
Definition tapeReaderWriterInterface.hpp:74