Skip to content

Commit 629b3a1

Browse files
Modify stride assertion in numpy-map.hpp to be valid for empty vector (#321)
* Set stride assert to be less than INT_MAX * Remove extra print calls and flush on print * Revert "Remove extra print calls and flush on print" This reverts commit cc7db3d. * core: fix assert Co-authored-by: Justin Carpentier <justin.carpentier@inria.fr>
1 parent e491c96 commit 629b3a1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/eigenpy/numpy-map.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ struct NumpyMapTraits<MatType, InputScalar, AlignmentValue, Stride, true> {
157157
else
158158
rowMajor = (PyArray_DIMS(pyArray)[0] > PyArray_DIMS(pyArray)[1]) ? 0 : 1;
159159

160-
assert((PyArray_DIMS(pyArray)[rowMajor] < INT_MAX) &&
161-
(PyArray_STRIDE(pyArray, rowMajor)));
160+
assert(PyArray_DIMS(pyArray)[rowMajor] < INT_MAX);
162161
const int R = (int)PyArray_DIMS(pyArray)[rowMajor];
163162
const long int itemsize = PyArray_ITEMSIZE(pyArray);
164163
const int stride = (int)PyArray_STRIDE(pyArray, rowMajor) / (int)itemsize;

0 commit comments

Comments
 (0)