• Home
  • Raw
  • Download

Lines Matching refs:last

168                  saidx_t *first, saidx_t *last, saidx_t depth) {  in ss_insertionsort()  argument
173 for(i = last - 2; first <= i; --i) { in ss_insertionsort()
175 do { *(j - 1) = *j; } while((++j < last) && (*j < 0)); in ss_insertionsort()
176 if(last <= j) { break; } in ss_insertionsort()
263 ss_pivot(const sauchar_t *Td, const saidx_t *PA, saidx_t *first, saidx_t *last) { in ss_pivot() argument
267 t = last - first; in ss_pivot()
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()
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()
292 saidx_t *first, saidx_t *last, saidx_t depth) { in ss_partition() argument
295 for(a = first - 1, b = last;;) { in ss_partition()
311 saidx_t *first, saidx_t *last, in ss_mintrosort() argument
322 for(ssize = 0, limit = ss_ilg(last - first);;) { in ss_mintrosort()
324 if((last - first) <= SS_INSERTIONSORT_THRESHOLD) { in ss_mintrosort()
326 if(1 < (last - first)) { ss_insertionsort(T, PA, first, last, depth); } in ss_mintrosort()
328 STACK_POP(first, last, depth, limit); 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()
345 if((a - first) <= (last - a)) { in ss_mintrosort()
347 STACK_PUSH(a, last, depth, -1); in ss_mintrosort()
348 last = a, depth += 1, limit = ss_ilg(a - first); in ss_mintrosort()
353 if(1 < (last - a)) { in ss_mintrosort()
357 last = a, depth += 1, limit = ss_ilg(a - first); in ss_mintrosort()
364 a = ss_pivot(Td, PA, first, last); in ss_mintrosort()
369 for(b = first; (++b < last) && ((x = Td[PA[*b]]) == v);) { } in ss_mintrosort()
370 if(((a = b) < last) && (x < 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()
396 if((s = d - c) > (t = last - d - 1)) { s = t; } in ss_mintrosort()
397 for(e = b, f = last - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); } in ss_mintrosort()
399 a = first + (b - a), c = last - (d - c); in ss_mintrosort()
402 if((a - first) <= (last - c)) { in ss_mintrosort()
403 if((last - c) <= (c - b)) { in ss_mintrosort()
405 STACK_PUSH(c, last, depth, limit); in ss_mintrosort()
406 last = a; in ss_mintrosort()
408 STACK_PUSH(c, last, depth, limit); in ss_mintrosort()
410 last = a; in ss_mintrosort()
412 STACK_PUSH(c, last, depth, limit); in ss_mintrosort()
414 first = b, last = c, depth += 1, limit = ss_ilg(c - b); in ss_mintrosort()
421 } else if((last - c) <= (c - b)) { in ss_mintrosort()
427 STACK_PUSH(c, last, depth, limit); in ss_mintrosort()
428 first = b, last = c, depth += 1, limit = ss_ilg(c - b); in ss_mintrosort()
434 first = ss_partition(PA, first, last, depth); in ss_mintrosort()
435 limit = ss_ilg(last - first); in ss_mintrosort()
461 ss_rotate(saidx_t *first, saidx_t *middle, saidx_t *last) { in ss_rotate() argument
464 l = middle - first, r = last - middle; in ss_rotate()
468 a = last - 1, b = middle - 1; in ss_rotate()
474 last = a; in ss_rotate()
485 if(last <= b) { in ss_rotate()
503 saidx_t *first, saidx_t *middle, saidx_t *last, in ss_inplacemerge() argument
512 if(*(last - 1) < 0) { x = 1; p = PA + ~*(last - 1); } in ss_inplacemerge()
513 else { x = 0; p = PA + *(last - 1); } in ss_inplacemerge()
528 ss_rotate(a, middle, last); in ss_inplacemerge()
529 last -= middle - a; in ss_inplacemerge()
533 --last; in ss_inplacemerge()
534 if(x != 0) { while(*--last < 0) { } } in ss_inplacemerge()
535 if(middle == last) { break; } in ss_inplacemerge()
546 saidx_t *first, saidx_t *middle, saidx_t *last, in ss_mergeforward() argument
566 if(last <= c) { in ss_mergeforward()
582 if(last <= c) { in ss_mergeforward()
596 saidx_t *first, saidx_t *middle, saidx_t *last, in ss_mergebackward() argument
604 bufend = buf + (last - middle) - 1; in ss_mergebackward()
605 ss_blockswap(buf, middle, last - middle); in ss_mergebackward()
612 for(t = *(a = last - 1), b = bufend, c = middle - 1;;) { in ss_mergebackward()
655 saidx_t *first, saidx_t *middle, saidx_t *last, in ss_swapmerge() argument
676 if((last - middle) <= bufsize) { in ss_swapmerge()
677 if((first < middle) && (middle < last)) { in ss_swapmerge()
678 ss_mergebackward(T, PA, first, middle, last, buf, depth); in ss_swapmerge()
680 MERGE_CHECK(first, last, check); in ss_swapmerge()
681 STACK_POP(first, middle, last, check); in ss_swapmerge()
687 ss_mergeforward(T, PA, first, middle, last, buf, depth); in ss_swapmerge()
689 MERGE_CHECK(first, last, check); in ss_swapmerge()
690 STACK_POP(first, middle, last, check); in ss_swapmerge()
694 for(m = 0, len = MIN(middle - first, last - middle), half = len >> 1; in ss_swapmerge()
708 if(rm < last) { in ss_swapmerge()
719 if((l - first) <= (last - r)) { in ss_swapmerge()
720 STACK_PUSH(r, rm, last, (next & 3) | (check & 4)); in ss_swapmerge()
721 middle = lm, last = l, check = (check & 3) | (next & 4); in ss_swapmerge()
731 MERGE_CHECK(first, last, check); in ss_swapmerge()
732 STACK_POP(first, middle, last, check); in ss_swapmerge()
748 saidx_t *first, saidx_t *last, in sssort() argument
761 ss_mintrosort(T, PA, first, last, depth); in sssort()
764 (bufsize < (last - first)) && in sssort()
765 (bufsize < (limit = ss_isqrt(last - first)))) { in sssort()
767 buf = middle = last - limit, bufsize = limit; in sssort()
769 middle = last, limit = 0; in sssort()
777 curbufsize = last - (a + SS_BLOCKSIZE); in sssort()
797 ss_mintrosort(T, PA, middle, last, depth); in sssort()
799 ss_insertionsort(T, PA, middle, last, depth); in sssort()
801 ss_inplacemerge(T, PA, first, middle, last, depth); in sssort()
809 (a < last) && ((*a < 0) || (0 < ss_compare(T, &(PAi[0]), PA + *a, depth))); in sssort()