D | sssort.c | 192 ss_fixdown(const sauchar_t *Td, const saidx_t *PA, in ss_fixdown() argument 198 for(v = SA[i], c = Td[PA[v]]; (j = 2 * i + 1) < size; SA[i] = SA[k], i = k) { in ss_fixdown() 199 d = Td[PA[SA[k = j++]]]; in ss_fixdown() 200 if(d < (e = Td[PA[SA[j]]])) { k = j; d = e; } in ss_fixdown() 209 ss_heapsort(const sauchar_t *Td, const saidx_t *PA, saidx_t *SA, saidx_t size) { in ss_heapsort() argument 216 if(Td[PA[SA[m / 2]]] < Td[PA[SA[m]]]) { SWAP(SA[m], SA[m / 2]); } in ss_heapsort() 219 for(i = m / 2 - 1; 0 <= i; --i) { ss_fixdown(Td, PA, SA, i, m); } in ss_heapsort() 220 if((size % 2) == 0) { SWAP(SA[0], SA[m]); ss_fixdown(Td, PA, SA, 0, m); } in ss_heapsort() 223 ss_fixdown(Td, PA, SA, 0, i); in ss_heapsort() 234 ss_median3(const sauchar_t *Td, const saidx_t *PA, in ss_median3() argument [all …]
|