57 template<
typename T_Real,
typename T_Identifier>
66 std::array<Identifier, Config::MaxArgumentSize> indices;
67 std::array<Real, Config::MaxArgumentSize> jacobians;
79 for (pos = 0; pos < size; pos += 1) {
80 if (indices[pos] == index) {
89 jacobians[pos] = jacobian;
91 jacobians[pos] += jacobian;
97 template<
typename Vec>
100 vec.pushData(jacobians[pos], indices[pos]);
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
uint8_t ArgumentSize
Type for the number of arguments in statements.
Definition config.h:117
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
Combines entries of Jacobians with the same identifier.
Definition duplicateJacobianRemover.hpp:58
void storeData(Vec &vec)
Definition duplicateJacobianRemover.hpp:98
DuplicateJacobianRemover()=default
Constructor.
T_Identifier Identifier
See DuplicateJacobianRemover.
Definition duplicateJacobianRemover.hpp:62
T_Real Real
See DuplicateJacobianRemover.
Definition duplicateJacobianRemover.hpp:61
Config::ArgumentSize ArgumentSize
Definition of ArgumentSize type.
Definition duplicateJacobianRemover.hpp:63
void pushData(Real const &jacobian, Identifier const &index)
For all added items, check if one matches the identifier. If yes combine, if no append.
Definition duplicateJacobianRemover.hpp:76