casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::GenSort_global_functions_genSortInPlace Struct Reference

Global in-place sort functions The following global functions are easier to use than the static GenSort member functions. More...

#include <GenSort.h>

List of all members.

Public Member Functions

template<class T >
uInt genSort (T *data, uInt nr)
 In-place sort in ascending order using QuickSort.
template<class T >
uInt genSort (Array< T > &data)
template<class T >
uInt genSort (Block< T > &data)
template<class T >
uInt genSort (Block< T > &data, uInt nr)
template<class T >
uInt genSort (T *data, uInt nr, int options)
 In-place sort in ascending order using given option.
template<class T >
uInt genSort (Array< T > &data, int options)
template<class T >
uInt genSort (Block< T > &data, int options)
template<class T >
uInt genSort (Block< T > &data, uInt nr, int options)
template<class T >
uInt genSort (T *data, uInt nr, Sort::Order order)
 In-place sort in given order using QuickSort.
template<class T >
uInt genSort (Array< T > &data, Sort::Order order)
template<class T >
uInt genSort (Block< T > &data, Sort::Order order)
template<class T >
uInt genSort (Block< T > &data, uInt nr, Sort::Order order)
template<class T >
uInt genSort (T *data, uInt nr, Sort::Order order, int options)
 In-place sort in given order using given option.
template<class T >
uInt genSort (Array< T > &data, Sort::Order order, int options)
template<class T >
uInt genSort (Block< T > &data, Sort::Order order, int options)
template<class T >
uInt genSort (Block< T > &data, uInt nr, Sort::Order order, int options)

Detailed Description

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 287 of file GenSort.h.


Member Function Documentation

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( T *  data,
uInt  nr 
) [inline]

In-place sort in ascending order using QuickSort.

Definition at line 292 of file GenSort.h.

References casa::Sort::Ascending, casa::Sort::QuickSort, and casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Array< T > &  data) [inline]
template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data) [inline]
template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data,
uInt  nr 
) [inline]
template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( T *  data,
uInt  nr,
int  options 
) [inline]

In-place sort in ascending order using given option.

This option gives the sort method (Sort::QuickSort, Sort::HeapSort or Sort::InsSort) and/or the option Sort::NoDuplicates.

Definition at line 318 of file GenSort.h.

References casa::Sort::Ascending, and casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Array< T > &  data,
int  options 
) [inline]

Definition at line 322 of file GenSort.h.

References casa::Sort::Ascending, and casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data,
int  options 
) [inline]
template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data,
uInt  nr,
int  options 
) [inline]

Definition at line 331 of file GenSort.h.

References casa::Sort::Ascending, and casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( T *  data,
uInt  nr,
Sort::Order  order 
) [inline]

In-place sort in given order using QuickSort.

The order must be Sort::Ascending or Sort::Descending.

Definition at line 340 of file GenSort.h.

References casa::Sort::QuickSort, and casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Array< T > &  data,
Sort::Order  order 
) [inline]

Definition at line 344 of file GenSort.h.

References casa::Sort::QuickSort, and casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data,
Sort::Order  order 
) [inline]
template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data,
uInt  nr,
Sort::Order  order 
) [inline]

Definition at line 353 of file GenSort.h.

References casa::Sort::QuickSort, and casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( T *  data,
uInt  nr,
Sort::Order  order,
int  options 
) [inline]

In-place sort in given order using given option.

This option gives the sort method (Sort::QuickSort, Sort::HeapSort, or Sort::InsSort) and/or the option Sort::NoDuplicates. The order must be Sort::Ascending or Sort::Descending.

Definition at line 364 of file GenSort.h.

References casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Array< T > &  data,
Sort::Order  order,
int  options 
) [inline]

Definition at line 368 of file GenSort.h.

References casa::GenSort< T >::sort().

template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data,
Sort::Order  order,
int  options 
) [inline]
template<class T >
uInt casa::GenSort_global_functions_genSortInPlace::genSort ( Block< T > &  data,
uInt  nr,
Sort::Order  order,
int  options 
) [inline]

Definition at line 376 of file GenSort.h.

References casa::GenSort< T >::sort().


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