21 #ifndef Minisat_Sort_h
22 #define Minisat_Sort_h
40 template<
class T,
class LessThan>
46 for( i = 0; i < size - 1; i++ )
49 for( j = i + 1; j < size; j++ )
51 if(
lt( array[j], array[best_i] ) )
55 array[i] = array[best_i];
66 template<
class T,
class LessThan>
67 void sort( T* array,
int size, LessThan
lt )
74 T pivot = array[size / 2];
83 while(
lt( array[i], pivot ) );
86 while(
lt( pivot, array[j] ) );
97 sort( &array[i], size - i,
lt );
102 static inline void sort( T* array,
int size )
110 template<
class T,
class LessThan>
void sort(T *array, int size, LessThan lt)
void selectionSort(T *array, int size, LessThan lt)
bool operator()(T x, T y)