19 bp::class_<FunctionWrap, boost::noncopyable>(
20 "BaseFunction",
"Base class for functions.", bp::no_init)
21 .def(bp::init<const Manifold &, const int>(
22 bp::args(
"self",
"manifold",
"nr")))
23 .def(bp::init<int, int, int>(bp::args(
"self",
"nx",
"ndx",
"nr")))
24 .def(
"__call__", bp::pure_virtual(&Function::operator()),
25 bp::args(
"self",
"x"),
"Call the function.")
26 .add_property(
"nx", &Function::nx,
"Input dimension")
27 .add_property(
"ndx", &Function::ndx,
"Input tangent space dimension.")
28 .add_property(
"nr", &Function::nr,
"Function codimension.");
33 bp::class_<C1FunctionWrap, bp::bases<Function>, boost::noncopyable>(
34 "C1Function",
"Base class for differentiable functions", bp::no_init)
35 .def(bp::init<const Manifold &, const int>(
36 bp::args(
"self",
"manifold",
"nr")))
37 .def(bp::init<int, int, int>(bp::args(
"self",
"nx",
"ndx",
"nr")))
38 .def(
"computeJacobian", bp::pure_virtual(compJac1),
39 bp::args(
"self",
"x",
"Jout"))
40 .def(
"getJacobian", compJac2, bp::args(
"self",
"x"),
41 "Compute and return Jacobian.");
43 bp::register_ptr_to_python<shared_ptr<C2Function>>();
44 bp::class_<C2FunctionWrap, bp::bases<C1Function>, boost::noncopyable>(
45 "C2Function",
"Base class for twice-differentiable functions.",
47 .def(bp::init<const Manifold &, const int>(
48 bp::args(
"self",
"manifold",
"nr")))
49 .def(bp::init<int, int, int>(bp::args(
"self",
"nx",
"ndx",
"nr")))
50 .def(
"vectorHessianProduct", &C2Function::vectorHessianProduct,
53 "Compute and return the vector-Hessian product.")
56 +[](shared_ptr<C2Function>
const &left,
57 shared_ptr<C2Function>
const &right) {
58 return ::proxsuite::nlp::compose<Scalar>(left, right);
60 "Composition operator. This composes the first argument over the "
69 const char *compose_doc =
"Composition of two functions. This returns the "
70 "composition of `f` over `g`.";
71 bp::register_ptr_to_python<shared_ptr<ComposeFunction>>();
72 bp::class_<ComposeFunction, bp::bases<C2Function>>(
"ComposeFunction",
73 compose_doc, bp::no_init)
74 .def(bp::init<
const shared_ptr<C2Function> &,
75 const shared_ptr<C2Function> &>(bp::args(
"self",
"f",
"g")))
77 bp::make_function(&ComposeFunction::left,
78 bp::return_internal_reference<>()),
79 "The left-hand side of the composition.")
80 .add_property(
"right",
81 bp::make_function(&ComposeFunction::right,
82 bp::return_internal_reference<>()),
83 "The right-hand side of the composition.");
86 bp::args(
"f",
"g"), compose_doc);
void(const ConstVectorRef &, MatrixRef) const MatFuncType
MatrixXs(const ConstVectorRef &) const MatFuncRetType