NUMPY_API */
| 1077 | /*NUMPY_API |
| 1078 | */ |
| 1079 | NPY_NO_EXPORT int |
| 1080 | PyArray_ElementStrides(PyObject *obj) |
| 1081 | { |
| 1082 | PyArrayObject *arr; |
| 1083 | int itemsize; |
| 1084 | int i, ndim; |
| 1085 | npy_intp *strides; |
| 1086 | |
| 1087 | if (!PyArray_Check(obj)) { |
| 1088 | return 0; |
| 1089 | } |
| 1090 | |
| 1091 | arr = (PyArrayObject *)obj; |
| 1092 | |
| 1093 | itemsize = PyArray_ITEMSIZE(arr); |
| 1094 | ndim = PyArray_NDIM(arr); |
| 1095 | strides = PyArray_STRIDES(arr); |
| 1096 | |
| 1097 | for (i = 0; i < ndim; i++) { |
| 1098 | if ((strides[i] % itemsize) != 0) { |
| 1099 | return 0; |
| 1100 | } |
| 1101 | } |
| 1102 | return 1; |
| 1103 | } |
| 1104 | |
| 1105 | /* |
| 1106 | * This routine checks to see if newstrides (of length nd) will not |
no test coverage detected