18 using unary_eval_t = void (UnaryFunction::*)(
const ConstVectorRef &,
19 StageFunctionData &)
const;
21 void (UnaryFunction::*)(
const ConstVectorRef &,
const ConstVectorRef &,
22 const ConstVectorRef &, StageFunctionData &)
25 void (UnaryFunction::*)(
const ConstVectorRef &,
const ConstVectorRef &,
26 StageFunctionData &)
const;
27 using full_vhp_t = void (UnaryFunction::*)(
28 const ConstVectorRef &,
const ConstVectorRef &,
const ConstVectorRef &,
29 const ConstVectorRef &, StageFunctionData &)
const;
30 bp::register_ptr_to_python<shared_ptr<UnaryFunction>>();
31 bp::class_<PyUnaryFunction<>, bp::bases<StageFunction>, boost::noncopyable>(
33 "Base class for unary functions of the form :math:`x \\mapsto f(x)`.",
35 .def(bp::init<const int, const int, const int, const int>(
36 (
"self"_a,
"ndx1",
"nu",
"ndx2",
"nr")))
37 .def(
"evaluate", bp::pure_virtual<unary_eval_t>(&UnaryFunction::evaluate),
38 (
"self"_a,
"x",
"data"))
39 .def<full_eval_t>(
"evaluate", &UnaryFunction::evaluate,
40 (
"self"_a,
"x",
"u",
"y",
"data"))
41 .def(
"computeJacobians",
42 bp::pure_virtual<unary_eval_t>(&UnaryFunction::computeJacobians),
43 (
"self"_a,
"x",
"data"))
44 .def<full_eval_t>(
"computeJacobians", &UnaryFunction::computeJacobians,
45 (
"self"_a,
"x",
"u",
"y",
"data"))
47 "computeVectorHessianProducts",
48 &UnaryFunction::computeVectorHessianProducts,
49 &PyUnaryFunction<>::default_computeVectorHessianProducts,
50 (
"self"_a,
"x",
"lbda",
"data"))
51 .def<full_vhp_t>(
"computeVectorHessianProducts",
52 &UnaryFunction::computeVectorHessianProducts,
53 (
"self"_a,
"x",
"u",
"y",
"lbda",
"data"))
54 .def(SlicingVisitor<UnaryFunction>());
StageFunctionTpl< Scalar > StageFunction
UnaryFunctionTpl< Scalar > UnaryFunction
StageFunctionDataTpl< Scalar > StageFunctionData