cudd  3.0.0
The University of Colorado Decision Diagram Package
Functions
ucbqsort.c File Reference

Ancient implementation of qsort. More...

#include "util.h"
Include dependency graph for ucbqsort.c:

Functions

void util_qsort (void *vbase, int n, int size, QSFP compar)
 Implements the quicksort algorithm. More...
 

Detailed Description

Ancient implementation of qsort.

This is shipped with CUDD so that results of reordering may be more reproducible across different platforms.

qsort.c 4.2 (Berkeley) 3/9/83

Our own version of the system qsort routine which is faster by an average of 25%, with lows and highs of 10% and 50%. The THRESHold below is the insertion sort threshold, and has been adjusted for records of size 48 bytes. The MTHREShold is where we stop finding a better median.

Function Documentation

void util_qsort ( void *  vbase,
int  n,
int  size,
QSFP  compar 
)

Implements the quicksort algorithm.

First, set up some global parameters for qst to share. Then, quicksort with qst(), and then a cleanup insertion sort ourselves. Sound simple? It's not...

Parameters
vbasestart address of array
nnumber of items
sizesize of each item
comparcomparison function