Lines Matching defs:pivot
133 * 3. We choose a pivot by looking at the first, last
136 * choosing the pivot, and it makes things a little
137 * easier in the partitioning step. Anyway, the pivot
148 * 4. We copy the pivot element to a separate place
151 * and don't have to wonder "did we move the pivot
198 #define Pivot(swapper,sz) \
225 while (compare(first,pivot)<0) first+=sz; \
226 while (compare(pivot,last)<0) last-=sz; \
261 memcpy(pivot,first,size); \
263 memcpy(test,pivot,size); \
326 char *pivot=malloc(size);
328 assert(pivot!=0);
335 /* Select pivot */
337 Pivot(SWAP_nonaligned,size);
338 memcpy(pivot,mid,size);
348 free(pivot);
357 char *pivot=malloc(size);
359 assert(pivot!=0);
366 /* Select pivot */
368 Pivot(SWAP_aligned,size);
369 memcpy(pivot,mid,size);
379 free(pivot);
388 char *pivot=malloc(WORD_BYTES);
389 assert(pivot!=0);
401 /* Select pivot */
403 Pivot(SWAP_words,WORD_BYTES);
404 *(int*)pivot=*(int*)mid;
407 fprintf(stderr,"pivot=%d\n",*(int*)pivot);
421 *(int*)pivot=*(int*)first;
422 for (;compare(pl,pivot)>0;pr=pl,--pl) {
424 if (pr!=(int*)first) *pr=*(int*)pivot;
426 free(pivot);