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
1acbed4e
Unverified
Commit
1acbed4e
authored
5 years ago
by
Justin Carpentier
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #125 from jcarpent/devel
Improve conversion checking
parents
ff7cb4da
fd2dcb61
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/eigenpy/details.hpp
+38
-2
38 additions, 2 deletions
include/eigenpy/details.hpp
with
38 additions
and
2 deletions
include/eigenpy/details.hpp
+
38
−
2
View file @
1acbed4e
...
...
@@ -378,17 +378,43 @@ namespace eigenpy
if
(
MatType
::
IsVectorAtCompileTime
)
{
const
Eigen
::
DenseIndex
size_at_compile_time
=
MatType
::
IsRowMajor
?
MatType
::
ColsAtCompileTime
:
MatType
::
RowsAtCompileTime
;
switch
(
PyArray_NDIM
(
pyArray
))
{
case
0
:
return
0
;
case
1
:
return
pyArray
;
{
if
(
size_at_compile_time
!=
Eigen
::
Dynamic
)
{
// check that the sizes at compile time matche
if
(
PyArray_DIMS
(
pyArray
)[
0
]
==
size_at_compile_time
)
return
pyArray
;
else
return
0
;
}
else
// This is a dynamic MatType
return
pyArray
;
}
case
2
:
{
// Special care of scalar matrix of dimension 1x1.
if
(
PyArray_DIMS
(
pyArray
)[
0
]
==
1
&&
PyArray_DIMS
(
pyArray
)[
1
]
==
1
)
return
pyArray
;
{
if
(
size_at_compile_time
!=
Eigen
::
Dynamic
)
{
if
(
size_at_compile_time
==
1
)
return
pyArray
;
else
return
0
;
}
else
// This is a dynamic MatType
return
pyArray
;
}
if
(
PyArray_DIMS
(
pyArray
)[
0
]
>
1
&&
PyArray_DIMS
(
pyArray
)[
1
]
>
1
)
{
...
...
@@ -409,6 +435,16 @@ namespace eigenpy
#endif
return
0
;
}
if
(
size_at_compile_time
!=
Eigen
::
Dynamic
)
{
// This is a fixe size vector
const
Eigen
::
DenseIndex
pyArray_size
=
PyArray_DIMS
(
pyArray
)[
0
]
>
PyArray_DIMS
(
pyArray
)[
1
]
?
PyArray_DIMS
(
pyArray
)[
0
]
:
PyArray_DIMS
(
pyArray
)[
1
];
if
(
size_at_compile_time
!=
pyArray_size
)
return
0
;
}
break
;
}
default
:
...
...
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