Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
500401b3
Verified
Commit
500401b3
authored
Aug 24, 2020
by
Justin Carpentier
Browse files
core: add PlainObjectBase support
parent
abcc7c33
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/details.hpp
View file @
500401b3
...
...
@@ -49,6 +49,20 @@ namespace boost { namespace python { namespace detail {
std
::
size_t
,
value
=
sizeof
(
MatType
));
};
template
<
class
MatType
>
struct
referent_size
<
Eigen
::
PlainObjectBase
<
MatType
>&>
{
BOOST_STATIC_CONSTANT
(
std
::
size_t
,
value
=
sizeof
(
MatType
));
};
template
<
class
MatType
>
struct
referent_size
<
Eigen
::
PlainObjectBase
<
MatType
>
>
{
BOOST_STATIC_CONSTANT
(
std
::
size_t
,
value
=
sizeof
(
MatType
));
};
}}}
namespace
eigenpy
...
...
include/eigenpy/eigen-from-python.hpp
View file @
500401b3
...
...
@@ -173,6 +173,14 @@ namespace boost { namespace python { namespace converter {
EIGENPY_RVALUE_FROM_PYTHON_DATA_INIT
(
Derived
const
&
)
};
/// \brief Template specialization of rvalue_from_python_data
template
<
typename
Derived
>
struct
rvalue_from_python_data
<
Eigen
::
PlainObjectBase
<
Derived
>
const
&>
:
rvalue_from_python_data_eigen
<
Derived
const
&>
{
EIGENPY_RVALUE_FROM_PYTHON_DATA_INIT
(
Derived
const
&
)
};
template
<
typename
MatType
,
int
Options
,
typename
Stride
>
struct
rvalue_from_python_data
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
&>
:
rvalue_from_python_storage
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
&>
...
...
@@ -425,6 +433,10 @@ namespace eigenpy
typedef
Eigen
::
EigenBase
<
MatType
>
EigenBase
;
EigenFromPy
<
EigenBase
>::
registration
();
// Add conversion to Eigen::PlainObjectBase<MatType>
typedef
Eigen
::
PlainObjectBase
<
MatType
>
PlainObjectBase
;
EigenFromPy
<
PlainObjectBase
>::
registration
();
#if EIGEN_VERSION_AT_LEAST(3,2,0)
// Add conversion to Eigen::Ref<MatType>
typedef
Eigen
::
Ref
<
MatType
>
RefType
;
...
...
@@ -464,6 +476,20 @@ namespace eigenpy
&
EigenFromPy
::
construct
,
bp
::
type_id
<
Base
>
());
}
};
template
<
typename
MatType
>
struct
EigenFromPy
<
Eigen
::
PlainObjectBase
<
MatType
>
>
:
EigenFromPy
<
MatType
>
{
typedef
EigenFromPy
<
MatType
>
EigenFromPyDerived
;
typedef
Eigen
::
PlainObjectBase
<
MatType
>
Base
;
static
void
registration
()
{
bp
::
converter
::
registry
::
push_back
(
reinterpret_cast
<
void
*
(
*
)(
_object
*
)
>
(
&
EigenFromPy
::
convertible
),
&
EigenFromPy
::
construct
,
bp
::
type_id
<
Base
>
());
}
};
#if EIGEN_VERSION_AT_LEAST(3,2,0)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment