HDK
|
#include <UT_QuickSort.h>
Public Types | |
enum | compareType { COMPARE_INT, COMPARE_UINT, COMPARE_FLOAT } |
Public Member Functions | |
UT_QuickSort & | sort (void *input, size_t size, unsigned int nb, compareType type) |
int * | getIndices () |
int | operator() (int idx) |
UT_QuickSort & | resetIndices () |
int64 | getUsedRam () const |
Return the amount of ram used by this particular object. More... | |
UT_QuickSort & | sort (unsigned int *input, unsigned int nb, int useindex=1, bool signedvalues=true) |
UT_QuickSort & | sort (fpreal32 *input, unsigned int nb, int useindex=1) |
UT_QuickSort & | sort (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 |
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.
Enumerator | |
---|---|
COMPARE_INT | |
COMPARE_UINT | |
COMPARE_FLOAT |
Definition at line 40 of file UT_QuickSort.h.
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.
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.
|
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.
|
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.
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.
|
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.
|
staticprotected |
|
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.
|
inline |
Return the amount of ram used by this particular object.
Definition at line 71 of file UT_QuickSort.h.
Definition at line 62 of file UT_QuickSort.h.
|
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.
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.
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.
|
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.
|
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.
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.
|
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.
|
staticprotected |
|
protected |
Definition at line 74 of file UT_QuickSort.h.