Modern Expression Template assisted Automatic differentiation Library
This header-only C++ library is developed to simplify partial derivative computation by implementing efficient automatic differentiation (AD).
It realies heavily on the expression template design pattern (ET) to optimise away temporaries by interfacing with a linear algebra library (Eigen) that supports this approach. During local ET evaluation backward AD, while globally forward AD is used. This enables complex computations to be performed (e.g. numerical integration of differential equations) without running into issues with stack size (of the backward algorithm).
Apart from using Eigen, it is also designed to be used together with it allow vectorizing computations.
metal::Scalar a{ 1.0, "a" };
metal::Scalar b{ 2.0, "b" };
metal::Scalar c{ 3.0, "c" };
metal::Scalar x = sin( a ) * 0.5 + b * c;
Catch2 is integrated for testing. A single-header version is included in the repository test folder.
This is a header-only library. To compile the tests and examples a c++11 compatible compiler is required. A ninja build script is provided for user convenience. To build, simply use:
ninja
This project relies heavily on Eigen. Minimal version of 3.3.x is reccomended (probably works with any Eigen3 version).
This project a work in progress.