UT_QuickSort Class Reference

#include <UT_QuickSort.h>

List of all members.

Public Types

enum  compareType { COMPARE_INT, COMPARE_UINT, COMPARE_FLOAT }

Public Member Functions

 UT_QuickSort ()
virtual ~UT_QuickSort ()
UT_QuickSortsort (void *input, size_t size, unsigned int nb, compareType type)
int * getIndices ()
int operator() (int idx)
UT_QuickSortresetIndices ()
int64 getUsedRam () const
 Return the amount of ram used by this particular object.
UT_QuickSortsort (unsigned int *input, unsigned int nb, int useindex=1, bool signedvalues=true)
UT_QuickSortsort (fpreal32 *input, unsigned int nb, int useindex=1)
UT_QuickSortsort (fpreal64 *input, unsigned int nb, int useindex=1)

Static Protected Member Functions

static void urecurse (unsigned int *input, int *index, int len)
static void srecurse (int *input, int *index, int len)
static void frecurse (fpreal32 *input, int *index, int len)
static void drecurse (fpreal64 *input, int *index, int len)
static void frecurse (fpreal32 *input, int len)
static void drecurse (fpreal64 *input, int len)
static void srecurse (int *input, int len)
static void urecurse (unsigned int *input, int len)
static void drecurse (void *input, size_t size, int len, char *tinput)
static void frecurse (void *input, size_t size, int len, char *tinput)
static void srecurse (void *input, size_t size, int len, char *tinput)
static void urecurse (void *input, size_t size, int len, char *tinput)
static void uisort (unsigned int *input, int *index, int len)
static void sisort (int *input, int *index, int len)
static void fisort (fpreal32 *input, int *index, int len)
static void fisort (fpreal32 *input, int len)
static void disort (fpreal64 *input, int *index, int len)
static void disort (fpreal64 *input, int len)
static void sisort (int *input, int len)
static void uisort (unsigned int *input, int len)
static void disort (void *input, size_t size, int len, char *tinput)
static void fisort (void *input, size_t size, int len, char *tinput)
static void sisort (void *input, size_t size, int len, char *tinput)
static void uisort (void *input, size_t size, int len, char *tinput)

Protected Attributes

UT_IntArray myIndices


Detailed Description

This is a bare bones implementation of the Quick Sort, so those who don't believe in Radix sort have something to use.

Definition at line 41 of file UT_QuickSort.h.


Member Enumeration Documentation

Enumerator:
COMPARE_INT 
COMPARE_UINT 
COMPARE_FLOAT 

Definition at line 62 of file UT_QuickSort.h.


Constructor & Destructor Documentation

UT_QuickSort::UT_QuickSort (  ) 

virtual UT_QuickSort::~UT_QuickSort (  )  [virtual]


Member Function Documentation

static void UT_QuickSort::disort ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::disort ( fpreal64 input,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::disort ( fpreal64 input,
int *  index,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::drecurse ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

static void UT_QuickSort::drecurse ( fpreal64 input,
int  len 
) [static, protected]

static void UT_QuickSort::drecurse ( fpreal64 input,
int *  index,
int  len 
) [static, protected]

static void UT_QuickSort::fisort ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::fisort ( fpreal32 input,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::fisort ( fpreal32 input,
int *  index,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::frecurse ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

static void UT_QuickSort::frecurse ( fpreal32 input,
int  len 
) [static, protected]

static void UT_QuickSort::frecurse ( fpreal32 input,
int *  index,
int  len 
) [static, protected]

int* UT_QuickSort::getIndices (  )  [inline]

Return a pointer to the list of indices in sorted order. This list is internally stored in myIndices.

Definition at line 82 of file UT_QuickSort.h.

int64 UT_QuickSort::getUsedRam (  )  const [inline]

Return the amount of ram used by this particular object.

Definition at line 93 of file UT_QuickSort.h.

int UT_QuickSort::operator() ( int  idx  )  [inline]

Definition at line 84 of file UT_QuickSort.h.

UT_QuickSort& UT_QuickSort::resetIndices (  )  [inline]

Reset the internal indices. Note that the list of indices in sorted order is kept internally and is checked at the beginning of the sort routine to check if the list is already sorted.

Definition at line 90 of file UT_QuickSort.h.

static void UT_QuickSort::sisort ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::sisort ( int *  input,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::sisort ( int *  input,
int *  index,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

UT_QuickSort& UT_QuickSort::sort ( void *  input,
size_t  size,
unsigned int  nb,
compareType  type 
)

The following sort method is used to sort arbitrary structures. The first element of the structure must be an int, unsigned, or a float depending on the compareType chosen.

UT_QuickSort& UT_QuickSort::sort ( fpreal64 input,
unsigned int  nb,
int  useindex = 1 
)

Sorting methods After sorting, use the getIndices() method to get the list of indices in sorted order. NB: Unlike the UT_RadixSort, the input array IS sorted with this quick sort.

UT_QuickSort& UT_QuickSort::sort ( fpreal32 input,
unsigned int  nb,
int  useindex = 1 
)

Sorting methods After sorting, use the getIndices() method to get the list of indices in sorted order. NB: Unlike the UT_RadixSort, the input array IS sorted with this quick sort.

UT_QuickSort& UT_QuickSort::sort ( unsigned int *  input,
unsigned int  nb,
int  useindex = 1,
bool  signedvalues = true 
)

Sorting methods After sorting, use the getIndices() method to get the list of indices in sorted order. NB: Unlike the UT_RadixSort, the input array IS sorted with this quick sort.

static void UT_QuickSort::srecurse ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

static void UT_QuickSort::srecurse ( int *  input,
int  len 
) [static, protected]

static void UT_QuickSort::srecurse ( int *  input,
int *  index,
int  len 
) [static, protected]

static void UT_QuickSort::uisort ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::uisort ( unsigned int *  input,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::uisort ( unsigned int *  input,
int *  index,
int  len 
) [static, protected]

These are the unsigned, signed, and float sort routines. The ones without an index variable don't sort an index array along with the main array.

static void UT_QuickSort::urecurse ( void *  input,
size_t  size,
int  len,
char *  tinput 
) [static, protected]

static void UT_QuickSort::urecurse ( unsigned int *  input,
int  len 
) [static, protected]

static void UT_QuickSort::urecurse ( unsigned int *  input,
int *  index,
int  len 
) [static, protected]


Member Data Documentation

Definition at line 96 of file UT_QuickSort.h.


The documentation for this class was generated from the following file:

Generated on Fri May 25 00:10:52 2012 for HDK by  doxygen 1.5.9