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
c5e81d54
Verified
Commit
c5e81d54
authored
Aug 18, 2020
by
Justin Carpentier
Browse files
core: swap dimensions if needed
parent
c8dc9359
Pipeline
#10740
passed with stage
in 15 minutes and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/eigen-allocator.hpp
View file @
c5e81d54
...
...
@@ -105,11 +105,11 @@ namespace eigenpy
}
// namespace details
#define EIGENPY_CAST_FROM_PYARRAY_TO_EIGEN_MATRIX(MatType,Scalar,NewScalar,pyArray,mat) \
details::cast_matrix_or_array<Scalar,NewScalar>::run(NumpyMap<MatType,Scalar>::map(pyArray),mat)
details::cast_matrix_or_array<Scalar,NewScalar>::run(NumpyMap<MatType,Scalar>::map(pyArray
,details::check_swap(pyArray,mat)
),mat)
#define EIGENPY_CAST_FROM_EIGEN_MATRIX_TO_PYARRAY(MatType,Scalar,NewScalar,mat,pyArray) \
details::cast_matrix_or_array<Scalar,NewScalar>::run(mat,NumpyMap<MatType,NewScalar>::map(pyArray))
details::cast_matrix_or_array<Scalar,NewScalar>::run(mat,NumpyMap<MatType,NewScalar>::map(pyArray
,details::check_swap(pyArray,mat)
))
template
<
typename
MatType
>
struct
EigenAllocator
{
...
...
@@ -127,7 +127,7 @@ namespace eigenpy
const
int
Scalar_type_code
=
Register
::
getTypeCode
<
Scalar
>
();
if
(
pyArray_type_code
==
Scalar_type_code
)
{
mat
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
);
// avoid useless cast
mat
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
,
details
::
check_swap
(
pyArray
,
mat
)
);
// avoid useless cast
return
;
}
...
...
@@ -175,7 +175,7 @@ namespace eigenpy
if
(
pyArray_type_code
==
Scalar_type_code
)
// no cast needed
{
MapType
map_pyArray
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
);
MapType
map_pyArray
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
,
details
::
check_swap
(
pyArray
,
mat
)
);
map_pyArray
=
mat
;
return
;
}
...
...
@@ -257,7 +257,7 @@ namespace eigenpy
RefType
&
mat
=
*
reinterpret_cast
<
RefType
*>
(
raw_ptr
);
if
(
pyArray_type_code
==
Scalar_type_code
)
{
mat
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
);
// avoid useless cast
mat
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
,
details
::
check_swap
(
pyArray
,
mat
)
);
// avoid useless cast
return
;
}
...
...
@@ -351,7 +351,7 @@ namespace eigenpy
MatType
&
mat
=
*
mat_ptr
;
if
(
pyArray_type_code
==
Scalar_type_code
)
{
mat
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
);
// avoid useless cast
mat
=
NumpyMap
<
MatType
,
Scalar
>::
map
(
pyArray
,
details
::
check_swap
(
pyArray
,
mat
)
);
// avoid useless cast
return
;
}
...
...
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