23 using PolyIntegrator = xyz::polymorphic<IntegratorAbstract>;
25 register_polymorphic_to_python<PolyIntegrator>();
30 bp::class_<PyIntegratorAbstract, bp::bases<DynamicsModel>,
31 boost::noncopyable>(
"IntegratorAbstract",
32 "Base class for numerical integrators.",
33 bp::init<const xyz::polymorphic<DAEType> &>(
34 "Construct the integrator from a DAE.",
35 bp::args(
"self",
"cont_dynamics")))
36 .def_readwrite(
"continuous_dynamics",
37 &IntegratorAbstract::continuous_dynamics_,
38 "The underlying ODE or DAE.")
39 .add_property(
"space",
40 bp::make_function(&IntegratorAbstract::space,
41 bp::return_internal_reference<>()),
42 "Return the state manifold.")
44 .def(conversions_visitor);
46 bp::register_ptr_to_python<shared_ptr<IntegratorDataTpl<Scalar>>>();
47 bp::class_<IntegratorDataTpl<Scalar>, bp::bases<DynamicsData>>(
48 "IntegratorData",
"Base class for integrators' data.", bp::no_init)
49 .def_readwrite(
"continuous_data",
53 bp::class_<MidpointIntegrator, bp::bases<IntegratorAbstract>>(
54 "IntegratorMidpoint", bp::init<xyz::polymorphic<DAEType>, Scalar>(
55 bp::args(
"self",
"dae",
"timestep")))
56 .def_readwrite(
"timestep", &MidpointIntegrator::timestep_,
"Time step.")
57 .def(conversions_visitor);
59 bp::register_ptr_to_python<shared_ptr<IntegratorMidpointDataTpl<Scalar>>>();
60 bp::class_<IntegratorMidpointDataTpl<Scalar>,
61 bp::bases<IntegratorDataTpl<Scalar>>>(
"IntegratorMidpointData",