Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
eigenpy
Commits
500401b3
Verified
Commit
500401b3
authored
4 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: add PlainObjectBase support
parent
abcc7c33
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/eigenpy/details.hpp
+14
-0
14 additions, 0 deletions
include/eigenpy/details.hpp
include/eigenpy/eigen-from-python.hpp
+26
-0
26 additions, 0 deletions
include/eigenpy/eigen-from-python.hpp
with
40 additions
and
0 deletions
include/eigenpy/details.hpp
+
14
−
0
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
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/eigen-from-python.hpp
+
26
−
0
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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment