Skip to content
Snippets Groups Projects
Commit 723f1130 authored by jcarpent's avatar jcarpent
Browse files

[C++] Make std::cerr only in debud mode for the check of convertibility

parent 92f9eb14
No related branches found
No related tags found
No related merge requests found
......@@ -146,26 +146,34 @@ namespace eigenpy
if (!PyArray_Check(obj_ptr))
{
#ifndef NDEBUG
std::cerr << "The python object is not a numpy array." << std::endl;
#endif
return 0;
}
if (PyArray_NDIM(obj_ptr) != 2)
if ( (PyArray_NDIM(obj_ptr) !=1) || (! MatType::IsVectorAtCompileTime) )
{
#ifndef NDEBUG
std::cerr << "The number of dimension of the object is not correct." << std::endl;
#endif
return 0;
}
if ((PyArray_ObjectType(obj_ptr, 0)) != NumpyEquivalentType<T>::type_code)
{
#ifndef NDEBUG
std::cerr << "The internal type as no Eigen equivalent." << std::endl;
#endif
return 0;
}
if (!(PyArray_FLAGS(obj_ptr) & NPY_ALIGNED))
{
#ifndef NDEBUG
std::cerr << "NPY non-aligned matrices are not implemented." << std::endl;
#endif
return 0;
}
......
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