HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_QuickSort Class Reference

#include <UT_QuickSort.h>

Public Types

enum  compareType { COMPARE_INT, COMPARE_UINT, COMPARE_FLOAT }
 

Public Member Functions

UT_QuickSortsort (void *input, size_t size, unsigned int nb, compareType type)
 
intgetIndices ()
 
int operator() (int idx)
 
UT_QuickSortresetIndices ()
 
int64 getUsedRam () const
 Return the amount of ram used by this particular object. More...
 
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 21 of file UT_QuickSort.h.

Member Enumeration Documentation

Enumerator
COMPARE_INT 
COMPARE_UINT 
COMPARE_FLOAT 

Definition at line 40 of file UT_QuickSort.h.

Member Function Documentation

static void UT_QuickSort::disort ( fpreal64 input,
int index,
int  len 
)
staticprotected

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 
)
staticprotected

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 ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected

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 ( fpreal64 input,
int index,
int  len 
)
staticprotected
static void UT_QuickSort::drecurse ( fpreal64 input,
int  len 
)
staticprotected
static void UT_QuickSort::drecurse ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected
static void UT_QuickSort::fisort ( fpreal32 input,
int index,
int  len 
)
staticprotected

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 
)
staticprotected

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 ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected

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 ( fpreal32 input,
int index,
int  len 
)
staticprotected
static void UT_QuickSort::frecurse ( fpreal32 input,
int  len 
)
staticprotected
static void UT_QuickSort::frecurse ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected
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 60 of file UT_QuickSort.h.

int64 UT_QuickSort::getUsedRam ( ) const
inline

Return the amount of ram used by this particular object.

Definition at line 71 of file UT_QuickSort.h.

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

Definition at line 62 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 68 of file UT_QuickSort.h.

static void UT_QuickSort::sisort ( int input,
int index,
int  len 
)
staticprotected

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 
)
staticprotected

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 ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected

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 ( 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.

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 ( 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 ( 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.

static void UT_QuickSort::srecurse ( int input,
int index,
int  len 
)
staticprotected
static void UT_QuickSort::srecurse ( int input,
int  len 
)
staticprotected
static void UT_QuickSort::srecurse ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected
static void UT_QuickSort::uisort ( unsigned int input,
int index,
int  len 
)
staticprotected

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 
)
staticprotected

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 ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected

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 ( unsigned int input,
int index,
int  len 
)
staticprotected
static void UT_QuickSort::urecurse ( unsigned int input,
int  len 
)
staticprotected
static void UT_QuickSort::urecurse ( void input,
size_t  size,
int  len,
char *  tinput 
)
staticprotected

Member Data Documentation

UT_IntArray UT_QuickSort::myIndices
protected

Definition at line 74 of file UT_QuickSort.h.


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