PatWie / CppNumericalSolvers

a lightweight header-only C++17 library of numerical optimization methods for nonlinear functions based on Eigen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AutoDiff

PatWie opened this issue · comments

Motivated by the fork of @tesch1 I tried some time ago to implement autodiff, too in
https://github.com/PatWie/CppNumericalSolvers/blob/autodiff/src/examples/debug.cpp

However, I observed that there is currently no neat way to switch from finite difference to autodiff within a one-liner and no overhead. While this is really just

AutoDiff<RosenbrockObjective, T> f_autodiff_version;

instead of

Rosenbrock<T> f_default;

It would affect all data inside the problem. Given quadratic form x'Ax, even A currently has to be represented using the dual type.