Skip to content
Snippets Groups Projects
Verified Commit e1075eda authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: fix checking of dimensions

parent 53c3c6ae
No related branches found
No related tags found
No related merge requests found
......@@ -265,6 +265,19 @@ namespace eigenpy
}
}
if (PyArray_NDIM(obj_ptr) == 2)
{
const int R = (int)PyArray_DIMS(obj_ptr)[0];
const int C = (int)PyArray_DIMS(obj_ptr)[1];
if( (MatType::RowsAtCompileTime!=R)
&& (MatType::RowsAtCompileTime!=Eigen::Dynamic) )
return 0;
if( (MatType::ColsAtCompileTime!=C)
&& (MatType::ColsAtCompileTime!=Eigen::Dynamic) )
return 0;
}
// Check if the Scalar type of the obj_ptr is compatible with the Scalar type of MatType
if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(obj_ptr), 0)) == NPY_INT)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment