Go to the source code of this file.
◆ Gia_SortFloats()
| int * Gia_SortFloats |
( |
float * | pArray, |
|
|
int * | pPerm, |
|
|
int | nSize ) |
Function*************************************************************
Synopsis [Sorts the array of floating point numbers.]
Description []
SideEffects []
SeeAlso []
Definition at line 251 of file giaSort.c.
252{
253 int i;
254 if ( pPerm == NULL )
255 {
257 for ( i = 0; i < nSize; i++ )
258 pPerm[i] = i;
259 }
261
262
263 return pPerm;
264}
#define ABC_ALLOC(type, num)
void minisat_sort3(float *array, int *perm, int size)
◆ Gia_SortGetTest()
| int * Gia_SortGetTest |
( |
int | nSize | ) |
|
Function*************************************************************
Synopsis [This is implementation of qsort in MiniSat.]
Description []
SideEffects []
SeeAlso []
Definition at line 144 of file giaSort.c.
145{
146 int i, * pArray;
147 srand( 0 );
149 for ( i = 0; i < nSize; i++ )
150 pArray[i] = rand();
151 return pArray;
152}
◆ Gia_SortTest()
Definition at line 159 of file giaSort.c.
160{
161 int nSize = 100000000;
162 int * pArray;
164
165 printf( "Sorting %d integers\n", nSize );
167clk = Abc_Clock();
168 qsort( pArray, (size_t)nSize, 4, (int (*)(const void *, const void *)) num_cmp1 );
169ABC_PRT(
"qsort ", Abc_Clock() - clk );
172
174clk = Abc_Clock();
175 minisat_sort( pArray, nSize, (
int (*)(
const void *,
const void *)) num_cmp2 );
176ABC_PRT(
"minisat", Abc_Clock() - clk );
179
181clk = Abc_Clock();
183ABC_PRT(
"minisat with inlined comparison", Abc_Clock() - clk );
186}
int * Gia_SortGetTest(int nSize)
void Gia_SortVerifySorted(int *pArray, int nSize)
void minisat_sort2(int *array, int size)
void minisat_sort(int *array, int size, int(*comp)(const void *, const void *))
◆ Gia_SortVerifySorted()
| void Gia_SortVerifySorted |
( |
int * | pArray, |
|
|
int | nSize ) |
Definition at line 153 of file giaSort.c.
154{
155 int i;
156 for ( i = 1; i < nSize; i++ )
157 assert( pArray[i-1] <= pArray[i] );
158}
◆ minisat_sort()
| void minisat_sort |
( |
int * | array, |
|
|
int | size, |
|
|
int(* | comp )(const void *, const void *) ) |
Definition at line 79 of file giaSort.c.
80{
81 sort_rec(array,size,comp);
82}
◆ minisat_sort2()
| void minisat_sort2 |
( |
int * | array, |
|
|
int | size ) |
Definition at line 128 of file giaSort.c.
129{
130 sort_rec2(array,size);
131}
◆ minisat_sort3()
| void minisat_sort3 |
( |
float * | array, |
|
|
int * | perm, |
|
|
int | size ) |
Definition at line 235 of file giaSort.c.
236{
237 sort_rec3(array, perm, size);
238}