Lines Matching refs:cycles
3222 cycles = list(range(n, n-r, -1))
3226 cycles[i] -= 1
3227 if cycles[i] == 0:
3229 cycles[i] = n - i
3231 j = cycles[i]
3243 Py_ssize_t *cycles; /* one rollover counter per element in the result */
3269 Py_ssize_t *cycles = NULL;
3293 cycles = PyMem_New(Py_ssize_t, r);
3294 if (indices == NULL || cycles == NULL) {
3302 cycles[i] = n - i;
3311 po->cycles = cycles;
3321 if (cycles != NULL)
3322 PyMem_Free(cycles);
3334 PyMem_Free(po->cycles);
3364 Py_ssize_t *cycles = po->cycles;
3408 cycles[i] -= 1;
3409 if (cycles[i] == 0) {
3415 cycles[i] = n - i;
3417 j = cycles[i];
3435 /* If i is negative, then the cycles have all
3456 PyObject *indices=NULL, *cycles=NULL;
3459 /* we must pickle the indices and cycles and use them for setstate */
3471 cycles = PyTuple_New(po->r);
3472 if (cycles == NULL)
3475 PyObject* index = PyLong_FromSsize_t(po->cycles[i]);
3478 PyTuple_SET_ITEM(cycles, i, index);
3482 indices, cycles);
3485 Py_XDECREF(cycles);
3493 PyObject *indices, *cycles, *result;
3502 &PyTuple_Type, &cycles)) {
3507 if (PyTuple_GET_SIZE(indices) != n || PyTuple_GET_SIZE(cycles) != po->r) {
3526 PyObject* indexObject = PyTuple_GET_ITEM(cycles, i);
3534 po->cycles[i] = index;