UT_ValArray< T > Class Template Reference

#include <UT_ValArray.h>

Inheritance diagram for UT_ValArray< T >:

UT_Array< T >

List of all members.

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 >
selectNthLargest (int idx, ComparatorBool is_less)
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)
heapPop (Comparator compare)
template<typename ComparatorBool >
heapPop (ComparatorBool is_greater)
heapPop ()
int removeZeros ()
void collapse ()
template<>
int compareElements (const fpreal32 *a, const fpreal32 *b)
template<>
int compareElements (const fpreal64 *a, const fpreal64 *b)
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)


Detailed Description

template<typename T>
class UT_ValArray< T >

Definition at line 623 of file UT_ValArray.h.


Member Typedef Documentation

template<typename T>
typedef int(* UT_ValArray< T >::Comparator)(const T *, const T *)

Reimplemented from UT_Array< T >.

Definition at line 626 of file UT_ValArray.h.


Constructor & Destructor Documentation

template<typename T>
UT_ValArray< T >::UT_ValArray ( unsigned int  sz = 0  )  [inline, explicit]

Definition at line 629 of file UT_ValArray.h.

template<typename T>
UT_ValArray< T >::UT_ValArray ( unsigned int  sz,
unsigned int  count 
) [inline]

Definition at line 632 of file UT_ValArray.h.


Member Function Documentation

template<typename T>
void UT_ValArray< T >::collapse (  )  [inline]

Definition at line 847 of file UT_ValArray.h.

template<>
int UT_ValArray< fpreal64 >::compareElements ( const fpreal64 a,
const fpreal64 b 
) [inline]

Definition at line 930 of file UT_ValArray.h.

template<>
int UT_ValArray< fpreal32 >::compareElements ( const fpreal32 a,
const fpreal32 b 
) [inline]

Definition at line 918 of file UT_ValArray.h.

template<typename T>
static int UT_ValArray< T >::compareElements ( const T *  a,
const T *  b 
) [inline, static]

Definition at line 648 of file UT_ValArray.h.

template<typename T>
static bool UT_ValArray< T >::compareElementsBool ( const T &  a,
const T &  b 
) [inline, static]

Definition at line 636 of file UT_ValArray.h.

template<typename T>
void UT_ValArray< T >::display (  )  const [inline]

Prints the constents of the array.

Definition at line 861 of file UT_ValArray.h.

template<typename T>
bool UT_ValArray< T >::hasSortedSubset ( const UT_ValArray< T > &  other,
Comparator  compare = compareElements 
) const [inline]

Definition at line 763 of file UT_ValArray.h.

template<typename T>
T UT_ValArray< T >::heapPop (  )  [inline]

Definition at line 831 of file UT_ValArray.h.

template<typename T>
template<typename ComparatorBool >
T UT_ValArray< T >::heapPop ( ComparatorBool  is_greater  )  [inline]

Reimplemented from UT_Array< T >.

Definition at line 827 of file UT_ValArray.h.

template<typename T>
T UT_ValArray< T >::heapPop ( Comparator  compare  )  [inline]

Reimplemented from UT_Array< T >.

Definition at line 822 of file UT_ValArray.h.

template<typename T>
unsigned int UT_ValArray< T >::heapPush ( const T &  t  )  [inline]

Definition at line 818 of file UT_ValArray.h.

template<typename T>
template<typename ComparatorBool >
unsigned int UT_ValArray< T >::heapPush ( const T &  t,
ComparatorBool  is_less 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 814 of file UT_ValArray.h.

template<typename T>
unsigned int UT_ValArray< T >::heapPush ( const T &  t,
Comparator  compare 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 809 of file UT_ValArray.h.

template<typename T>
static bool UT_ValArray< T >::isElementZero ( const T &  a  )  [inline, static]

Definition at line 836 of file UT_ValArray.h.

template<typename T>
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.

template<typename T>
template<typename ComparatorBool >
void UT_ValArray< T >::merge ( const UT_Array< T > &  other,
int  direction,
bool  allow_dups,
ComparatorBool  is_less 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 746 of file UT_ValArray.h.

template<typename T>
int UT_ValArray< T >::removeZeros (  )  [inline]

Definition at line 841 of file UT_ValArray.h.

template<typename T>
T UT_ValArray< T >::selectNthLargest ( int  idx  )  [inline]

Definition at line 690 of file UT_ValArray.h.

template<typename T>
template<typename ComparatorBool >
T UT_ValArray< T >::selectNthLargest ( int  idx,
ComparatorBool  is_less 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 686 of file UT_ValArray.h.

template<typename T>
void UT_ValArray< T >::sort ( void   )  [inline]

Definition at line 666 of file UT_ValArray.h.

template<typename T>
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.

template<typename T>
void UT_ValArray< T >::sortAndRemoveDuplicates (  )  [inline]

Definition at line 642 of file UT_ValArray.h.

template<typename T>
void UT_ValArray< T >::sortAscending (  )  [inline]

Definition at line 670 of file UT_ValArray.h.

template<typename T>
unsigned int UT_ValArray< T >::sortedInsert ( const T &  t  )  [inline]

Definition at line 722 of file UT_ValArray.h.

template<typename T>
template<typename ComparatorBool >
unsigned int UT_ValArray< T >::sortedInsert ( const T &  t,
ComparatorBool  is_less 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 718 of file UT_ValArray.h.

template<typename T>
unsigned int UT_ValArray< T >::sortedInsert ( const T &  t,
Comparator  compare 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 713 of file UT_ValArray.h.

template<typename T>
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.

template<typename T>
void UT_ValArray< T >::sortedIntersection ( const UT_ValArray< T > &  other,
Comparator  compare = compareElements 
) [inline]

Definition at line 782 of file UT_ValArray.h.

template<typename T>
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.

template<typename T>
void UT_ValArray< T >::sortedSetDifference ( const UT_ValArray< T > &  other,
Comparator  compare = compareElements 
) [inline]

Definition at line 795 of file UT_ValArray.h.

template<typename T>
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.

template<typename T>
void UT_ValArray< T >::sortedUnion ( const UT_ValArray< T > &  other,
Comparator  compare = compareElements 
) [inline]

Definition at line 769 of file UT_ValArray.h.

template<typename T>
void UT_ValArray< T >::stableSort (  )  [inline]

Definition at line 680 of file UT_ValArray.h.

template<typename T>
template<typename ComparatorBool >
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.

template<typename T>
template<typename ComparatorBool >
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.

template<typename T>
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.

template<typename T>
int UT_ValArray< T >::uniqueSortedFind ( const T &  item  )  const [inline]

Definition at line 704 of file UT_ValArray.h.

template<typename T>
template<typename ComparatorBool >
int UT_ValArray< T >::uniqueSortedFind ( const T &  item,
ComparatorBool  is_less 
) const [inline]

Reimplemented from UT_Array< T >.

Definition at line 700 of file UT_ValArray.h.

template<typename T>
int UT_ValArray< T >::uniqueSortedFind ( const T &  item,
Comparator  compare 
) const [inline]

Reimplemented from UT_Array< T >.

Definition at line 695 of file UT_ValArray.h.

template<typename T>
int UT_ValArray< T >::uniqueSortedFindAscending ( const T &  item  )  const [inline]

Definition at line 708 of file UT_ValArray.h.

template<typename T>
unsigned int UT_ValArray< T >::uniqueSortedInsert ( const T &  t  )  [inline]

Definition at line 736 of file UT_ValArray.h.

template<typename T>
template<typename ComparatorBool >
unsigned int UT_ValArray< T >::uniqueSortedInsert ( const T &  t,
ComparatorBool  is_less 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 732 of file UT_ValArray.h.

template<typename T>
unsigned int UT_ValArray< T >::uniqueSortedInsert ( const T &  t,
Comparator  compare 
) [inline]

Reimplemented from UT_Array< T >.

Definition at line 727 of file UT_ValArray.h.

template<typename T>
unsigned int UT_ValArray< T >::uniqueSortedInsertAscending ( const T &  t  )  [inline]

Definition at line 740 of file UT_ValArray.h.


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

Generated on Thu Jan 31 00:34:06 2013 for HDK by  doxygen 1.5.9