Verified Commit c5e81d54 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: swap dimensions if needed

parent c8dc9359
Pipeline #10740 passed with stage
in 15 minutes and 53 seconds
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment