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 
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 }
Definition: complex.cpp:7
void EIGENPY_DLLAPI enableEigenPy()
Definition: eigenpy.cpp:29
Eigen::Vector4d y_
Definition: user_struct.cpp:5
Eigen::Vector3d x_
Definition: user_struct.cpp:4
mystruct(const Eigen::Vector3d &x, const Eigen::Vector4d &y)
Definition: user_struct.cpp:7
BOOST_PYTHON_MODULE(user_struct)
Definition: user_struct.cpp:10


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 2 2023 02:10:26