• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/zstd/lib/dictBuilder/

Lines Matching refs:PA

257 ss_insertionsort(const unsigned char *T, const int *PA,
264 for(t = *i, j = i + 1; 0 < (r = ss_compare(T, PA + t, PA + *j, depth));) {
282 ss_fixdown(const unsigned char *Td, const int *PA,
288 for(v = SA[i], c = Td[PA[v]]; (j = 2 * i + 1) < size; SA[i] = SA[k], i = k) {
289 d = Td[PA[SA[k = j++]]];
290 if(d < (e = Td[PA[SA[j]]])) { k = j; d = e; }
299 ss_heapsort(const unsigned char *Td, const int *PA, int *SA, int size) {
306 if(Td[PA[SA[m / 2]]] < Td[PA[SA[m]]]) { SWAP(SA[m], SA[m / 2]); }
309 for(i = m / 2 - 1; 0 <= i; --i) { ss_fixdown(Td, PA, SA, i, m); }
310 if((size % 2) == 0) { SWAP(SA[0], SA[m]); ss_fixdown(Td, PA, SA, 0, m); }
313 ss_fixdown(Td, PA, SA, 0, i);
324 ss_median3(const unsigned char *Td, const int *PA,
327 if(Td[PA[*v1]] > Td[PA[*v2]]) { SWAP(v1, v2); }
328 if(Td[PA[*v2]] > Td[PA[*v3]]) {
329 if(Td[PA[*v1]] > Td[PA[*v3]]) { return v1; }
338 ss_median5(const unsigned char *Td, const int *PA,
341 if(Td[PA[*v2]] > Td[PA[*v3]]) { SWAP(v2, v3); }
342 if(Td[PA[*v4]] > Td[PA[*v5]]) { SWAP(v4, v5); }
343 if(Td[PA[*v2]] > Td[PA[*v4]]) { SWAP(v2, v4); SWAP(v3, v5); }
344 if(Td[PA[*v1]] > Td[PA[*v3]]) { SWAP(v1, v3); }
345 if(Td[PA[*v1]] > Td[PA[*v4]]) { SWAP(v1, v4); SWAP(v3, v5); }
346 if(Td[PA[*v3]] > Td[PA[*v4]]) { return v4; }
353 ss_pivot(const unsigned char *Td, const int *PA, int *first, int *last) {
362 return ss_median3(Td, PA, first, middle, last - 1);
365 return ss_median5(Td, PA, first, first + t, middle, last - 1 - t, last - 1);
369 first = ss_median3(Td, PA, first, first + t, first + (t << 1));
370 middle = ss_median3(Td, PA, middle - t, middle, middle + t);
371 last = ss_median3(Td, PA, last - 1 - (t << 1), last - 1 - t, last - 1);
372 return ss_median3(Td, PA, first, middle, last);
381 ss_partition(const int *PA,
386 for(; (++a < b) && ((PA[*a] + depth) >= (PA[*a + 1] + 1));) { *a = ~*a; }
387 for(; (a < --b) && ((PA[*b] + depth) < (PA[*b + 1] + 1));) { }
400 ss_mintrosort(const unsigned char *T, const int *PA,
416 if(1 < (last - first)) { ss_insertionsort(T, PA, first, last, depth); }
423 if(limit-- == 0) { ss_heapsort(Td, PA, first, last - first); }
425 for(a = first + 1, v = Td[PA[*first]]; a < last; ++a) {
426 if((x = Td[PA[*a]]) != v) {
432 if(Td[PA[*first] - 1] < v) {
433 first = ss_partition(PA, first, a, depth);
454 a = ss_pivot(Td, PA, first, last);
455 v = Td[PA[*a]];
459 for(b = first; (++b < last) && ((x = Td[PA[*b]]) == v);) { }
461 for(; (++b < last) && ((x = Td[PA[*b]]) <= v);) {
465 for(c = last; (b < --c) && ((x = Td[PA[*c]]) == v);) { }
467 for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) {
473 for(; (++b < c) && ((x = Td[PA[*b]]) <= v);) {
476 for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) {
490 b = (v <= Td[PA[*a] - 1]) ? a : ss_partition(PA, a, c, depth);
523 if(Td[PA[*first] - 1] < v) {
524 first = ss_partition(PA, first, last, depth);
592 ss_inplacemerge(const unsigned char *T, const int *PA,
602 if(*(last - 1) < 0) { x = 1; p = PA + ~*(last - 1); }
603 else { x = 0; p = PA + *(last - 1); }
608 q = ss_compare(T, PA + ((0 <= *b) ? *b : ~*b), p, depth);
635 ss_mergeforward(const unsigned char *T, const int *PA,
646 r = ss_compare(T, PA + *b, PA + *c, depth);
685 ss_mergebackward(const unsigned char *T, const int *PA,
698 if(*bufend < 0) { p1 = PA + ~*bufend; x |= 1; }
699 else { p1 = PA + *bufend; }
700 if(*(middle - 1) < 0) { p2 = PA + ~*(middle - 1); x |= 2; }
701 else { p2 = PA + *(middle - 1); }
709 if(*b < 0) { p1 = PA + ~*b; x |= 1; }
710 else { p1 = PA + *b; }
719 if(*c < 0) { p2 = PA + ~*c; x |= 2; }
720 else { p2 = PA + *c; }
733 if(*b < 0) { p1 = PA + ~*b; x |= 1; }
734 else { p1 = PA + *b; }
735 if(*c < 0) { p2 = PA + ~*c; x |= 2; }
736 else { p2 = PA + *c; }
744 ss_swapmerge(const unsigned char *T, const int *PA,
752 (((c) & 2) && (ss_compare(T, PA + GETIDX(*((a) - 1)), PA + *(a), depth) == 0))) {\
755 if(((c) & 4) && ((ss_compare(T, PA + GETIDX(*((b) - 1)), PA + *(b), depth) == 0))) {\
768 ss_mergebackward(T, PA, first, middle, last, buf, depth);
777 ss_mergeforward(T, PA, first, middle, last, buf, depth);
787 if(ss_compare(T, PA + GETIDX(*(middle + m + half)),
788 PA + GETIDX(*(middle - m - half - 1)), depth) < 0) {
818 if(ss_compare(T, PA + GETIDX(*(middle - 1)), PA + *middle, depth) == 0) {
836 sssort(const unsigned char *T, const int *PA,
850 ss_mintrosort(T, PA, first, last, depth);
862 ss_mintrosort(T, PA, a, a + SS_BLOCKSIZE, depth);
864 ss_insertionsort(T, PA, a, a + SS_BLOCKSIZE, depth);
870 ss_swapmerge(T, PA, b - k, b, b + k, curbuf, curbufsize, depth);
874 ss_mintrosort(T, PA, a, middle, depth);
876 ss_insertionsort(T, PA, a, middle, depth);
880 ss_swapmerge(T, PA, a - k, a, middle, buf, bufsize, depth);
886 ss_mintrosort(T, PA, middle, last, depth);
888 ss_insertionsort(T, PA, middle, last, depth);
890 ss_inplacemerge(T, PA, first, middle, last, depth);
896 int PAi[2]; PAi[0] = PA[*(first - 1)], PAi[1] = n - 2;
898 (a < last) && ((*a < 0) || (0 < ss_compare(T, &(PAi[0]), PA + *a, depth)));