Lines Matching refs:i
70 swap (size_t *v, size_t i, size_t j) in swap() argument
72 size_t t = v[i]; in swap()
73 v[i] = v[j]; in swap()
120 sparse_swap (sparse_map *sv, size_t *v, size_t i, size_t j) in sparse_swap() argument
122 struct sparse_ent_ *v1 = hash_remove (sv, &(struct sparse_ent_) {i,0}); in sparse_swap()
129 v1->index = v1->val = i; in sparse_swap()
145 v[i] = v1->val; in sparse_swap()
206 size_t i; in randperm_new() local
220 for (i = 0; i < n; i++) in randperm_new()
221 v[i] = i; in randperm_new()
224 for (i = 0; i < h; i++) in randperm_new()
226 size_t j = i + randint_choose (r, n - i); in randperm_new()
228 sparse_swap (sv, v, i, j); in randperm_new()
230 swap (v, i, j); in randperm_new()