Skip to content
GitLab
Menu
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
9aabfab7
Verified
Commit
9aabfab7
authored
Aug 18, 2020
by
Justin Carpentier
Browse files
core: add check_swap helper
parent
0fe62d98
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/eigen-allocator.hpp
View file @
9aabfab7
...
...
@@ -66,6 +66,17 @@ namespace eigenpy
}
}
};
template
<
typename
MatType
>
bool
check_swap
(
PyArrayObject
*
pyArray
,
const
Eigen
::
MatrixBase
<
MatType
>
&
mat
)
{
if
(
PyArray_NDIM
(
pyArray
)
==
0
)
return
false
;
if
(
mat
.
rows
()
==
PyArray_DIMS
(
pyArray
)[
0
])
return
false
;
else
return
true
;
}
template
<
typename
Scalar
,
typename
NewScalar
,
bool
cast_is_valid
=
FromTypeToType
<
Scalar
,
NewScalar
>
::
value
>
struct
cast_matrix_or_array
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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