user_struct.cpp
Go to the documentation of this file.
1 #include "eigenpy/eigenpy.hpp"
2 
3 struct mystruct {
4  Eigen::Vector3d x_;
5  Eigen::Vector4d y_;
6 
7  mystruct(const Eigen::Vector3d& x, const Eigen::Vector4d& y) : x_(x), y_(y) {}
8 };
9 
10 BOOST_PYTHON_MODULE(user_struct) {
11  using namespace Eigen;
12  namespace bp = boost::python;
14  bp::class_<mystruct>("MyStruct", bp::init<const Vector3d&, const Vector4d&>())
15  .add_property(
16  "x",
17  bp::make_getter(&mystruct::x_, bp::return_internal_reference<>()),
18  bp::make_setter(&mystruct::x_))
19  .add_property(
20  "y",
21  bp::make_getter(&mystruct::y_, bp::return_internal_reference<>()),
22  bp::make_setter(&mystruct::y_));
23 }
boost::python
Definition: alignment.hpp:49
Eigen
Definition: complex.cpp:7
eigenpy::enableEigenPy
void EIGENPY_DLLAPI enableEigenPy()
Definition: eigenpy.cpp:43
test_user_struct.y
y
Definition: test_user_struct.py:5
mystruct::y_
Eigen::Vector4d y_
Definition: user_struct.cpp:5
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(user_struct)
Definition: user_struct.cpp:10
mystruct::x_
Eigen::Vector3d x_
Definition: user_struct.cpp:4
test_user_struct.x
x
Definition: test_user_struct.py:4
eigenpy.hpp
mystruct::mystruct
mystruct(const Eigen::Vector3d &x, const Eigen::Vector4d &y)
Definition: user_struct.cpp:7
mystruct
Definition: user_struct.cpp:3


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45