CoDiPack (Code Differentiation Package) is a tool for gradient evaluation in computer programs. It supports the features:
The design principle for CoDiPack is that it is easy to use. However, it also gives experienced AD developers full access to all the data structures.
The Scientific Computing Group at the TU Kaiserslautern develops CoDiPack and will enhance and extend CoDiPack in the future.
CoDiPack is a header only library. The only file the user needs to include is codi.hpp
. The only other requirement is a C++11 compliant compiler where one usually needs to specify '-std=c++11' in compiler arguments. CoDiPack is tested with gcc, clang, and the Intel compiler.
The file codi.hpp
defines several datatypes. The most important ones are:
We recommend to use the codi::RealReverse type when AD is first introduced to an application. After that there should be no difficulties in replacing the codi::RealReverse type with other types.
For the handling of libraries and the memory optimization of the tape there exist several helper structures. Most of them are introduced in the tutorial section:
Please visit the tutorial page for further information.
For a full type list of the file 'codi.hpp' please see Active type definitions.
A very small and simple example for the usage of the RealForward type is the following code:
It is compiled with
for the gcc compiler or with
for the Intel compiler.
You can get CoDiPack from https://scicomp.rptu.de/software/codi.
If you use CoDiPack in one of your applications and write a paper it would be nice if you could cite the paper High-Performance Derivative Computations using CoDiPack.