Lines Matching defs:pivot

430 /* Size of each element in the quicksort pivot array. */
452 * The median-of-nine pivot algorithm doesn't work if a subset has
472 /* Scratchpad for in-memory sort, or finding the pivot */
647 /* Return a pointer to the xfarray pivot record within the sortinfo struct. */
653 /* Return a pointer to the start of the pivot array. */
661 /* The xfarray record is stored at the start of each pivot array element. */
671 /* The xfarray index is stored at the end of each pivot array element. */
683 * Find a pivot value for quicksort partitioning, swap it with a[lo], and save
684 * the cached pivot record for the next step.
687 * and choose the pivot from the median record. Using multiple points will
688 * improve the quality of the pivot selection, and hopefully avoid the worst
697 void *pivot = xfarray_sortinfo_pivot(si);
710 * pivot array.
722 /* Load the selected xfarray records into the pivot array. */
739 * the xfarray_idx_t in the pivot array.
752 * We sorted the pivot array records (which includes the xfarray
753 * indices) in xfarray record order. The median element of the pivot
754 * array contains the xfarray record that we will use as the pivot.
759 memcpy(pivot, recp, si->array->obj_size);
761 /* If the pivot record we chose was already in a[lo] then we're done. */
768 * Find the cached copy of a[lo] in the pivot array so that we can swap
769 * a[lo] and a[pivot].
781 /* Swap a[lo] and a[pivot]. */
782 error = xfarray_sort_store(si, lo, pivot);
901 * pivot element using a median-of-nine decision tree. This reduces the
902 * probability of selecting a bad pivot value which causes worst case
919 * and hi after selecting a pivot, we will try to retain the xfile memory
937 void *pivot;
952 pivot = xfarray_sortinfo_pivot(si);
987 /* Pick a pivot, move it to a[lo] and stash it. */
994 * pivot is on the left side of the range and everything larger
995 * than the pivot is on the right side of the range.
1000 * pivot value.
1005 while (xfarray_sort_cmp(si, scratch, pivot) >= 0 &&
1029 * the pivot value.
1034 while (xfarray_sort_cmp(si, scratch, pivot) <= 0 &&
1061 * Put our pivot value in the correct place at a[lo]. All
1063 * the pivot; and all values between a[lo + 1] and a[end[i]-1]
1064 * should be greater than the pivot.
1066 error = xfarray_sort_store(si, lo, pivot);