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
1acbed4e
Unverified
Commit
1acbed4e
authored
Nov 16, 2019
by
Justin Carpentier
Committed by
GitHub
Nov 16, 2019
Browse files
Merge pull request #125 from jcarpent/devel
Improve conversion checking
parents
ff7cb4da
fd2dcb61
Pipeline
#6940
passed with stage
in 8 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/details.hpp
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:
...
...
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