Skip to content

Commit 81e364c

Browse files
committed
core: template specialization for sized Eigen::{MatrixBase,EigenBase}
1 parent 2451ff4 commit 81e364c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

include/eigenpy/details.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@
2020

2121
#define GET_PY_ARRAY_TYPE(array) PyArray_ObjectType(reinterpret_cast<PyObject *>(array), 0)
2222

23+
namespace boost { namespace python { namespace detail {
24+
25+
template<class MatType>
26+
struct referent_size<Eigen::MatrixBase<MatType>&>
27+
{
28+
BOOST_STATIC_CONSTANT(
29+
std::size_t, value = sizeof(MatType));
30+
};
31+
32+
template<class MatType>
33+
struct referent_size<Eigen::EigenBase<MatType>&>
34+
{
35+
BOOST_STATIC_CONSTANT(
36+
std::size_t, value = sizeof(MatType));
37+
};
38+
39+
}}}
40+
2341
namespace eigenpy
2442
{
2543
template <typename SCALAR> struct NumpyEquivalentType {};

0 commit comments

Comments
 (0)