CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::DuplicateJacobianRemover< T_Real, T_Identifier > Struct Template Reference

Combines entries of Jacobians with the same identifier. More...

#include <duplicateJacobianRemover.hpp>

Public Types

using ArgumentSize = Config::ArgumentSize
 Definition of ArgumentSize type.
 
using Identifier = T_Identifier
 See DuplicateJacobianRemover.
 
using Real = T_Real
 See DuplicateJacobianRemover.
 

Public Member Functions

 DuplicateJacobianRemover ()=default
 Constructor.
 
void pushData (Real const &jacobian, Identifier const &index)
 For all added items, check if one matches the identifier. If yes combine, if no append.
 
template<typename Vec >
void storeData (Vec &vec)
 

Detailed Description

template<typename T_Real, typename T_Identifier>
struct codi::DuplicateJacobianRemover< T_Real, T_Identifier >

Combines entries of Jacobians with the same identifier.

This class is used in the storing process of the Jacobians for an expression. For each pushData, it checks if a Jacobian with the same identifier has already been pushed. If so, then it combines these Jacobians.

This behavior can be enabled with -DCODI_RemoveDuplicateJacobianArguments=1. See JacobianBaseTape::pushJacobians for details.

Template Parameters
T_RealThe computation type of a tape, usually chosen as ActiveType::Real.
T_IdentifierThe adjoint/tangent identifier type of a tape, usually chosen as ActiveType::Identifier.

Member Function Documentation

◆ storeData()

template<typename T_Real , typename T_Identifier >
template<typename Vec >
void codi::DuplicateJacobianRemover< T_Real, T_Identifier >::storeData ( Vec & vec)
inline

Add the data to the provided vector. Resets the internal data for a new statement push.

Template Parameters
VecDataInterface with Chunk2<Real, Identifier> as data.

The documentation for this struct was generated from the following file: