casacore
|
Modules | |
Utilities_module_internal_classes | |
Internal Utilities_module classes and functions. | |
Functions | |
template<class T > | |
uInt | casacore::genSort (T *data, uInt nr, Sort::Order order=Sort::Ascending, int options=0) |
Global in-place sort functions The following global functions are easier to use than the static GenSort member functions. More... | |
template<class T , class INX = uInt> | |
uInt | casacore::genSort (Vector< INX > &indexVector, const T *data, INX nr, Sort::Order order=Sort::Ascending, int options=0) |
Global indirect sort functions The following global functions easier to use than the static GenSortIndirect member functions. More... | |
uInt | casacore::precisionForValueErrorPairs (const Vector< Double > &pair1, const Vector< Double > &pair2) |
More... | |
Classes and global functions for general use
See below for an overview of the classes in this module.
This module is a bag of unrelated mini-modules, classes and global functions. The following functional groups can be recognized:
Tip: You may want to look at the individual header files to see whether you might not prefer to include only the header files you really need; it may be more efficient to do so;
|
inline |
Global in-place sort functions The following global functions are easier to use than the static GenSort member functions.
They do an in-place sort of data, thus the data themselves are moved ending up in the requested order.
The default sorting method is QuickSort, which is the fastest. However, there are pathological cases where it can be slow. HeapSort is about twice a slow, but its speed is guaranteed. InsSort (insertion sort) can be very, very slow, but it is the only stable sort method (i.e. equal values are kept in their original order). However, (see (name=genSortIndirect)) indirect sorting methods
are available to make QuickSort and HeapSort stable.
All sort methods have an option to skip duplicate values. This is the only case where the returned number of values can be less than the original number of values.
Definition at line 311 of file GenSort.h.
References casacore::GenSort< T >::sort().
|
inline |
Global indirect sort functions The following global functions easier to use than the static GenSortIndirect member functions.
They do an indirect sort of data, thus the data themselves are not moved. Rather an index vector is returned giving the sorted data indices.
The sorting method used is merge sort, which is always stable. It is the fastest, especially if it can use multiple threads.
Unlike the (see (name=genSortInPlace)) in-place sorting methods, all indirect sorting methods are stable (i.e. equal values are left in their original order).
All sort methods have an option to skip duplicate values. This is the only case where the returned number of values can be less than the original number of values.
Definition at line 357 of file GenSort.h.
References casacore::GenSortIndirect< T, INX >::sort().