Skip to content

Commit 7235c40

Browse files
committed
core: add assert for future debugging
1 parent 7d28bd5 commit 7235c40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/eigenpy/numpy-map.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ struct NumpyMapTraits<MatType, InputScalar, AlignmentValue, Stride, true> {
161161
const int R = (int)PyArray_DIMS(pyArray)[rowMajor];
162162
const long int itemsize = PyArray_ITEMSIZE(pyArray);
163163
const int stride = (int)PyArray_STRIDE(pyArray, rowMajor) / (int)itemsize;
164-
;
165164

166165
if ((MatType::MaxSizeAtCompileTime != R) &&
167166
(MatType::MaxSizeAtCompileTime != Eigen::Dynamic)) {
@@ -171,6 +170,8 @@ struct NumpyMapTraits<MatType, InputScalar, AlignmentValue, Stride, true> {
171170

172171
InputScalar* pyData = reinterpret_cast<InputScalar*>(PyArray_DATA(pyArray));
173172

173+
assert(Stride(stride).inner() == stride &&
174+
"Stride should be a dynamic stride");
174175
return EigenMap(pyData, R, Stride(stride));
175176
}
176177
};

0 commit comments

Comments
 (0)