42 template<
class T>
class Vector;
std::vector< double > Vector
uInt quickSort(uInt nr, uInt *indices) const
Do a quicksort, optionally skipping duplicates (qkSort is the actual quicksort function).
uInt heapSortNoDup(uInt nr, uInt *indices) const
Order
Enumerate the sort order:
void qkSort(Int nr, uInt *indices) const
int compare(uInt index1, uInt index2) const
Compare the keys of 2 records.
void merge(uInt *inx, uInt *tmp, uInt size, uInt *index, uInt nparts) const
uInt heapSort(uInt nr, uInt *indices) const
Do a heapsort, optionally skipping duplicates.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
int order_p
sort order; -1 = ascending, 1 = descending
Sort on one or more keys, ascending and/or descending.
int order() const
Get the sort order.
Referenced counted pointer for constant data.
void swap(Int index1, Int index2, uInt *indices) const
Swap 2 indices.
Option
Enumerate the sort options:
uInt parSort(int nthr, uInt nrrec, uInt *inx) const
Do a merge sort, if possible in parallel using OpenMP.
bool Bool
Define the standard types used by Casacore.
SortKey(const void *data, const CountedPtr< BaseCompare > &, uInt increment, int order)
Define a sort key in a given data array using the indicated comparison object, stride and sort order...
void copy(const Sort &that)
Copy that Sort object to this.
A drop-in replacement for Block<T*>.
uInt quickSortNoDup(uInt nr, uInt *indices) const
SortKey & operator=(const SortKey &)
Assignment (copy semantics).
CountedPtr< BaseCompare > ccmpObj_p
comparison object; use CountedPtr for memory management
abstract base class for comparing two objects
BaseCompare * cmpObj_p
comparison object; use raw pointer for performance
Sort()
The default constructor can be used when the data is only passed in via function sortKey.
uInt insSortNoDup(uInt nr, uInt *indices) const
void addKey(const void *data, DataType, uInt nr, int options)
Add a sort key giving a data type or the sort key.
uInt unique(Vector< uInt > &uniqueVector, uInt nrrec) const
Get all unique records in a sorted array.
uInt incr_p
increment for next data point
void sortKey(const void *data, DataType, uInt increment=0, Order=Ascending)
Define a sort key (the most significant key should be defined first).
const void * data_p
address of first data point
void siftDown(Int low, Int up, uInt *indices) const
Siftdown algorithm for heapsort.
PtrBlock< SortKey * > keys_p
Sort & operator=(const Sort &)
Assignment (copy semantics).
uInt sort(Vector< uInt > &indexVector, uInt nrrec, int options=DefaultSort, Bool tryGenSort=True) const
Sort the data array of nrrec records.
uInt tryGenSort(Vector< uInt > &indexVector, uInt nrrec, int opt) const
Try if GenSort can be used for this single key.
uInt insSort(uInt nr, uInt *indices) const
Do an insertion sort, optionally skipping duplicates.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.