proxsuite-nlp  0.11.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
 
Loading...
Searching...
No Matches
expose-autodiff.cpp
1#include "proxsuite-nlp/python/fwd.hpp"
2
4#include "proxsuite-nlp/modelling/autodiff/finite-difference.hpp"
5
6namespace proxsuite {
7namespace nlp {
8namespace python {
9
12 using namespace autodiff;
13 using context::C1Function;
14 using context::C2Function;
15 using context::Function;
16 using context::Manifold;
17 using context::Scalar;
18
19 bp::enum_<FDLevel>("FDLevel", "Finite difference level.")
20 .value("ToC1", FDLevel::TOC1)
21 .value("ToC2", FDLevel::TOC2);
22
23 bp::class_<finite_difference_wrapper<Scalar, FDLevel::TOC1>,
24 bp::bases<C1Function>>(
25 "FiniteDifferenceHelper",
26 "Make a function into a differentiable function using"
27 " finite differences.",
28 bp::init<const Manifold &, const Function &, const Scalar>(
29 bp::args("self", "space", "func", "eps")));
30
31 bp::class_<finite_difference_wrapper<Scalar, TOC2>, bp::bases<C2Function>>(
32 "FiniteDifferenceHelperC2",
33 "Make a differentiable function into a twice-differentiable function "
34 "using"
35 " finite differences.",
36 bp::init<const Manifold &, const C1Function &, const Scalar>(
37 bp::args("self", "space", "func", "eps")));
38}
39
40void exposeAutodiff() { expose_finite_differences(); }
41
42} // namespace python
43} // namespace nlp
44} // namespace proxsuite
Automatic differentiation utilities.
Definition fwd.hpp:22
void expose_finite_differences()
Expose finite difference helpers.
Main package namespace.
Definition bcl-params.hpp:5