integrator-euler-python-module-py.cc
Go to the documentation of this file.
1 #include <boost/python/suite/indexing/vector_indexing_suite.hpp>
5 
6 namespace dg = dynamicgraph;
7 namespace dgc = dynamicgraph::command;
8 namespace dgs = dynamicgraph::sot;
9 using dg::Matrix;
10 using dg::Vector;
11 
12 template <typename S, typename C>
14  typedef dgs::IntegratorEuler<S, C> IE_t;
15 
16  const std::string cName = dgc::Value::typeName(dgc::ValueHelper<C>::TypeID);
17 
18  dg::python::exposeEntity<IE_t>()
19  .add_property(
20  "numerators",
21  +[](const IE_t &e) {
22  return dg::python::to_py_list(e.numCoeffs().begin(),
23  e.numCoeffs().end());
24  },
25  +[](IE_t &e, bp::object iterable) {
26  e.numCoeffs(dg::python::to_std_vector<C>(iterable));
27  })
28  .add_property(
29  "denominators",
30  +[](const IE_t &e) {
31  return dg::python::to_py_list(e.denomCoeffs().begin(),
32  e.denomCoeffs().end());
33  },
34  +[](IE_t &e, bp::object iterable) {
35  e.denomCoeffs(dg::python::to_std_vector<C>(iterable));
36  });
37 }
38 
40  bp::import("dynamic_graph");
41 
42  exposeIntegratorEuler<double, double>();
43  exposeIntegratorEuler<Vector, double>();
44  exposeIntegratorEuler<Vector, Matrix>();
45 }
dynamicgraph::command::ValueHelper
dynamicgraph
dynamicgraph::sot::IntegratorEuler
integrates an ODE using a naive Euler integration. TODO: change the integration method....
Definition: integrator-euler.hh:51
dynamicgraph::command
module.hh
exposeIntegratorEuler
void exposeIntegratorEuler()
Definition: integrator-euler-python-module-py.cc:13
wrap
dynamicgraph::sot::Vector
Vector
Definition: fir-filter.cpp:49
dynamicgraph::sot::Matrix
Matrix
Definition: integrator-euler.t.cpp:45
dynamic-graph-py.hh
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(wrap)
Definition: integrator-euler-python-module-py.cc:39
dynamicgraph::sot
integrator-euler.hh
dynamicgraph::command::Value::typeName
static std::string typeName(Type type)


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31