| 1075 | } |
| 1076 | |
| 1077 | static PyObject * |
| 1078 | iter_coords_get(PyArrayIterObject *self, void *NPY_UNUSED(ignored)) |
| 1079 | { |
| 1080 | int nd; |
| 1081 | nd = PyArray_NDIM(self->ao); |
| 1082 | if (self->contiguous) { |
| 1083 | /* |
| 1084 | * coordinates not kept track of --- |
| 1085 | * need to generate from index |
| 1086 | */ |
| 1087 | npy_intp val; |
| 1088 | int i; |
| 1089 | val = self->index; |
| 1090 | for (i = 0; i < nd; i++) { |
| 1091 | if (self->factors[i] != 0) { |
| 1092 | self->coordinates[i] = val / self->factors[i]; |
| 1093 | val = val % self->factors[i]; |
| 1094 | } else { |
| 1095 | self->coordinates[i] = 0; |
| 1096 | } |
| 1097 | } |
| 1098 | } |
| 1099 | return PyArray_IntTupleFromIntp(nd, self->coordinates); |
| 1100 | } |
| 1101 | |
| 1102 | static PyGetSetDef iter_getsets[] = { |
| 1103 | {"index", |
nothing calls this directly
no test coverage detected