@@ -104,50 +104,50 @@ namespace eigenpy
104104 EigenFromPy ()
105105 {
106106 bp::converter::registry::push_back
107- (reinterpret_cast <void *(*)(_object *)>(&convertible),
108- &construct,bp::type_id<MatType>());
107+ (reinterpret_cast <void *(*)(_object *)>(&convertible),
108+ &construct,bp::type_id<MatType>());
109109 }
110-
110+
111111 // Determine if obj_ptr can be converted in a Eigenvec
112112 static void * convertible (PyArrayObject* obj_ptr)
113113 {
114114 typedef typename MatType::Scalar T;
115-
116- if (!PyArray_Check (obj_ptr))
117- {
115+
116+ if (!PyArray_Check (obj_ptr))
117+ {
118118#ifndef NDEBUG
119- std::cerr << " The python object is not a numpy array." << std::endl;
119+ std::cerr << " The python object is not a numpy array." << std::endl;
120120#endif
121- return 0 ;
122- }
123-
121+ return 0 ;
122+ }
123+
124124 if (PyArray_NDIM (obj_ptr) != 2 )
125- if ( (PyArray_NDIM (obj_ptr) !=1 ) || (! MatType::IsVectorAtCompileTime) )
126- {
125+ if ( (PyArray_NDIM (obj_ptr) !=1 ) || (! MatType::IsVectorAtCompileTime) )
126+ {
127127#ifndef NDEBUG
128- std::cerr << " The number of dimension of the object is not correct." << std::endl;
128+ std::cerr << " The number of dimension of the object is not correct." << std::endl;
129129#endif
130- return 0 ;
131- }
132-
130+ return 0 ;
131+ }
132+
133133 if ((PyArray_ObjectType (reinterpret_cast <PyObject *>(obj_ptr), 0 )) != NumpyEquivalentType<T>::type_code)
134- {
134+ {
135135#ifndef NDEBUG
136- std::cerr << " The internal type as no Eigen equivalent." << std::endl;
136+ std::cerr << " The internal type as no Eigen equivalent." << std::endl;
137137#endif
138- return 0 ;
139- }
138+ return 0 ;
139+ }
140140#ifdef NPY_1_8_API_VERSION
141141 if (!(PyArray_FLAGS (obj_ptr)))
142142#else
143- if (!(PyArray_FLAGS (obj_ptr) & NPY_ALIGNED))
143+ if (!(PyArray_FLAGS (obj_ptr) & NPY_ALIGNED))
144144#endif
145- {
145+ {
146146#ifndef NDEBUG
147- std::cerr << " NPY non-aligned matrices are not implemented." << std::endl;
147+ std::cerr << " NPY non-aligned matrices are not implemented." << std::endl;
148148#endif
149- return 0 ;
150- }
149+ return 0 ;
150+ }
151151
152152 return obj_ptr;
153153 }
0 commit comments