Skip to content

Commit a51d8fb

Browse files
committed
Expose some std::vector of Eigen Vector & Matrix
* add test_std_vector.py * fix copyable.hpp's include guards & namespace * same for pickle-vector * expose std::vector for VectorXd, MatrixXd, VectorXi, MatrixXi
1 parent d902b08 commit a51d8fb

File tree

8 files changed

+374
-439
lines changed

8 files changed

+374
-439
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ set(${PROJECT_NAME}_HEADERS
155155
include/eigenpy/user-type.hpp
156156
include/eigenpy/ufunc.hpp
157157
include/eigenpy/register.hpp
158-
include/eigenpy/std-aligned-vector.hpp
159158
include/eigenpy/std-map.hpp
160159
include/eigenpy/std-vector.hpp
161160
include/eigenpy/pickle-vector.hpp
@@ -199,6 +198,7 @@ set(${PROJECT_NAME}_SOURCES
199198
src/angle-axis.cpp
200199
src/quaternion.cpp
201200
src/geometry-conversion.cpp
201+
src/std-vector.cpp
202202
src/version.cpp)
203203

204204
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES}

Diff for: include/eigenpy/copyable.hpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
// Copyright (c) 2016-2021 CNRS INRIA
33
//
44

5-
#ifndef __pinocchio_python_utils_copyable_hpp__
6-
#define __pinocchio_python_utils_copyable_hpp__
5+
#ifndef __eigenpy_utils_copyable_hpp__
6+
#define __eigenpy_utils_copyable_hpp__
77

88
#include <boost/python.hpp>
99

10-
namespace pinocchio {
11-
namespace python {
10+
namespace eigenpy {
1211

1312
namespace bp = boost::python;
1413

@@ -26,7 +25,6 @@ struct CopyableVisitor : public bp::def_visitor<CopyableVisitor<C> > {
2625
private:
2726
static C copy(const C& self) { return C(self); }
2827
};
29-
} // namespace python
30-
} // namespace pinocchio
28+
} // namespace eigenpy
3129

32-
#endif // ifndef __pinocchio_python_utils_copyable_hpp__
30+
#endif // ifndef __eigenpy_utils_copyable_hpp__

Diff for: include/eigenpy/pickle-vector.hpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
// Copyright (c) 2019-2020 CNRS INRIA
33
//
44

5-
#ifndef __pinocchio_python_utils_pickle_vector_hpp__
6-
#define __pinocchio_python_utils_pickle_vector_hpp__
5+
#ifndef __eigenpy_utils_pickle_vector_hpp__
6+
#define __eigenpy_utils_pickle_vector_hpp__
77

88
#include <boost/python.hpp>
99
#include <boost/python/stl_iterator.hpp>
1010
#include <boost/python/tuple.hpp>
1111

12-
namespace pinocchio {
13-
namespace python {
12+
namespace eigenpy {
1413
///
1514
/// \brief Create a pickle interface for the std::vector
1615
///
@@ -42,7 +41,6 @@ struct PickleVector : boost::python::pickle_suite {
4241

4342
static bool getstate_manages_dict() { return true; }
4443
};
45-
} // namespace python
46-
} // namespace pinocchio
44+
} // namespace eigenpy
4745

48-
#endif // ifndef __pinocchio_python_utils_pickle_vector_hpp__
46+
#endif // ifndef __eigenpy_utils_pickle_vector_hpp__

Diff for: include/eigenpy/std-aligned-vector.hpp

-85
This file was deleted.

0 commit comments

Comments
 (0)