smooth
A C++ library for Lie theory
|
Differentiation on Manifolds. More...
Go to the source code of this file.
Enumerations | |
enum class | diff::Type { Numerical , Autodiff , Ceres , Analytic , Default } |
Available differentiation methods. More... | |
Functions | |
template<std::size_t K, Type D> | |
auto | diff::dr (auto &&f, auto &&x) |
Differentiation in tangent space. | |
template<std::size_t K, Type D, std::size_t... Idx> | |
auto | diff::dr (auto &&f, auto &&x, std::index_sequence< Idx... > idx) |
Differentiation in tangent space. | |
template<std::size_t K> | |
auto | diff::dr (auto &&f, auto &&x) |
Differentiation in tangent space using default method. | |
template<std::size_t K, std::size_t... Idx> | |
auto | diff::dr (auto &&f, auto &&x, std::index_sequence< Idx... > idx) |
Differentiation in tangent space using default method. | |
Differentiation on Manifolds.
Definition in file diff.hpp.
|
strong |
Available differentiation methods.
Enumerator | |
---|---|
Numerical | Numerical (forward) derivatives. |
Autodiff | Uses the autodiff (https://autodiff.github.io) library; requires |
Ceres | Uses the Ceres (http://ceres-solver.org) built-in autodiff; requires |
Analytic | Hand-coded derivative. Type must have a function named 'jacobian' : x -> Mat (order 1) and 'hesssian': x -> Mat (order 2) that compute the derivatives. |
Default | Select based on availability (Analytic > Autodiff > Ceres > Numerical) |
auto diff::dr | ( | auto && | f, |
auto && | x | ||
) |
Differentiation in tangent space.
K | differentiation order (0, 1 or 2) |
D | differentiation method to use |
First derivatives are returned as a matrix df s.t. df(i, j) = dfi / dxj, where fi is the i:th degree of freedom of f, and xj the j:th degree of freedom of x.
Second derivatives are stored as a horizontally stacked block matrix d2f = [ d2f0 d2f1 ... d2fN ], where d2fi(j, k) = d2fi / dxjxk is the Hessian of the i:th degree of freedom of f.
f | function to differentiate |
x | reference tuple of function arguments |
auto diff::dr | ( | auto && | f, |
auto && | x | ||
) |
Differentiation in tangent space using default method.
K | differentiation order |
f | function to differentiate |
x | reference tuple of function arguments |
std::pair
containing value and right derivative: \((f(x), \mathrm{d}^r f_x)\)auto diff::dr | ( | auto && | f, |
auto && | x, | ||
std::index_sequence< Idx... > | idx | ||
) |
Differentiation in tangent space.
Like above, but calculate a subset idx of derivatives.
f | function to differentiate |
x | reference tuple of function arguments |
idx | indices defining subset of x |
auto diff::dr | ( | auto && | f, |
auto && | x, | ||
std::index_sequence< Idx... > | idx | ||
) |
Differentiation in tangent space using default method.
Like above, but calculate a subset idx of derivatives.
f | function to differentiate |
x | reference tuple of function arguments |
idx | indices defining subset of x |