Adept (C++ library)


Adept is a combined automatic differentiation and array software library for the C++ programming language. The automatic differentiation capability facilitates the development of applications involving mathematical optimization. Adept is notable for having applied the template metaprogramming technique of expression templates to speed-up the differentiation of mathematical statements. Along with the efficient way that it stores the differential information, this makes it significantly faster than most other C++ tools that provide similar functionality, although comparable performance has been reported for Stan and in some cases Sacado. Differentiation may be in forward mode, reverse mode, or the full Jacobian matrix may be computed.
Applications of Adept have included financial modeling, computational fluid dynamics, physical chemistry, parameter estimation and meteorology. Adept is free software distributed under the Apache License.

Example

Adept implements automatic differentiation using an operator overloading approach, in which scalars to be differentiated are written as adouble, indicating an "active" version of the normal double, and vectors to be differentiated are written as aVector. The following simple example uses these types to differentiate a 3-norm calculation on a small vector:

  1. include
  2. include
int main

When compiled and executed, this program reports the derivative as:

dJ/dx =