Go to the documentation of this file.
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Utilities/ValType.h>
35 #include <casacore/casa/Containers/Block.h>
36 #include <casacore/casa/Utilities/Compare.h>
37 #include <casacore/casa/Utilities/CountedPtr.h>
42 template<
class T>
class Vector;
357 void addKey (
const void* data, DataType,
uInt nr,
int options);
PtrBlock< SortKey * > keys_p
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.
int compare(uInt index1, uInt index2) const
Compare the keys of 2 records.
A drop-in replacement for Block<T*>.
uInt sort(Vector< uInt > &indexVector, uInt nrrec, int options=DefaultSort, Bool tryGenSort=True) const
Sort the data array of nrrec records.
Referenced counted pointer for constant data.
uInt incr_p
increment for next data point
Order
Enumerate the sort order:
Sort(const Sort &)
Copy constructor (copy semantics).
uInt heapSortNoDup(uInt nr, uInt *indices) const
SortKey(const SortKey &)
Copy constructor (copy semantics).
int order() const
Get the sort order.
void qkSort(Int nr, uInt *indices) const
CountedPtr< BaseCompare > ccmpObj_p
comparison object; use CountedPtr for memory management
uInt insSortNoDup(uInt nr, uInt *indices) const
void merge(uInt *inx, uInt *tmp, uInt size, uInt *index, uInt nparts) const
Sort(const void *data, uInt elementSize)
Construct a Sort object for the given data array with elements of elementSize bytes.
void sortKey(uInt offset, const CountedPtr< BaseCompare > &, Order=Ascending)
uInt insSort(uInt nr, uInt *indices) const
Do an insertion sort, optionally skipping duplicates.
uInt quickSort(uInt nr, uInt *indices) const
Do a quicksort, optionally skipping duplicates (qkSort is the actual quicksort function).
uInt quickSortNoDup(uInt nr, uInt *indices) const
uInt tryGenSort(Vector< uInt > &indexVector, uInt nrrec, int opt) const
Try if GenSort can be used for this single key.
uInt unique(Vector< uInt > &uniqueVector, const Vector< uInt > &indexVector) const
void sortKey(const void *data, DataType, uInt increment=0, Order=Ascending)
Define a sort key (the most significant key should be defined first).
void copy(const Sort &that)
Copy that Sort object to this.
void swap(Int index1, Int index2, uInt *indices) const
Swap 2 indices.
this file contains all the compiler specific defines
void addKey(const void *data, DataType, uInt nr, int options)
Add a sort key giving a data type or the sort key.
Sort on one or more keys, ascending and/or descending.
Sort()
The default constructor can be used when the data is only passed in via function sortKey.
int order_p
sort order; -1 = ascending, 1 = descending
BaseCompare * cmpObj_p
comparison object; use raw pointer for performance
bool Bool
Define the standard types used by Casacore.
const void * data_p
address of first data point
abstract base class for comparing two objects
Option
Enumerate the sort options:
uInt unique(Vector< uInt > &uniqueVector, uInt nrrec) const
Get all unique records in a sorted array.
void sortKey(uInt offset, DataType, Order=Ascending)
uInt parSort(int nthr, uInt nrrec, uInt *inx) const
Do a merge sort, if possible in parallel using OpenMP.
void siftDown(Int low, Int up, uInt *indices) const
Siftdown algorithm for heapsort.
SortKey & operator=(const SortKey &)
Assignment (copy semantics).
uInt heapSort(uInt nr, uInt *indices) const
Do a heapsort, optionally skipping duplicates.
Sort & operator=(const Sort &)
Assignment (copy semantics).
void sortKey(const void *data, const CountedPtr< BaseCompare > &, uInt increment, Order=Ascending)