CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
Active type overview

Below are some guidelines on when to use which CoDiPack type. Details can be found at Active type definitions. A plus in the table means that this is supported or a beneficial type, a minus that it is not supported or not beneficial.

Type C-like memory operations Vector mode Large inactive parts Hessian computation
codi::RealReverse + - + -
codi::RealReverseIndex - + + -
codi::RealReversePrimal + - - +
codi::RealReversePrimalIndex - + - +

Legend:

  • C-like memory operations: Operations like memcpy can be used on the CoDiPack type, assuming that the correct size is used (e.g. memcpy(y, x, n * sizeof(codi::RealReverse)).
  • Vector mode: Additional memory consumption for the vector mode is quite small. Vector modes can either be run with the *Vec variant of the type (Tutorial 4 - Vector mode AD) or with the codi::CustomAdjointVectorHelper (Example 2 - Custom adjoint vector evaluation).
  • Large inactive parts: CoDiPack performs an online activity analysis. If variables do not depend on the input variables - registered with calls to registerInput (independent variables) - then the sensitivites are not propagated for these passive variables. Jacobian taping approaches perform usually better in such a case.
  • Hessian computation: For a full Hessian computation the seeding for the second order sensitivites need to be changed. Primal value tapes can simply reevaluate these seedings which is usually faster than rerunning the program. See Example 17 - Hessian and Jacobian computation for function objects for an automatic Hessian computation.