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
Stack Of Tasks
eigenpy
Commits
031524b2
Commit
031524b2
authored
2 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: simplify the code for EigenToPy class
parent
d184a68e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/eigenpy/eigen-to-python.hpp
+12
-7
12 additions, 7 deletions
include/eigenpy/eigen-to-python.hpp
with
12 additions
and
7 deletions
include/eigenpy/eigen-to-python.hpp
+
12
−
7
View file @
031524b2
//
// Copyright (c) 2014-202
0
CNRS INRIA
// Copyright (c) 2014-202
3
CNRS INRIA
//
#ifndef __eigenpy_eigen_to_python_hpp__
...
...
@@ -60,8 +60,10 @@ struct to_python_indirect<
namespace
eigenpy
{
template
<
typename
MatType
,
typename
_Scalar
>
struct
EigenToPy
{
EIGENPY_DOCUMENTATION_START_IGNORE
template
<
typename
MatType
,
typename
Scalar
>
struct
eigen_to_py_impl
{
static
PyObject
*
convert
(
typename
boost
::
add_reference
<
typename
boost
::
add_const
<
MatType
>::
type
>::
type
mat
)
{
...
...
@@ -91,12 +93,10 @@ struct EigenToPy {
// Create an instance (either np.array or np.matrix)
return
NumpyType
::
make
(
pyArray
).
ptr
();
}
static
PyTypeObject
const
*
get_pytype
()
{
return
getPyArrayType
();
}
};
template
<
typename
MatType
,
int
Options
,
typename
Stride
,
typename
_
Scalar
>
struct
E
igen
ToPy
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
,
_
Scalar
>
{
template
<
typename
MatType
,
int
Options
,
typename
Stride
,
typename
Scalar
>
struct
e
igen
_to_py_impl
<
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
,
Scalar
>
{
static
PyObject
*
convert
(
const
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>&
mat
)
{
typedef
Eigen
::
Ref
<
MatType
,
Options
,
Stride
>
EigenRef
;
...
...
@@ -123,7 +123,12 @@ struct EigenToPy<Eigen::Ref<MatType, Options, Stride>, _Scalar> {
// Create an instance (either np.array or np.matrix)
return
NumpyType
::
make
(
pyArray
).
ptr
();
}
};
EIGENPY_DOCUMENTATION_END_IGNORE
template
<
typename
MatType
,
typename
Scalar
>
struct
EigenToPy
:
eigen_to_py_impl
<
MatType
,
Scalar
>
{
static
PyTypeObject
const
*
get_pytype
()
{
return
getPyArrayType
();
}
};
...
...
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