Lines Matching refs:pivot
68 #define TwoWayPartition1(X, pivot, t1, lo, hi, l, r) \ argument
73 while (X[l] < pivot) l++; \
74 while (X[r] > pivot) r--; \
101 #define TwoWayPartitionReverse1(X, pivot, t1, lo, hi, l, r) \ argument
106 while (X[l] > pivot) l++; \
107 while (X[r] < pivot) r--; \
118 #define TwoWayPartition2(X, Y, pivot, t1, t2, lo, hi, l, r) \ argument
123 while (X[l] < pivot) l++; \
124 while (X[r] > pivot) r--; \
135 #define TwoWayPartition3(X, Y, Z, pivot, t1, t2, t3, lo, hi, l, r) \ argument
140 while (X[l] < pivot) l++; \
141 while (X[r] > pivot) r--; \
153 #define QuickSort1(FuncName, X, n, pivot, t1) \ argument
158 pivot = X[i]; \
160 if (pivot > X[j]) { \
162 pivot = X[i]; \
168 pivot = X[p]; \
169 TwoWayPartition1(X, pivot, t1, 0, hi, l, r); \
176 #define QuickSortReverse1(FuncName, X, n, pivot, t1) \ argument
181 pivot = X[i]; \
183 if (pivot < X[j]) { \
185 pivot = X[i]; \
191 pivot = X[p]; \
192 TwoWayPartitionReverse1(X, pivot, t1, 0, hi, l, r); \
198 #define QuickSort2(FuncName, X, Y, n, pivot, t1, t2) \ argument
203 pivot = X[i]; \
205 if (pivot > X[j]) { \
207 pivot = X[i]; \
213 pivot = X[p]; \
214 TwoWayPartition2(X, Y, pivot, t1, t2, 0, hi, l, r); \
220 #define QuickSort3(FuncName, X, Y, Z, n, pivot, t1, t2, t3) \ argument
225 pivot = X[i]; \
227 if (pivot > X[j]) { \
229 pivot = X[i]; \
235 pivot = X[p]; \
236 TwoWayPartition3(X, Y, Z, pivot, t1, t2, t3, 0, hi, l, r); \
312 PetscInt pivot, t1, N; in PetscSortInt() local
317 QuickSort1(PetscSortInt, X, N, pivot, t1); in PetscSortInt()
339 PetscCount pivot, t1; in PetscSortInt64() local
343 QuickSort1(PetscSortInt64, X, n, pivot, t1); in PetscSortInt64()
365 PetscCount pivot, t1; in PetscSortCount() local
369 QuickSort1(PetscSortCount, X, n, pivot, t1); in PetscSortCount()
388 PetscInt pivot, t1; in PetscSortReverseInt() local
392 QuickSortReverse1(PetscSortReverseInt, X, n, pivot, t1); in PetscSortReverseInt()
692 PetscInt pivot, t1, t2; in PetscSortIntWithArray() local
695 QuickSort2(PetscSortIntWithArray, X, Y, n, pivot, t1, t2); in PetscSortIntWithArray()
717 PetscInt pivot, t1, t2, t3; in PetscSortIntWithArrayPair() local
720 QuickSort3(PetscSortIntWithArrayPair, X, Y, Z, n, pivot, t1, t2, t3); in PetscSortIntWithArrayPair()
741 PetscInt pivot, t1; in PetscSortIntWithMPIIntArray() local
745 QuickSort2(PetscSortIntWithMPIIntArray, X, Y, n, pivot, t1, t2); in PetscSortIntWithMPIIntArray()
766 PetscInt pivot, t1; in PetscSortIntWithCountArray() local
770 QuickSort2(PetscSortIntWithCountArray, X, Y, n, pivot, t1, t2); in PetscSortIntWithCountArray()
795 PetscInt pivot, t1, t2; /* pivot is take from X[], so its type is still PetscInt */ in PetscSortIntWithIntCountArrayPair() local
799 QuickSort3(PetscSortIntWithIntCountArrayPair, X, Y, Z, n, pivot, t1, t2, t3); in PetscSortIntWithIntCountArrayPair()
846 PetscMPIInt pivot, t1; in PetscSortMPIInt() local
849 QuickSort1(PetscSortMPIInt, X, n, pivot, t1); in PetscSortMPIInt()
902 PetscMPIInt pivot, t1, t2; in PetscSortMPIIntWithArray() local
905 QuickSort2(PetscSortMPIIntWithArray, X, Y, n, pivot, t1, t2); in PetscSortMPIIntWithArray()
929 PetscMPIInt pivot, t1; in PetscSortMPIIntWithIntArray() local
933 QuickSort2(PetscSortMPIIntWithIntArray, X, Y, n, pivot, t1, t2); in PetscSortMPIIntWithIntArray()
954 PetscInt pivot, t1; in PetscSortIntWithScalarArray() local
958 QuickSort2(PetscSortIntWithScalarArray, X, Y, n, pivot, t1, t2); in PetscSortIntWithScalarArray()
984 PetscInt pivot, t1; in PetscSortIntWithDataArray() local
989 pivot = X[i]; in PetscSortIntWithDataArray()
991 if (pivot > X[j]) { in PetscSortIntWithDataArray()
993 pivot = X[i]; in PetscSortIntWithDataArray()
1001 pivot = X[MEDIAN(X, hi)]; in PetscSortIntWithDataArray()
1003 while (X[l] < pivot) l++; in PetscSortIntWithDataArray()
1004 while (X[r] > pivot) r--; in PetscSortIntWithDataArray()