From 723f11309ac738687cb30f486acb72f3566bbbfc Mon Sep 17 00:00:00 2001 From: jcarpent <jcarpent@laas.fr> Date: Mon, 3 Oct 2016 17:18:08 +0200 Subject: [PATCH] [C++] Make std::cerr only in debud mode for the check of convertibility --- src/details.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/details.hpp b/src/details.hpp index 2c724f85..9ab072b0 100644 --- a/src/details.hpp +++ b/src/details.hpp @@ -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; } -- GitLab