std-vector.hpp
Go to the documentation of this file.
1 
7 #ifndef __eigenpy_utils_std_vector_hpp__
8 #define __eigenpy_utils_std_vector_hpp__
9 
10 #include <boost/mpl/if.hpp>
11 #include <boost/python.hpp>
12 #include <boost/python/stl_iterator.hpp>
13 #include <boost/python/suite/indexing/vector_indexing_suite.hpp>
14 #include <iterator>
15 #include <string>
16 #include <vector>
17 
18 #include "eigenpy/eigenpy.hpp"
19 #include "eigenpy/config.hpp"
20 #include "eigenpy/copyable.hpp"
23 #include "eigenpy/registration.hpp"
24 
25 namespace eigenpy {
26 // Forward declaration
27 template <typename vector_type, bool NoProxy = false>
29 
30 namespace details {
31 
33 template <typename T>
34 bool from_python_list(PyObject *obj_ptr, T *) {
35  // Check if it is a list
36  if (!PyList_Check(obj_ptr)) return false;
37 
38  // Retrieve the underlying list
39  bp::object bp_obj(bp::handle<>(bp::borrowed(obj_ptr)));
40  bp::list bp_list(bp_obj);
41  bp::ssize_t list_size = bp::len(bp_list);
42 
43  // Check if all the elements contained in the current vector is of type T
44  for (bp::ssize_t k = 0; k < list_size; ++k) {
45  bp::extract<T> elt(bp_list[k]);
46  if (!elt.check()) return false;
47  }
48 
49  return true;
50 }
51 
52 template <typename vector_type, bool NoProxy>
53 struct build_list {
54  static ::boost::python::list run(vector_type &vec, const bool deep_copy) {
55  if (deep_copy) return build_list<vector_type, true>::run(vec, true);
56 
57  bp::list bp_list;
58  for (size_t k = 0; k < vec.size(); ++k) {
59  bp_list.append(boost::ref(vec[k]));
60  }
61  return bp_list;
62  }
63 };
64 
65 template <typename vector_type>
66 struct build_list<vector_type, true> {
67  static ::boost::python::list run(vector_type &vec, const bool) {
68  typedef bp::iterator<vector_type> iterator;
69  return bp::list(iterator()(vec));
70  }
71 };
72 
76 template <typename Container>
78  : public boost::python::def_visitor<
79  overload_base_get_item_for_std_vector<Container> > {
80  typedef typename Container::value_type value_type;
81  typedef typename Container::value_type data_type;
82  typedef size_t index_type;
83 
84  template <class Class>
85  void visit(Class &cl) const {
86  cl.def("__getitem__", &base_get_item);
87  }
88 
89  private:
90  static boost::python::object base_get_item(
91  boost::python::back_reference<Container &> container, PyObject *i_) {
92  index_type idx = convert_index(container.get(), i_);
93  typename Container::iterator i = container.get().begin();
94  std::advance(i, idx);
95  if (i == container.get().end()) {
96  PyErr_SetString(PyExc_KeyError, "Invalid index");
97  bp::throw_error_already_set();
98  }
99 
100  typename bp::to_python_indirect<data_type &,
101  bp::detail::make_reference_holder>
102  convert;
103  return bp::object(bp::handle<>(convert(*i)));
104  }
105 
106  static index_type convert_index(Container &container, PyObject *i_) {
107  bp::extract<long> i(i_);
108  if (i.check()) {
109  long index = i();
110  if (index < 0) index += (long)container.size();
111  if (index >= long(container.size()) || index < 0) {
112  PyErr_SetString(PyExc_IndexError, "Index out of range");
113  bp::throw_error_already_set();
114  }
115  return (index_type)index;
116  }
117 
118  PyErr_SetString(PyExc_TypeError, "Invalid index type");
119  bp::throw_error_already_set();
120  return index_type();
121  }
122 };
123 } // namespace details
124 } // namespace eigenpy
125 
126 namespace boost {
127 namespace python {
128 
129 template <typename MatrixType>
131  : converter::extract_rvalue<Eigen::Ref<MatrixType> > {
132  typedef Eigen::Ref<MatrixType> RefType;
133 
134  protected:
135  typedef converter::extract_rvalue<RefType> base;
136 
137  public:
139 
140  operator result_type() const { return (*this)(); }
141 
142  extract_to_eigen_ref(PyObject *o) : base(o) {}
143  extract_to_eigen_ref(api::object const &o) : base(o.ptr()) {}
144 };
145 
148 template <typename Scalar, int Rows, int Cols, int Options, int MaxRows,
149  int MaxCols>
150 struct extract<Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &>
152  Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> > {
153  typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols>
156  extract(PyObject *o) : base(o) {}
157  extract(api::object const &o) : base(o.ptr()) {}
158 };
159 
160 template <typename Derived>
161 struct extract<Eigen::MatrixBase<Derived> &>
162  : extract_to_eigen_ref<Eigen::MatrixBase<Derived> > {
163  typedef Eigen::MatrixBase<Derived> MatrixType;
165  extract(PyObject *o) : base(o) {}
166  extract(api::object const &o) : base(o.ptr()) {}
167 };
168 
169 template <typename Derived>
170 struct extract<Eigen::RefBase<Derived> &>
171  : extract_to_eigen_ref<Eigen::RefBase<Derived> > {
172  typedef Eigen::RefBase<Derived> MatrixType;
174  extract(PyObject *o) : base(o) {}
175  extract(api::object const &o) : base(o.ptr()) {}
176 };
177 
178 namespace converter {
179 
180 template <typename Type, class Allocator>
181 struct reference_arg_from_python<std::vector<Type, Allocator> &>
182  : arg_lvalue_from_python_base {
183  typedef std::vector<Type, Allocator> vector_type;
186  typedef extract<Type &> extract_type;
187 
188  reference_arg_from_python(PyObject *py_obj)
189  : arg_lvalue_from_python_base(converter::get_lvalue_from_python(
190  py_obj, registered<vector_type>::converters)),
191  m_data(NULL),
192  m_source(py_obj),
193  vec_ptr(NULL) {
194  if (result() != 0) // we have found a lvalue converter
195  return;
196 
197  // Check if py_obj is a py_list, which can then be converted to an
198  // std::vector
199  bool is_convertible =
200  ::eigenpy::details::from_python_list(py_obj, (Type *)(0));
201  if (!is_convertible) return;
202 
203  typedef ::eigenpy::StdContainerFromPythonList<vector_type> Constructor;
204  Constructor::construct(py_obj, &m_data.stage1);
205 
206  void *&m_result = const_cast<void *&>(result());
207  m_result = m_data.stage1.convertible;
208  vec_ptr = reinterpret_cast<vector_type *>(m_data.storage.bytes);
209  }
210 
212  return ::boost::python::detail::void_ptr_to_reference(result(),
213  (result_type(*)())0);
214  }
215 
217  if (m_data.stage1.convertible == m_data.storage.bytes) {
218  // Copy back the reference
219  const vector_type &vec = *vec_ptr;
220  list bp_list(handle<>(borrowed(m_source)));
221  for (size_t i = 0; i < vec.size(); ++i) {
222  typename extract_type::result_type elt = extract_type(bp_list[i]);
223  elt = vec[i];
224  }
225  }
226  }
227 
228  private:
229  rvalue_from_python_data<ref_vector_type> m_data;
230  PyObject *m_source;
232 };
233 
234 } // namespace converter
235 } // namespace python
236 } // namespace boost
237 
238 namespace eigenpy {
239 
240 namespace details {
242 template <class Container>
244  // default behavior expects allocators
245  typedef typename Container::allocator_type Allocator;
246 };
247 
248 template <typename _Tp, std::size_t Size>
249 struct container_traits<std::array<_Tp, Size> > {
250  typedef void Allocator;
251 };
252 }; // namespace details
253 
259 template <typename vector_type, bool NoProxy>
261  typedef typename vector_type::value_type T;
263 
265  static void *convertible(PyObject *obj_ptr) {
266  namespace bp = boost::python;
267 
268  // Check if it is a list
269  if (!PyList_Check(obj_ptr)) return 0;
270 
271  // Retrieve the underlying list
272  bp::object bp_obj(bp::handle<>(bp::borrowed(obj_ptr)));
273  bp::list bp_list(bp_obj);
274  bp::ssize_t list_size = bp::len(bp_list);
275 
276  // Check if all the elements contained in the current vector is of type T
277  for (bp::ssize_t k = 0; k < list_size; ++k) {
278  bp::extract<T> elt(bp_list[k]);
279  if (!elt.check()) return 0;
280  }
281 
282  return obj_ptr;
283  }
284 
287  static void construct(
288  PyObject *obj_ptr,
289  boost::python::converter::rvalue_from_python_stage1_data *memory) {
290  // Extract the list
291  bp::object bp_obj(bp::handle<>(bp::borrowed(obj_ptr)));
292  bp::list bp_list(bp_obj);
293 
294  void *storage =
295  reinterpret_cast<
296  bp::converter::rvalue_from_python_storage<vector_type> *>(
297  reinterpret_cast<void *>(memory))
298  ->storage.bytes;
299 
300  typedef bp::stl_input_iterator<T> iterator;
301 
302  // Build the std::vector
303  new (storage) vector_type(iterator(bp_list), iterator());
304 
305  // Validate the construction
306  memory->convertible = storage;
307  }
308 
309  static void register_converter() {
310  ::boost::python::converter::registry::push_back(
311  &convertible, &construct, ::boost::python::type_id<vector_type>());
312  }
313 
314  static ::boost::python::list tolist(vector_type &self,
315  const bool deep_copy = false) {
316  return details::build_list<vector_type, NoProxy>::run(self, deep_copy);
317  }
318 };
319 
320 namespace internal {
321 
322 template <typename T,
323  bool has_operator_equal_value =
324  std::is_base_of<std::true_type, has_operator_equal<T> >::value>
326 
327 template <typename T>
328 struct contains_algo<T, true> {
329  template <class Container, typename key_type>
330  static bool run(const Container &container, key_type const &key) {
331  return std::find(container.begin(), container.end(), key) !=
332  container.end();
333  }
334 };
335 
336 template <typename T>
337 struct contains_algo<T, false> {
338  template <class Container, typename key_type>
339  static bool run(const Container &container, key_type const &key) {
340  for (size_t k = 0; k < container.size(); ++k) {
341  if (&container[k] == &key) return true;
342  }
343  return false;
344  }
345 };
346 
347 template <class Container, bool NoProxy>
349  : public ::boost::python::vector_indexing_suite<
350  Container, NoProxy,
351  contains_vector_derived_policies<Container, NoProxy> > {
352  typedef typename Container::value_type key_type;
353 
354  static bool contains(Container &container, key_type const &key) {
355  return contains_algo<key_type>::run(container, key);
356  }
357 };
358 
364 template <typename Container, bool NoProxy, typename CoVisitor>
366  : public boost::python::def_visitor<
367  ExposeStdMethodToStdVector<Container, NoProxy, CoVisitor> > {
370 
371  ExposeStdMethodToStdVector(const CoVisitor &co_visitor)
372  : m_co_visitor(co_visitor) {}
373 
374  template <class Class>
375  void visit(Class &cl) const {
376  cl.def(m_co_visitor)
377  .def("tolist", &FromPythonListConverter::tolist,
378  (bp::arg("self"), bp::arg("deep_copy") = false),
379  "Returns the std::vector as a Python list.")
380  .def("reserve", &Container::reserve,
381  (bp::arg("self"), bp::arg("new_cap")),
382  "Increase the capacity of the vector to a value that's greater "
383  "or equal to new_cap.")
385  }
386 
387  const CoVisitor &m_co_visitor;
388 };
389 
391 template <typename Container, bool NoProxy, typename CoVisitor>
393 createExposeStdMethodToStdVector(const CoVisitor &co_visitor) {
395 }
396 
397 } // namespace internal
398 
400  : public ::boost::python::def_visitor<EmptyPythonVisitor> {
401  template <class classT>
402  void visit(classT &) const {}
403 };
404 
405 namespace internal {
406 template <typename vector_type, bool T_picklable = false>
408  static void run(bp::class_<vector_type> &) {}
409 };
410 
411 template <typename vector_type>
412 struct def_pickle_std_vector<vector_type, true> {
413  static void run(bp::class_<vector_type> &cl) {
414  cl.def_pickle(PickleVector<vector_type>());
415  }
416 };
417 } // namespace internal
418 
427 template <class vector_type, bool NoProxy = false,
428  bool EnableFromPythonListConverter = true, bool pickable = true>
430  typedef typename vector_type::value_type value_type;
433 
434  static void expose(const std::string &class_name,
435  const std::string &doc_string = "") {
436  expose(class_name, doc_string, EmptyPythonVisitor());
437  }
438 
439  template <typename DerivedVisitor>
440  static void expose(const std::string &class_name,
441  const bp::def_visitor<DerivedVisitor> &visitor) {
442  expose(class_name, "", visitor);
443  }
444 
445  template <typename DerivedVisitor>
446  static void expose(const std::string &class_name,
447  const std::string &doc_string,
448  const bp::def_visitor<DerivedVisitor> &visitor) {
449  // Apply visitor on already registered type or if type is not already
450  // registered, we define and apply the visitor on it
451  auto add_std_visitor =
452  internal::createExposeStdMethodToStdVector<vector_type, NoProxy>(
453  visitor);
454  if (!register_symbolic_link_to_registered_type<vector_type>(
455  add_std_visitor)) {
456  bp::class_<vector_type> cl(class_name.c_str(), doc_string.c_str());
457 
458  // Standard vector indexing definition
459  boost::python::vector_indexing_suite<
460  vector_type, NoProxy,
462  vector_indexing;
463 
464  cl.def(bp::init<size_t, const value_type &>(
465  bp::args("self", "size", "value"),
466  "Constructor from a given size and a given value."))
467  .def(bp::init<const vector_type &>(bp::args("self", "other"),
468  "Copy constructor"))
469 
470  .def(vector_indexing)
471  .def(add_std_visitor);
472 
474  }
475  if (EnableFromPythonListConverter) {
476  // Register conversion
478  }
479  }
480 };
481 
485 void EIGENPY_DLLAPI exposeStdVector();
486 
487 template <typename MatType>
489  typedef std::vector<MatType, Eigen::aligned_allocator<MatType> > VecMatType;
490  std::string full_name = "StdVec_";
491  full_name += name;
493  full_name.c_str(),
495 }
496 
497 } // namespace eigenpy
498 
499 #endif // ifndef __eigenpy_utils_std_vector_hpp__
eigenpy::internal::ExposeStdMethodToStdVector::FromPythonListConverter
StdContainerFromPythonList< Container, NoProxy > FromPythonListConverter
Definition: std-vector.hpp:369
eigenpy::StdContainerFromPythonList::Allocator
details::container_traits< vector_type >::Allocator Allocator
Definition: std-vector.hpp:262
eigenpy::internal::def_pickle_std_vector< vector_type, true >::run
static void run(bp::class_< vector_type > &cl)
Definition: std-vector.hpp:413
eigenpy::CopyableVisitor
Add the Python method copy to allow a copy of this by calling the copy constructor.
Definition: copyable.hpp:18
eigenpy::details::overload_base_get_item_for_std_vector::convert_index
static index_type convert_index(Container &container, PyObject *i_)
Definition: std-vector.hpp:106
boost::python::extract< Eigen::MatrixBase< Derived > & >::extract
extract(PyObject *o)
Definition: std-vector.hpp:165
boost::python
Definition: alignment.hpp:49
Eigen
Definition: complex.cpp:7
eigenpy::internal::ExposeStdMethodToStdVector::m_co_visitor
const CoVisitor & m_co_visitor
Definition: std-vector.hpp:387
boost::python::extract< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > & >::base
extract_to_eigen_ref< MatrixType > base
Definition: std-vector.hpp:155
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::m_source
PyObject * m_source
Definition: std-vector.hpp:230
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::result_type
ref_vector_type result_type
Definition: std-vector.hpp:185
eigenpy::internal::contains_algo
Definition: std-vector.hpp:325
eigenpy::internal::ExposeStdMethodToStdVector::ExposeStdMethodToStdVector
ExposeStdMethodToStdVector(const CoVisitor &co_visitor)
Definition: std-vector.hpp:371
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::ref_vector_type
vector_type & ref_vector_type
Definition: std-vector.hpp:184
boost::python::extract< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > & >::MatrixType
Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > MatrixType
Definition: std-vector.hpp:154
registration.hpp
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::~reference_arg_from_python
~reference_arg_from_python()
Definition: std-vector.hpp:216
eigenpy::StdVectorPythonVisitor
Expose an std::vector from a type given as template argument.
Definition: std-vector.hpp:429
eigenpy::details::build_list< vector_type, true >::run
::boost::python::list run(vector_type &vec, const bool)
Definition: std-vector.hpp:67
eigenpy::details::overload_base_get_item_for_std_vector::visit
void visit(Class &cl) const
Definition: std-vector.hpp:85
eigenpy::internal::def_pickle_std_vector
Definition: std-vector.hpp:407
eigenpy::details::container_traits::Allocator
Container::allocator_type Allocator
Definition: std-vector.hpp:245
eigenpy::details::overload_base_get_item_for_std_vector::value_type
Container::value_type value_type
Definition: std-vector.hpp:80
boost::python::extract< Eigen::RefBase< Derived > & >::extract
extract(PyObject *o)
Definition: std-vector.hpp:174
eigenpy::internal::contains_algo< T, false >::run
static bool run(const Container &container, key_type const &key)
Definition: std-vector.hpp:339
eigenpy::internal::def_pickle_std_vector::run
static void run(bp::class_< vector_type > &)
Definition: std-vector.hpp:408
eigenpy::internal::contains_vector_derived_policies::key_type
Container::value_type key_type
Definition: std-vector.hpp:352
eigenpy::details::overload_base_get_item_for_std_vector::base_get_item
static boost::python::object base_get_item(boost::python::back_reference< Container & > container, PyObject *i_)
Definition: std-vector.hpp:90
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::m_data
rvalue_from_python_data< ref_vector_type > m_data
Definition: std-vector.hpp:229
test_matrix.vec
vec
Definition: test_matrix.py:180
eigenpy::details::from_python_list
bool from_python_list(PyObject *obj_ptr, T *)
Check if a PyObject can be converted to an std::vector<T>.
Definition: std-vector.hpp:34
eigenpy::PickleVector
Create a pickle interface for the std::vector.
Definition: pickle-vector.hpp:19
boost
Definition: alignment.hpp:48
eigenpy::StdVectorPythonVisitor::value_type
vector_type::value_type value_type
Definition: std-vector.hpp:430
eigenpy::exposeStdVectorEigenSpecificType
void exposeStdVectorEigenSpecificType(const char *name)
Definition: std-vector.hpp:488
eigenpy::StdVectorPythonVisitor::FromPythonListConverter
StdContainerFromPythonList< vector_type, NoProxy > FromPythonListConverter
Definition: std-vector.hpp:432
eigenpy::internal::ExposeStdMethodToStdVector::visit
void visit(Class &cl) const
Definition: std-vector.hpp:375
ref
Eigen::TensorRef< Tensor > ref(Eigen::TensorRef< Tensor > tensor)
Definition: tensor.cpp:55
eigenpy::StdContainerFromPythonList
Register the conversion from a Python list to a std::vector.
Definition: std-vector.hpp:28
boost::python::extract_to_eigen_ref::result_type
RefType result_type
Definition: std-vector.hpp:138
boost::python::extract_to_eigen_ref::RefType
Eigen::Ref< MatrixType > RefType
Definition: std-vector.hpp:132
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::extract_type
extract< Type & > extract_type
Definition: std-vector.hpp:186
eigenpy
Definition: alignment.hpp:14
eigenpy::StdContainerFromPythonList::register_converter
static void register_converter()
Definition: std-vector.hpp:309
eigenpy::internal::contains_vector_derived_policies::contains
static bool contains(Container &container, key_type const &key)
Definition: std-vector.hpp:354
eigenpy::internal::createExposeStdMethodToStdVector
static ExposeStdMethodToStdVector< Container, NoProxy, CoVisitor > createExposeStdMethodToStdVector(const CoVisitor &co_visitor)
Helper to ease ExposeStdMethodToStdVector construction.
Definition: std-vector.hpp:393
boost::python::extract< Eigen::RefBase< Derived > & >::MatrixType
Eigen::RefBase< Derived > MatrixType
Definition: std-vector.hpp:172
eigen-to-python.hpp
eigenpy::details::overload_base_get_item_for_std_vector::data_type
Container::value_type data_type
Definition: std-vector.hpp:81
boost::python::extract< Eigen::RefBase< Derived > & >::extract
extract(api::object const &o)
Definition: std-vector.hpp:175
eigenpy::details::overload_base_get_item_for_std_vector
Change the behavior of indexing (method getitem in Python). This is suitable for container of Eigen m...
Definition: std-vector.hpp:77
boost::python::extract< Eigen::MatrixBase< Derived > & >::MatrixType
Eigen::MatrixBase< Derived > MatrixType
Definition: std-vector.hpp:163
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::vec_ptr
vector_type * vec_ptr
Definition: std-vector.hpp:231
eigenpy::EmptyPythonVisitor
Definition: std-vector.hpp:399
python
Definition: python.py:1
pickle-vector.hpp
eigenpy::StdContainerFromPythonList::convertible
static void * convertible(PyObject *obj_ptr)
Check if obj_ptr can be converted.
Definition: std-vector.hpp:265
boost::python::extract_to_eigen_ref::extract_to_eigen_ref
extract_to_eigen_ref(PyObject *o)
Definition: std-vector.hpp:142
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::vector_type
std::vector< Type, Allocator > vector_type
Definition: std-vector.hpp:183
test_matrix.value
float value
Definition: test_matrix.py:161
boost::python::extract_to_eigen_ref::base
converter::extract_rvalue< RefType > base
Definition: std-vector.hpp:135
eigenpy::details::container_traits< std::array< _Tp, Size > >::Allocator
void Allocator
Definition: std-vector.hpp:250
eigenpy::details::container_traits
Definition: std-vector.hpp:243
boost::python::extract_to_eigen_ref
Definition: std-vector.hpp:130
eigenpy::StdContainerFromPythonList::tolist
::boost::python::list tolist(vector_type &self, const bool deep_copy=false)
Definition: std-vector.hpp:314
omniidl_be_python_with_docstring.run
def run(tree, args)
Definition: omniidl_be_python_with_docstring.py:140
eigenpy::internal::contains_algo< T, true >::run
static bool run(const Container &container, key_type const &key)
Definition: std-vector.hpp:330
eigenpy::StdVectorPythonVisitor::expose
static void expose(const std::string &class_name, const std::string &doc_string="")
Definition: std-vector.hpp:434
setup.name
name
Definition: setup.in.py:179
eigenpy::EmptyPythonVisitor::visit
void visit(classT &) const
Definition: std-vector.hpp:402
eigenpy.hpp
copyable.hpp
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::operator()
result_type operator()() const
Definition: std-vector.hpp:211
boost::python::extract< Eigen::MatrixBase< Derived > & >::extract
extract(api::object const &o)
Definition: std-vector.hpp:166
eigenpy::StdVectorPythonVisitor::expose
static void expose(const std::string &class_name, const bp::def_visitor< DerivedVisitor > &visitor)
Definition: std-vector.hpp:440
eigenpy::internal::contains_vector_derived_policies
Definition: std-vector.hpp:348
eigenpy::internal::ExposeStdMethodToStdVector
Add standard method to a std::vector.
Definition: std-vector.hpp:365
eigenpy::details::build_list::run
::boost::python::list run(vector_type &vec, const bool deep_copy)
Definition: std-vector.hpp:54
eigenpy::details::overload_base_get_item_for_std_vector::index_type
size_t index_type
Definition: std-vector.hpp:82
eigenpy::StdContainerFromPythonList::T
vector_type::value_type T
Definition: std-vector.hpp:261
boost::python::extract_to_eigen_ref::extract_to_eigen_ref
extract_to_eigen_ref(api::object const &o)
Definition: std-vector.hpp:143
eigenpy::exposeStdVector
void EIGENPY_DLLAPI exposeStdVector()
Definition: std-vector.cpp:10
boost::python::extract< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > & >::extract
extract(api::object const &o)
Definition: std-vector.hpp:157
eigenpy::details::build_list
Definition: std-vector.hpp:53
boost::python::extract< Eigen::MatrixBase< Derived > & >::base
extract_to_eigen_ref< MatrixType > base
Definition: std-vector.hpp:164
eigenpy::StdVectorPythonVisitor::expose
static void expose(const std::string &class_name, const std::string &doc_string, const bp::def_visitor< DerivedVisitor > &visitor)
Definition: std-vector.hpp:446
boost::python::extract< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > & >::extract
extract(PyObject *o)
Definition: std-vector.hpp:156
boost::python::extract< Eigen::RefBase< Derived > & >::base
extract_to_eigen_ref< MatrixType > base
Definition: std-vector.hpp:173
eigenpy::StdContainerFromPythonList::construct
static void construct(PyObject *obj_ptr, boost::python::converter::rvalue_from_python_stage1_data *memory)
Allocate the std::vector and fill it with the element contained in the list.
Definition: std-vector.hpp:287
boost::python::converter::reference_arg_from_python< std::vector< Type, Allocator > & >::reference_arg_from_python
reference_arg_from_python(PyObject *py_obj)
Definition: std-vector.hpp:188


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Apr 26 2024 02:17:35