Lines Matching refs:Td
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
237 if(Td[PA[*v1]] > Td[PA[*v2]]) { SWAP(v1, v2); } in ss_median3()
238 if(Td[PA[*v2]] > Td[PA[*v3]]) { in ss_median3()
239 if(Td[PA[*v1]] > Td[PA[*v3]]) { return v1; } in ss_median3()
248 ss_median5(const sauchar_t *Td, const saidx_t *PA, in ss_median5() argument
251 if(Td[PA[*v2]] > Td[PA[*v3]]) { SWAP(v2, v3); } in ss_median5()
252 if(Td[PA[*v4]] > Td[PA[*v5]]) { SWAP(v4, v5); } in ss_median5()
253 if(Td[PA[*v2]] > Td[PA[*v4]]) { SWAP(v2, v4); SWAP(v3, v5); } in ss_median5()
254 if(Td[PA[*v1]] > Td[PA[*v3]]) { SWAP(v1, v3); } in ss_median5()
255 if(Td[PA[*v1]] > Td[PA[*v4]]) { SWAP(v1, v4); SWAP(v3, v5); } in ss_median5()
256 if(Td[PA[*v3]] > Td[PA[*v4]]) { return v4; } in ss_median5()
263 ss_pivot(const sauchar_t *Td, const saidx_t *PA, saidx_t *first, saidx_t *last) { in ss_pivot() argument
272 return ss_median3(Td, PA, first, middle, last - 1); in ss_pivot()
275 return ss_median5(Td, PA, first, first + t, middle, last - 1 - t, last - 1); in ss_pivot()
279 first = ss_median3(Td, PA, first, first + t, first + (t << 1)); in ss_pivot()
280 middle = ss_median3(Td, PA, middle - t, middle, middle + t); in ss_pivot()
281 last = ss_median3(Td, PA, last - 1 - (t << 1), last - 1 - t, last - 1); in ss_pivot()
282 return ss_median3(Td, PA, first, middle, last); in ss_pivot()
315 const sauchar_t *Td; in ss_mintrosort() local
332 Td = T + depth; in ss_mintrosort()
333 if(limit-- == 0) { ss_heapsort(Td, PA, first, last - first); } in ss_mintrosort()
335 for(a = first + 1, v = Td[PA[*first]]; a < last; ++a) { in ss_mintrosort()
336 if((x = Td[PA[*a]]) != v) { in ss_mintrosort()
342 if(Td[PA[*first] - 1] < v) { in ss_mintrosort()
364 a = ss_pivot(Td, PA, first, last); in ss_mintrosort()
365 v = Td[PA[*a]]; in ss_mintrosort()
369 for(b = first; (++b < last) && ((x = Td[PA[*b]]) == v);) { } in ss_mintrosort()
371 for(; (++b < last) && ((x = Td[PA[*b]]) <= v);) { in ss_mintrosort()
375 for(c = last; (b < --c) && ((x = Td[PA[*c]]) == v);) { } in ss_mintrosort()
377 for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) { in ss_mintrosort()
383 for(; (++b < c) && ((x = Td[PA[*b]]) <= v);) { in ss_mintrosort()
386 for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) { in ss_mintrosort()
400 b = (v <= Td[PA[*a] - 1]) ? a : ss_partition(PA, a, c, depth); in ss_mintrosort()
433 if(Td[PA[*first] - 1] < v) { in ss_mintrosort()