#include <UT_ValArray.h>

Public Types | |
| typedef int(* | Comparator )(const T *, const T *) |
Public Member Functions | |
| UT_ValArray (unsigned int sz=0) | |
| UT_ValArray (unsigned int sz, unsigned int count) | |
| void | sortAndRemoveDuplicates () |
| void | sort (Comparator compare) |
| template<typename ComparatorBool > | |
| void | stdsort (ComparatorBool is_less) |
| Sort using std::sort. The ComparatorBool uses the less-than semantics. | |
| void | sort () |
| void | sortAscending () |
| template<typename ComparatorBool > | |
| void | stableSort (ComparatorBool is_less) |
| void | stableSort () |
| template<typename ComparatorBool > | |
| T | selectNthLargest (int idx, ComparatorBool is_less) |
| T | selectNthLargest (int idx) |
| int | uniqueSortedFind (const T &item, Comparator compare) const |
| template<typename ComparatorBool > | |
| int | uniqueSortedFind (const T &item, ComparatorBool is_less) const |
| int | uniqueSortedFind (const T &item) const |
| int | uniqueSortedFindAscending (const T &item) const |
| unsigned int | sortedInsert (const T &t, Comparator compare) |
| template<typename ComparatorBool > | |
| unsigned int | sortedInsert (const T &t, ComparatorBool is_less) |
| unsigned int | sortedInsert (const T &t) |
| unsigned int | uniqueSortedInsert (const T &t, Comparator compare) |
| template<typename ComparatorBool > | |
| unsigned int | uniqueSortedInsert (const T &t, ComparatorBool is_less) |
| unsigned int | uniqueSortedInsert (const T &t) |
| unsigned int | uniqueSortedInsertAscending (const T &t) |
| template<typename ComparatorBool > | |
| void | merge (const UT_Array< T > &other, int direction, bool allow_dups, ComparatorBool is_less) |
| void | merge (const UT_ValArray< T > &other, int direction, bool allow_dups) |
| bool | hasSortedSubset (const UT_ValArray< T > &other, Comparator compare=compareElements) const |
| void | sortedUnion (const UT_ValArray< T > &other, Comparator compare=compareElements) |
| void | sortedUnion (const UT_ValArray< T > &other, UT_ValArray< T > &result, Comparator compare=compareElements) const |
| void | sortedIntersection (const UT_ValArray< T > &other, Comparator compare=compareElements) |
| void | sortedIntersection (const UT_ValArray< T > &other, UT_ValArray< T > &result, Comparator compare=compareElements) const |
| void | sortedSetDifference (const UT_ValArray< T > &other, Comparator compare=compareElements) |
| void | sortedSetDifference (const UT_ValArray< T > &other, UT_ValArray< T > &result, Comparator compare=compareElements) const |
| unsigned int | heapPush (const T &t, Comparator compare) |
| template<typename ComparatorBool > | |
| unsigned int | heapPush (const T &t, ComparatorBool is_less) |
| unsigned int | heapPush (const T &t) |
| T | heapPop (Comparator compare) |
| template<typename ComparatorBool > | |
| T | heapPop (ComparatorBool is_greater) |
| T | heapPop () |
| int | removeZeros () |
| void | collapse () |
| template<> | |
| int | compareElements (const fpreal32 *a, const fpreal32 *b) |
| template<> | |
| int | compareElements (const fpreal64 *a, const fpreal64 *b) |
| T | sum () const |
| Functions which are only specialized for int{32,64}, fpreal{32,64}. | |
| void | display () const |
| Prints the constents of the array. | |
Static Public Member Functions | |
| static bool | compareElementsBool (const T &a, const T &b) |
| static int | compareElements (const T *a, const T *b) |
| static bool | isElementZero (const T &a) |
Definition at line 623 of file UT_ValArray.h.
| typedef int(* UT_ValArray< T >::Comparator)(const T *, const T *) |
| UT_ValArray< T >::UT_ValArray | ( | unsigned int | sz = 0 |
) | [inline, explicit] |
Definition at line 629 of file UT_ValArray.h.
| UT_ValArray< T >::UT_ValArray | ( | unsigned int | sz, | |
| unsigned int | count | |||
| ) | [inline] |
Definition at line 632 of file UT_ValArray.h.
| void UT_ValArray< T >::collapse | ( | ) | [inline] |
Definition at line 847 of file UT_ValArray.h.
| int UT_ValArray< fpreal64 >::compareElements | ( | const fpreal64 * | a, | |
| const fpreal64 * | b | |||
| ) | [inline] |
Definition at line 930 of file UT_ValArray.h.
| int UT_ValArray< fpreal32 >::compareElements | ( | const fpreal32 * | a, | |
| const fpreal32 * | b | |||
| ) | [inline] |
Definition at line 918 of file UT_ValArray.h.
| static int UT_ValArray< T >::compareElements | ( | const T * | a, | |
| const T * | b | |||
| ) | [inline, static] |
Definition at line 648 of file UT_ValArray.h.
| static bool UT_ValArray< T >::compareElementsBool | ( | const T & | a, | |
| const T & | b | |||
| ) | [inline, static] |
Definition at line 636 of file UT_ValArray.h.
| void UT_ValArray< T >::display | ( | ) | const [inline] |
| bool UT_ValArray< T >::hasSortedSubset | ( | const UT_ValArray< T > & | other, | |
| Comparator | compare = compareElements | |||
| ) | const [inline] |
Definition at line 763 of file UT_ValArray.h.
| T UT_ValArray< T >::heapPop | ( | ) | [inline] |
Definition at line 831 of file UT_ValArray.h.
| T UT_ValArray< T >::heapPop | ( | ComparatorBool | is_greater | ) | [inline] |
| T UT_ValArray< T >::heapPop | ( | Comparator | compare | ) | [inline] |
| unsigned int UT_ValArray< T >::heapPush | ( | const T & | t | ) | [inline] |
Definition at line 818 of file UT_ValArray.h.
| unsigned int UT_ValArray< T >::heapPush | ( | const T & | t, | |
| ComparatorBool | is_less | |||
| ) | [inline] |
| unsigned int UT_ValArray< T >::heapPush | ( | const T & | t, | |
| Comparator | compare | |||
| ) | [inline] |
| static bool UT_ValArray< T >::isElementZero | ( | const T & | a | ) | [inline, static] |
Definition at line 836 of file UT_ValArray.h.
| void UT_ValArray< T >::merge | ( | const UT_ValArray< T > & | other, | |
| int | direction, | |||
| bool | allow_dups | |||
| ) | [inline] |
Definition at line 755 of file UT_ValArray.h.
| void UT_ValArray< T >::merge | ( | const UT_Array< T > & | other, | |
| int | direction, | |||
| bool | allow_dups, | |||
| ComparatorBool | is_less | |||
| ) | [inline] |
| int UT_ValArray< T >::removeZeros | ( | ) | [inline] |
Definition at line 841 of file UT_ValArray.h.
| T UT_ValArray< T >::selectNthLargest | ( | int | idx | ) | [inline] |
Definition at line 690 of file UT_ValArray.h.
| T UT_ValArray< T >::selectNthLargest | ( | int | idx, | |
| ComparatorBool | is_less | |||
| ) | [inline] |
| void UT_ValArray< T >::sort | ( | void | ) | [inline] |
Definition at line 666 of file UT_ValArray.h.
| void UT_ValArray< T >::sort | ( | Comparator | compare | ) | [inline] |
Sort the array using a comparison function that you must provide. t1 and t2 are pointers to Thing. The comparison function uses strcmp() semantics (i.e. -1 if less than, 0 if equal, 1 if greater).
Reimplemented from UT_Array< T >.
Definition at line 657 of file UT_ValArray.h.
| void UT_ValArray< T >::sortAndRemoveDuplicates | ( | ) | [inline] |
Definition at line 642 of file UT_ValArray.h.
| void UT_ValArray< T >::sortAscending | ( | ) | [inline] |
Definition at line 670 of file UT_ValArray.h.
| unsigned int UT_ValArray< T >::sortedInsert | ( | const T & | t | ) | [inline] |
Definition at line 722 of file UT_ValArray.h.
| unsigned int UT_ValArray< T >::sortedInsert | ( | const T & | t, | |
| ComparatorBool | is_less | |||
| ) | [inline] |
| unsigned int UT_ValArray< T >::sortedInsert | ( | const T & | t, | |
| Comparator | compare | |||
| ) | [inline] |
| void UT_ValArray< T >::sortedIntersection | ( | const UT_ValArray< T > & | other, | |
| UT_ValArray< T > & | result, | |||
| Comparator | compare = compareElements | |||
| ) | const [inline] |
Definition at line 788 of file UT_ValArray.h.
| void UT_ValArray< T >::sortedIntersection | ( | const UT_ValArray< T > & | other, | |
| Comparator | compare = compareElements | |||
| ) | [inline] |
Definition at line 782 of file UT_ValArray.h.
| void UT_ValArray< T >::sortedSetDifference | ( | const UT_ValArray< T > & | other, | |
| UT_ValArray< T > & | result, | |||
| Comparator | compare = compareElements | |||
| ) | const [inline] |
Definition at line 801 of file UT_ValArray.h.
| void UT_ValArray< T >::sortedSetDifference | ( | const UT_ValArray< T > & | other, | |
| Comparator | compare = compareElements | |||
| ) | [inline] |
Definition at line 795 of file UT_ValArray.h.
| void UT_ValArray< T >::sortedUnion | ( | const UT_ValArray< T > & | other, | |
| UT_ValArray< T > & | result, | |||
| Comparator | compare = compareElements | |||
| ) | const [inline] |
Definition at line 775 of file UT_ValArray.h.
| void UT_ValArray< T >::sortedUnion | ( | const UT_ValArray< T > & | other, | |
| Comparator | compare = compareElements | |||
| ) | [inline] |
Definition at line 769 of file UT_ValArray.h.
| void UT_ValArray< T >::stableSort | ( | ) | [inline] |
Definition at line 680 of file UT_ValArray.h.
| void UT_ValArray< T >::stableSort | ( | ComparatorBool | is_less | ) | [inline] |
stableSort is both stable, so keeps equal elements in the same order (note this is very useful for compatibility between compilers) and templated. Either use a bool sort function or make a utility class with bool operator()(const T a, const T b) the utility class lets you bind data to avoid globals. The comparator returns true if a must occur before b in the list. For sorting ascending, this is a less than operation.
Reimplemented from UT_Array< T >.
Definition at line 676 of file UT_ValArray.h.
| void UT_ValArray< T >::stdsort | ( | ComparatorBool | is_less | ) | [inline] |
Sort using std::sort. The ComparatorBool uses the less-than semantics.
Reimplemented from UT_Array< T >.
Definition at line 662 of file UT_ValArray.h.
| T UT_ValArray< T >::sum | ( | ) | const [inline] |
Functions which are only specialized for int{32,64}, fpreal{32,64}.
Returns the sum of the entries in the array.
Definition at line 855 of file UT_ValArray.h.
| int UT_ValArray< T >::uniqueSortedFind | ( | const T & | item | ) | const [inline] |
Definition at line 704 of file UT_ValArray.h.
| int UT_ValArray< T >::uniqueSortedFind | ( | const T & | item, | |
| ComparatorBool | is_less | |||
| ) | const [inline] |
| int UT_ValArray< T >::uniqueSortedFind | ( | const T & | item, | |
| Comparator | compare | |||
| ) | const [inline] |
| int UT_ValArray< T >::uniqueSortedFindAscending | ( | const T & | item | ) | const [inline] |
Definition at line 708 of file UT_ValArray.h.
| unsigned int UT_ValArray< T >::uniqueSortedInsert | ( | const T & | t | ) | [inline] |
Definition at line 736 of file UT_ValArray.h.
| unsigned int UT_ValArray< T >::uniqueSortedInsert | ( | const T & | t, | |
| ComparatorBool | is_less | |||
| ) | [inline] |
| unsigned int UT_ValArray< T >::uniqueSortedInsert | ( | const T & | t, | |
| Comparator | compare | |||
| ) | [inline] |
| unsigned int UT_ValArray< T >::uniqueSortedInsertAscending | ( | const T & | t | ) | [inline] |
Definition at line 740 of file UT_ValArray.h.
1.5.9