wbc
eigen_conversion.h
Go to the documentation of this file.
1// MIT License
2
3// Copyright (c) 2019 Vincent SAMY
4
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23#pragma once
24
25#include <eigen3/Eigen/Core>
26#include <boost/python.hpp>
27#include <boost/python/implicit.hpp>
28#include <boost/python/module.hpp>
29#include <boost/python/numpy.hpp>
30
31namespace py = boost::python;
32namespace np = boost::python::numpy;
33
34namespace pygen {
35
36/*
37 * ***************** List -> Eigen converters *****************
38 */
39
40
46template <class VectorType>
49 {
50 py::converter::registry::push_back(&convertible, &construct, py::type_id<VectorType>());
51 }
52
53 static void* convertible(PyObject* obj_ptr)
54 {
55 static_assert(VectorType::ColsAtCompileTime == 1 || VectorType::RowsAtCompileTime == 1, "Passed a Matrix into a Vector generator"); // Only for vectors conversion
56
57 if (!PySequence_Check(obj_ptr)
58 || (VectorType::ColsAtCompileTime == 1 && VectorType::RowsAtCompileTime != Eigen::Dynamic
59 && (PySequence_Size(obj_ptr) != VectorType::RowsAtCompileTime)) // Check Fixed-size vector
60 || (VectorType::RowsAtCompileTime == 1 && VectorType::ColsAtCompileTime != Eigen::Dynamic
61 && (PySequence_Size(obj_ptr) != VectorType::ColsAtCompileTime))) // Check Fixed-size row vector
62 return 0;
63
64 if (VectorType::ColsAtCompileTime == 1 && VectorType::RowsAtCompileTime != Eigen::Dynamic && (PySequence_Size(obj_ptr) != VectorType::RowsAtCompileTime))
65 return 0;
66
67 py::list arr = py::extract<py::list>(obj_ptr);
68 for (long i = 0; i < py::len(arr); i++)
69 if (!py::extract<typename VectorType::Scalar>(arr[i]).check())
70 return 0;
71
72 return obj_ptr;
73 }
74
75 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
76 {
77 py::list arr = py::extract<py::list>(obj_ptr);
78 auto len = py::len(arr);
79
80 using storage_type = py::converter::rvalue_from_python_storage<VectorType>;
81 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
82
83 new (storage) VectorType;
84 VectorType& vec = *static_cast<VectorType*>(storage);
85
86 if (VectorType::RowsAtCompileTime == Eigen::Dynamic || VectorType::ColsAtCompileTime == Eigen::Dynamic)
87 vec.resize(len);
88
89 for (long i = 0; i < len; ++i)
90 vec(i) = py::extract<typename VectorType::Scalar>(arr[i]);
91
92 data->convertible = storage;
93 }
94};
95
101template <class MatrixType>
104 {
105 py::converter::registry::push_back(&convertible, &construct, py::type_id<MatrixType>());
106 }
107
108 static void* convertible(PyObject* obj_ptr)
109 {
110 static_assert(MatrixType::ColsAtCompileTime != 1 && MatrixType::RowsAtCompileTime != 1, "Passed a Vector into a Matrix generator"); // Only for matrix conversion
111
112 auto checkNestedList = [](const py::list& list) {
113 py::extract<py::list> nested_list(list[0]);
114 if (!nested_list.check())
115 return false;
116
117 auto cols = py::len(nested_list());
118 for (long i = 1; i < py::len(list); ++i) {
119 py::extract<py::list> nested_list(list[i]);
120 if (!nested_list.check() || py::len(nested_list) != cols) // Check nested list size
121 return false;
122 for (long j = 0; j < cols; ++j)
123 if (!py::extract<typename MatrixType::Scalar>(nested_list()[j]).check()) // Check list type
124 return false;
125 }
126
127 return true;
128 };
129
130 py::extract<py::list> extract_list(obj_ptr);
131 py::extract<py::list> extract_nested_list(extract_list());
132 if (!extract_list.check() // Check list
133 || !checkNestedList(extract_list()) // Check nested lists
134 || (MatrixType::RowsAtCompileTime != Eigen::Dynamic && MatrixType::RowsAtCompileTime != py::len(extract_list())) // Check rows are the same
135 || (MatrixType::ColsAtCompileTime != Eigen::Dynamic && MatrixType::ColsAtCompileTime != py::len(extract_nested_list()))) // Check cols are the same
136 return 0;
137
138 return obj_ptr;
139 }
140
141 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
142 {
143 py::list arr = py::extract<py::list>(obj_ptr);
144 auto rows = py::len(arr);
145 auto cols = py::len(py::extract<py::list>(arr[0])());
146
147 using storage_type = py::converter::rvalue_from_python_storage<MatrixType>;
148 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
149
150 new (storage) MatrixType;
151 MatrixType& mat = *static_cast<MatrixType*>(storage);
152
153 // Resize matrix if (half-)dynamic-sized matrix
154 if (MatrixType::RowsAtCompileTime == Eigen::Dynamic || MatrixType::ColsAtCompileTime == Eigen::Dynamic)
155 mat.resize(rows, cols);
156
157 for (long i = 0; i < rows; ++i)
158 for (long j = 0; j < cols; ++j)
159 mat(i, j) = py::extract<typename MatrixType::Scalar>(arr[i][j]);
160
161 data->convertible = storage;
162 }
163};
164
169template <class QuaternionType>
172 {
173 py::converter::registry::push_back(&convertible, &construct, py::type_id<QuaternionType>());
174 }
175
176 static void* convertible(PyObject* obj_ptr)
177 {
178 //static_assert(QuaternionType::ColsAtCompileTime == 1 || QuaternionType::RowsAtCompileTime == 1, "Passed a Matrix into a Vector generator"); // Only for vectors conversion
179
180 if (!PySequence_Check(obj_ptr)
181 || (PySequence_Size(obj_ptr) != 4)) // Check Fixed-size vector
182 return 0;
183
184 if (PySequence_Size(obj_ptr) != 4)
185 return 0;
186
187 py::list arr = py::extract<py::list>(obj_ptr);
188 for (long i = 0; i < py::len(arr); i++)
189 if (!py::extract<typename QuaternionType::Scalar>(arr[i]).check())
190 return 0;
191
192 return obj_ptr;
193 }
194
195 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
196 {
197 py::list arr = py::extract<py::list>(obj_ptr);
198 auto len = py::len(arr);
199
200 using storage_type = py::converter::rvalue_from_python_storage<QuaternionType>;
201 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
202
203 new (storage) QuaternionType;
204 QuaternionType& vec = *static_cast<QuaternionType*>(storage);
205
206 vec.x() = py::extract<typename QuaternionType::Scalar>(arr[0]);
207 vec.y() = py::extract<typename QuaternionType::Scalar>(arr[1]);
208 vec.z() = py::extract<typename QuaternionType::Scalar>(arr[2]);
209 vec.w() = py::extract<typename QuaternionType::Scalar>(arr[3]);
210
211 data->convertible = storage;
212 }
213};
214
219template <class TransformType>
222 {
223 py::converter::registry::push_back(&convertible, &construct, py::type_id<TransformType>());
224 }
225
226 static void* convertible(PyObject* obj_ptr)
227 {
228 static_assert(TransformType::Dim != 1, "Passed a Vector into a Matrix generator"); // Only for matrix conversion
229
230 auto checkNestedList = [](const py::list& list) {
231 py::extract<py::list> nested_list(list[0]);
232 if (!nested_list.check())
233 return false;
234
235 auto cols = py::len(nested_list());
236 for (long i = 1; i < py::len(list); ++i) {
237 py::extract<py::list> nested_list(list[i]);
238 if (!nested_list.check() || py::len(nested_list) != cols) // Check nested list size
239 return false;
240 for (long j = 0; j < cols; ++j)
241 if (!py::extract<typename TransformType::Scalar>(nested_list()[j]).check()) // Check list type
242 return false;
243 }
244
245 return true;
246 };
247
248 py::extract<py::list> extract_list(obj_ptr);
249 py::extract<py::list> extract_nested_list(extract_list());
250 if (!extract_list.check() // Check list
251 || !checkNestedList(extract_list()) // Check nested lists
252 || (TransformType::Dim != py::len(extract_list())) // Check rows are the same
253 || (TransformType::Dim != py::len(extract_nested_list()))) // Check cols are the same
254 return 0;
255
256 return obj_ptr;
257 }
258
259 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
260 {
261 py::list arr = py::extract<py::list>(obj_ptr);
262 auto rows = py::len(arr);
263 auto cols = py::len(py::extract<py::list>(arr[0])());
264
265 using storage_type = py::converter::rvalue_from_python_storage<TransformType>;
266 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
267
268 new (storage) TransformType;
269 TransformType& mat = *static_cast<TransformType*>(storage);
270
271 // Resize matrix if (half-)dynamic-sized matrix
272 //if (TransformType::RowsAtCompileTime == Eigen::Dynamic || TransformType::ColsAtCompileTime == Eigen::Dynamic)
273 // mat.resize(rows, cols);
274
275 for (long i = 0; i < rows; ++i)
276 for (long j = 0; j < cols; ++j)
277 mat(i, j) = py::extract<typename TransformType::Scalar>(arr[i][j]);
278
279 data->convertible = storage;
280 }
281};
282
283
284/*
285 * ***************** Numpy -> Eigen converters *****************
286 */
287
293template <typename VectorType>
296 {
297 py::converter::registry::push_back(&convertible, &construct, py::type_id<VectorType>());
298 }
299
300 static void* convertible(PyObject* obj_ptr)
301 {
302 static_assert(VectorType::RowsAtCompileTime == 1 || VectorType::ColsAtCompileTime == 1, "Passed a Matrix into a Vector generator"); // Check that in c++ side, it is an Eigen vector
303 py::extract<np::ndarray> arr(obj_ptr);
304 if (!arr.check() // Check it is a numpy array
305 || arr().get_nd() != 1 // Check array dimension (does not allow numpy array of type (1, 3), needs to ravel it first)
306 || arr().get_dtype() != np::dtype::get_builtin<typename VectorType::Scalar>() // Check type
307 || (VectorType::RowsAtCompileTime == 1
308 && VectorType::ColsAtCompileTime != Eigen::Dynamic
309 && VectorType::ColsAtCompileTime != arr().shape(0)) // Check vector size in case of fixed-size array (for a row-vector)
310 || (VectorType::ColsAtCompileTime == 1
311 && VectorType::RowsAtCompileTime != Eigen::Dynamic
312 && VectorType::RowsAtCompileTime != arr().shape(0))) // Check vector size in case of fixed-size array (for a column-vector)
313 return 0;
314
315 return obj_ptr;
316 }
317
318 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
319 {
320 np::ndarray arr = py::extract<np::ndarray>(obj_ptr);
321
322 using storage_type = py::converter::rvalue_from_python_storage<VectorType>;
323 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
324
325 new (storage) VectorType;
326 VectorType& vec = *static_cast<VectorType*>(storage);
327 // Resize for dynamic-sized matrices
328 if (VectorType::RowsAtCompileTime == Eigen::Dynamic || VectorType::ColsAtCompileTime == Eigen::Dynamic)
329 vec.resize(arr.shape(0));
330
331 // Extract values. The type has been check in the convertible function
332 for (int i = 0; i < arr.shape(0); ++i)
333 vec(i) = py::extract<typename VectorType::Scalar>(arr[i]);
334
335 data->convertible = storage;
336 }
337};
338
344template <typename MatrixType>
347 {
348 py::converter::registry::push_back(&convertible, &construct, py::type_id<MatrixType>());
349 }
350
351 static void* convertible(PyObject* obj_ptr)
352 {
353 static_assert(MatrixType::ColsAtCompileTime != 1 && MatrixType::RowsAtCompileTime != 1, "Passed a Vector into a Matrix generator"); // Only for matrix conversion
354
355 py::extract<np::ndarray> arr(obj_ptr);
356 if (!arr.check() // Check it is a numpy array
357 || arr().get_nd() != 2 // Check array dimension
358 || arr().get_dtype() != np::dtype::get_builtin<typename MatrixType::Scalar>() // Check type
359 || (MatrixType::RowsAtCompileTime != Eigen::Dynamic && MatrixType::RowsAtCompileTime != arr().shape(0)) // Check rows are the same
360 || (MatrixType::ColsAtCompileTime != Eigen::Dynamic && MatrixType::ColsAtCompileTime != arr().shape(1))) // Check cols are the same
361 return 0;
362
363 return obj_ptr;
364 }
365
366 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
367 {
368 np::ndarray arr = py::extract<np::ndarray>(obj_ptr);
369
370 using storage_type = py::converter::rvalue_from_python_storage<MatrixType>;
371 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
372
373 new (storage) MatrixType;
374 MatrixType& mat = *static_cast<MatrixType*>(storage);
375 // Resize for dynamic-sized matrices
376 // For half dynamic-sized matrices, the fixed-size part has been check in the convertible function
377 if (MatrixType::RowsAtCompileTime == Eigen::Dynamic || MatrixType::ColsAtCompileTime == Eigen::Dynamic)
378 mat.resize(arr.shape(0), arr.shape(1));
379
380 // Extract values. The type has been check in the convertible function
381 for (int i = 0; i < arr.shape(0); ++i)
382 for (int j = 0; j < arr.shape(1); ++j)
383 mat(i, j) = py::extract<typename MatrixType::Scalar>(arr[i][j]);
384
385 data->convertible = storage;
386 }
387};
388
389template <typename QuaternionType>
392 {
393 py::converter::registry::push_back(&convertible, &construct, py::type_id<QuaternionType>());
394 }
395
396 static void* convertible(PyObject* obj_ptr)
397 {
398 //static_assert(QuaternionType::RowsAtCompileTime == 1 || QuaternionType::ColsAtCompileTime == 1, "Passed a Matrix into a Vector generator"); // Check that in c++ side, it is an Eigen vector
399 py::extract<np::ndarray> arr(obj_ptr);
400 if (!arr.check() // Check it is a numpy array
401 || arr().get_nd() != 1 // Check array dimension (does not allow numpy array of type (1, 3), needs to ravel it first)
402 || arr().get_dtype() != np::dtype::get_builtin<typename QuaternionType::Scalar>() // Check type
403 || 4 != arr().shape(0) // Check vector size in case of fixed-size array (for a row-vector)
404 || 4 != arr().shape(0)) // Check vector size in case of fixed-size array (for a column-vector)
405 return 0;
406
407 return obj_ptr;
408 }
409
410 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
411 {
412 np::ndarray arr = py::extract<np::ndarray>(obj_ptr);
413
414 using storage_type = py::converter::rvalue_from_python_storage<QuaternionType>;
415 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
416
417 new (storage) QuaternionType;
418 QuaternionType& vec = *static_cast<QuaternionType*>(storage);
419 // Resize for dynamic-sized matrices
420 //if (QuaternionType::RowsAtCompileTime == Eigen::Dynamic || QuaternionType::ColsAtCompileTime == Eigen::Dynamic)
421 // vec.resize(arr.shape(0));
422
423 // Extract values. The type has been check in the convertible function
424 vec.x() = py::extract<typename QuaternionType::Scalar>(arr[0]);
425 vec.y() = py::extract<typename QuaternionType::Scalar>(arr[1]);
426 vec.z() = py::extract<typename QuaternionType::Scalar>(arr[2]);
427 vec.w() = py::extract<typename QuaternionType::Scalar>(arr[3]);
428
429 data->convertible = storage;
430 }
431};
432
433template <typename TransformType>
436 {
437 py::converter::registry::push_back(&convertible, &construct, py::type_id<TransformType>());
438 }
439
440 static void* convertible(PyObject* obj_ptr)
441 {
442 static_assert(TransformType::Dim != 1, "Passed a Vector into a Matrix generator"); // Only for matrix conversion
443
444 py::extract<np::ndarray> arr(obj_ptr);
445 if (!arr.check() // Check it is a numpy array
446 || arr().get_nd() != 2 // Check array dimension
447 || arr().get_dtype() != np::dtype::get_builtin<typename TransformType::Scalar>() // Check type
448 || TransformType::Dim != arr().shape(0) // Check rows are the same
449 || TransformType::Dim != arr().shape(1)) // Check cols are the same
450 return 0;
451
452 return obj_ptr;
453 }
454
455 static void construct(PyObject* obj_ptr, py::converter::rvalue_from_python_stage1_data* data)
456 {
457 np::ndarray arr = py::extract<np::ndarray>(obj_ptr);
458
459 using storage_type = py::converter::rvalue_from_python_storage<TransformType>;
460 void* storage = reinterpret_cast<storage_type*>(data)->storage.bytes;
461
462 new (storage) TransformType;
463 TransformType& mat = *static_cast<TransformType*>(storage);
464 // Resize for dynamic-sized matrices
465 // For half dynamic-sized matrices, the fixed-size part has been check in the convertible function
466 //if (TransformType::Dim == Eigen::Dynamic || TransformType::Dim == Eigen::Dynamic)
467 // mat.resize(arr.shape(0), arr.shape(1));
468
469 // Extract values. The type has been check in the convertible function
470 for (int i = 0; i < arr.shape(0); ++i)
471 for (int j = 0; j < arr.shape(1); ++j)
472 mat(i, j) = py::extract<typename TransformType::Scalar>(arr[i][j]);
473
474 data->convertible = storage;
475 }
476};
477
478/*
479 * ****************** Eigen -> Numpy converters ******************
480 */
481
487template <typename VectorType>
489 static PyObject* convert(const VectorType& mat)
490 {
491 static_assert(VectorType::ColsAtCompileTime == 1 || VectorType::RowsAtCompileTime == 1, "Passed a Matrix into a Vector generator"); // Ensure that it is a vector
492
493 np::dtype dt = np::dtype::get_builtin<typename VectorType::Scalar>();
494 auto shape = py::make_tuple(mat.size());
495 np::ndarray mOut = np::empty(shape, dt);
496
497 for (Eigen::Index i = 0; i < mat.size(); ++i)
498 mOut[i] = mat(i);
499
500 return py::incref(mOut.ptr());
501 }
502};
503
509template <typename MatrixType>
511 static PyObject* convert(const MatrixType& mat)
512 {
513 static_assert(MatrixType::ColsAtCompileTime != 1 && MatrixType::RowsAtCompileTime != 1, "Passed a Vector into a Matrix generator"); // Ensure that it is not a vector
514
515 np::dtype dt = np::dtype::get_builtin<typename MatrixType::Scalar>();
516 auto shape = py::make_tuple(mat.rows(), mat.cols());
517 np::ndarray mOut = np::empty(shape, dt);
518
519 for (Eigen::Index i = 0; i < mat.rows(); ++i)
520 for (Eigen::Index j = 0; j < mat.cols(); ++j)
521 mOut[i][j] = mat(i, j);
522
523 return py::incref(mOut.ptr());
524 }
525};
526
532template <typename QuaternionType>
534 static PyObject* convert(const QuaternionType& mat)
535 {
536 //static_assert(VectorType::ColsAtCompileTime == 1 || VectorType::RowsAtCompileTime == 1, "Passed a Matrix into a Vector generator"); // Ensure that it is a vector
537
538 np::dtype dt = np::dtype::get_builtin<typename QuaternionType::Scalar>();
539 auto shape = py::make_tuple(4);
540 np::ndarray mOut = np::empty(shape, dt);
541
542 for (Eigen::Index i = 0; i < 4; ++i)
543 mOut[i] = mat.coeffs()[i];
544
545 return py::incref(mOut.ptr());
546 }
547};
548
553template <typename TransformType>
555 static PyObject* convert(const TransformType& mat)
556 {
557 static_assert(TransformType::Dim != 1, "Passed a Vector into a Matrix generator"); // Ensure that it is not a vector
558
559 np::dtype dt = np::dtype::get_builtin<typename TransformType::Scalar>();
560 auto shape = py::make_tuple(mat.rows(), mat.cols());
561 np::ndarray mOut = np::empty(shape, dt);
562
563 for (Eigen::Index i = 0; i < mat.rows(); ++i)
564 for (Eigen::Index j = 0; j < mat.cols(); ++j)
565 mOut[i][j] = mat(i, j);
566
567 return py::incref(mOut.ptr());
568 }
569};
570
571/*
572 * **************************************** Main converters *******************************************
573 */
574
579template <typename MatrixType>
580void convertMatrix(bool isListConvertible = true)
581{
582 // python -> eigen
584
585 // list -> eigen
586 if (isListConvertible)
588
589 // eigen -> python
590 py::to_python_converter<MatrixType, eigen_matrix_to_numpy_array<MatrixType> >(); // Vector2<T>
591}
592
597template <typename QuaternionType>
598void convertQuaternion(bool isListConvertible = true)
599{
600 // python -> eigen
602
603 // list -> eigen
604 if (isListConvertible)
606
607 // eigen -> python
608 py::to_python_converter<QuaternionType, eigen_quaternion_to_numpy_array<QuaternionType> >();
609}
610
615template <typename TransformType>
616void convertTransform(bool isListConvertible = true)
617{
618 // python -> eigen
620
621 // list -> eigen
622 if (isListConvertible)
624
625 // eigen -> python
626 py::to_python_converter<TransformType, eigen_transform_to_numpy_array<TransformType> >(); // Vector2<T>
627}
628
633template <typename VectorType>
634void convertVector(bool isListConvertible = true)
635{
636 // python -> eigen
638
639 // list -> eigen
640 if (isListConvertible)
642
643 // eigen -> python
644 py::to_python_converter<VectorType, eigen_vector_to_numpy_array<VectorType> >();
645}
646
647} // namespace pygen
Definition base_types_conversion.h:41
void convertMatrix(bool isListConvertible=true)
Definition eigen_conversion.h:580
void convertQuaternion(bool isListConvertible=true)
Definition eigen_conversion.h:598
void convertVector(bool isListConvertible=true)
Definition eigen_conversion.h:634
void convertTransform(bool isListConvertible=true)
Definition eigen_conversion.h:616
Definition eigen_conversion.h:510
static PyObject * convert(const MatrixType &mat)
Definition eigen_conversion.h:511
Definition eigen_conversion.h:533
static PyObject * convert(const QuaternionType &mat)
Definition eigen_conversion.h:534
Definition eigen_conversion.h:554
static PyObject * convert(const TransformType &mat)
Definition eigen_conversion.h:555
Definition eigen_conversion.h:488
static PyObject * convert(const VectorType &mat)
Definition eigen_conversion.h:489
Definition eigen_conversion.h:345
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:351
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:366
numpy_array_to_eigen_matrix()
Definition eigen_conversion.h:346
Definition eigen_conversion.h:390
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:410
numpy_array_to_eigen_quaternion()
Definition eigen_conversion.h:391
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:396
Definition eigen_conversion.h:434
numpy_array_to_eigen_transform()
Definition eigen_conversion.h:435
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:440
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:455
Definition eigen_conversion.h:294
numpy_array_to_eigen_vector()
Definition eigen_conversion.h:295
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:318
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:300
Definition eigen_conversion.h:102
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:108
python_list_to_eigen_matrix()
Definition eigen_conversion.h:103
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:141
Definition eigen_conversion.h:170
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:195
python_list_to_eigen_quaternion()
Definition eigen_conversion.h:171
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:176
Definition eigen_conversion.h:220
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:259
python_list_to_eigen_transform()
Definition eigen_conversion.h:221
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:226
Definition eigen_conversion.h:47
python_list_to_eigen_vector()
Definition eigen_conversion.h:48
static void construct(PyObject *obj_ptr, py::converter::rvalue_from_python_stage1_data *data)
Definition eigen_conversion.h:75
static void * convertible(PyObject *obj_ptr)
Definition eigen_conversion.h:53