NUMPY_API*/
| 1121 | |
| 1122 | /*NUMPY_API*/ |
| 1123 | NPY_NO_EXPORT npy_bool |
| 1124 | PyArray_CheckStrides(int elsize, int nd, npy_intp numbytes, npy_intp offset, |
| 1125 | npy_intp const *dims, npy_intp const *newstrides) |
| 1126 | { |
| 1127 | npy_intp begin, end; |
| 1128 | npy_intp lower_offset; |
| 1129 | npy_intp upper_offset; |
| 1130 | |
| 1131 | if (numbytes == 0) { |
| 1132 | numbytes = PyArray_MultiplyList(dims, nd) * elsize; |
| 1133 | } |
| 1134 | |
| 1135 | begin = -offset; |
| 1136 | end = numbytes - offset; |
| 1137 | |
| 1138 | offset_bounds_from_strides(elsize, nd, dims, newstrides, |
| 1139 | &lower_offset, &upper_offset); |
| 1140 | |
| 1141 | if ((upper_offset > end) || (lower_offset < begin)) { |
| 1142 | return NPY_FALSE; |
| 1143 | } |
| 1144 | return NPY_TRUE; |
| 1145 | } |
| 1146 | |
| 1147 | |
| 1148 | static PyObject * |
no test coverage detected