Woolz Image Processing Version 1.4.0
|
Files | |
file | AlgHeapSort.c |
General purpose heap sort algorithms. | |
file | AlgQSort.c |
Specialized implementation of quick sort based on "Engineering a Sort Function" J.L. Bentley and M.D. McIlroy, Software Practice and Experience 23 (1993) 1249-1265. | |
Functions | |
AlgError | AlgHeapSort (void *data, unsigned nElm, unsigned elmSz, int(*cmpFn)(void *, void *)) |
Sorts given data using a heapsort algorithm. | |
AlgError | AlgHeapSortIdx (void *data, int *idx, unsigned nElm, int(*cmpFn)(void *, int *, int, int)) |
Sorts given data using a heapsort algorithm only the indicies are modified. | |
void | AlgHeapElmSwap (void *elm0, void *elm1, int cnt) |
Swaps two data elements. | |
int | AlgHeapSortCmpCFn (void *datum0, void *datum1) |
Char comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpUFn (void *datum0, void *datum1) |
Unsigned char comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpSFn (void *datum0, void *datum1) |
Short comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpIFn (void *datum0, void *datum1) |
Int comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpLFn (void *datum0, void *datum1) |
Long long comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpFFn (void *datum0, void *datum1) |
Float comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpDFn (void *datum0, void *datum1) |
Double comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortInvCmpCFn (void *datum0, void *datum1) |
Inverse char comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpUFn (void *datum0, void *datum1) |
Inverse unsigned char comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpSFn (void *datum0, void *datum1) |
Inverse short comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpIFn (void *datum0, void *datum1) |
Inverse int comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpLFn (void *datum0, void *datum1) |
Inverse long long comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpFFn (void *datum0, void *datum1) |
Inverse float comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpDFn (void *datum0, void *datum1) |
Inverse double comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortCmpIdxCFn (void *data, int *idx, int id0, int id1) |
Char comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpIdxUFn (void *data, int *idx, int id0, int id1) |
Unsigned char comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpIdxSFn (void *data, int *idx, int id0, int id1) |
Short comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpIdxIFn (void *data, int *idx, int id0, int id1) |
Int comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpIdxLFn (void *data, int *idx, int id0, int id1) |
Long comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpIdxFFn (void *data, int *idx, int id0, int id1) |
Float comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortCmpIdxDFn (void *data, int *idx, int id0, int id1) |
Double comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last. | |
int | AlgHeapSortInvCmpIdxCFn (void *data, int *idx, int id0, int id1) |
Inverse char comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpIdxUFn (void *data, int *idx, int id0, int id1) |
Inverse unsigned char comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpIdxSFn (void *data, int *idx, int id0, int id1) |
Inverse short comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpIdxIFn (void *data, int *idx, int id0, int id1) |
Inverse int comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpIdxLFn (void *data, int *idx, int id0, int id1) |
Inverse long long comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpIdxFFn (void *data, int *idx, int id0, int id1) |
Inverse float comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last. | |
int | AlgHeapSortInvCmpIdxDFn (void *data, int *idx, int id0, int id1) |
Inverse double comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last. | |
void | AlgQSort (void *base, size_t nElm, size_t elmSz, void *cData, int(*cmpFn)(const void *, const void *, const void *)) |
A qsort implementation which allows client data to be passed to the sort function. |
AlgError AlgHeapSort | ( | void * | data, |
unsigned | nElm, | ||
unsigned | elmSz, | ||
int(*)(void *, void *) | cmpFn | ||
) |
Sorts given data using a heapsort algorithm.
data | The given data to sort. |
nElm | Number of data elements. |
elmSz | Size of the data elements. |
cmpFn | Given element comparison function which must return an integer < 0, == 0 or > 0 to indicate that the first entry is <, == or > the second. |
References ALG_ERR_FUNC, ALG_ERR_NONE, and AlgHeapElmSwap().
AlgError AlgHeapSortIdx | ( | void * | data, |
int * | idx, | ||
unsigned | nElm, | ||
int(*)(void *, int *, int, int) | cmpFn | ||
) |
Sorts given data using a heapsort algorithm only the indicies are modified.
data | The given data. |
idx | Data indicies to sort. |
nElm | Number of data elements. |
cmpFn | Given indexed element comparison function which must return an integer that is < 0, == 0 or > 0 to indicate that the first entry is <, == or > the second indexed entry. |
References ALG_ERR_FUNC, and ALG_ERR_NONE.
Referenced by WlzCMeshCompSurfMapIdx(), WlzCMeshIntersectDom2D5(), WlzGeomVtxSortRadial(), WlzScalarFeatures2D(), and WlzSnapFit().
void AlgHeapElmSwap | ( | void * | elm0, |
void * | elm1, | ||
int | cnt | ||
) |
Swaps two data elements.
elm0 | Ptr to first element. |
elm1 | Ptr to second element. |
cnt | Element size. |
Referenced by AlgHeapSort().
int AlgHeapSortCmpCFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Char comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortCmpUFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Unsigned char comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortCmpSFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Short comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortCmpIFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Int comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortCmpLFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Long long comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortCmpFFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Float comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortCmpDFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Double comparison function for AlgHeapSort(). Sorted data will have smallest entry first and greatest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortInvCmpCFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Inverse char comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortInvCmpUFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Inverse unsigned char comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortInvCmpSFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Inverse short comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortInvCmpIFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Inverse int comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortInvCmpLFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Inverse long long comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortInvCmpFFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Inverse float comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortInvCmpDFn | ( | void * | datum0, |
void * | datum1 | ||
) |
Inverse double comparison function for AlgHeapSort(). Sorted data will have greatest entry first and smallest last.
datum0 | First data pointer. |
datum1 | Second data pointer. |
int AlgHeapSortCmpIdxCFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Char comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
int AlgHeapSortCmpIdxUFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Unsigned char comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortCmpIdxSFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Short comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortCmpIdxIFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Int comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzCMeshCompSurfMapIdx(), and WlzScalarFeatures2D().
int AlgHeapSortCmpIdxLFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Long comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortCmpIdxFFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Float comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortCmpIdxDFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Double comparison function for AlgHeapSortIdx(). Sorted data will have smallest entry first and greatest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D(), and WlzSnapFit().
int AlgHeapSortInvCmpIdxCFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Inverse char comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
int AlgHeapSortInvCmpIdxUFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Inverse unsigned char comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortInvCmpIdxSFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Inverse short comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortInvCmpIdxIFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Inverse int comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortInvCmpIdxLFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Inverse long long comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortInvCmpIdxFFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Inverse float comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
int AlgHeapSortInvCmpIdxDFn | ( | void * | data, |
int * | idx, | ||
int | id0, | ||
int | id1 | ||
) |
Inverse double comparison function for AlgHeapSortIdx(). Sorted data will have greatest entry first and smallest last.
data | Data array. |
idx | Index array. |
id0 | First index. |
id1 | Second index. |
Referenced by WlzScalarFeatures2D().
void AlgQSort | ( | void * | base, |
size_t | nElm, | ||
size_t | elmSz, | ||
void * | cData, | ||
int(*)(const void *, const void *, const void *) | cmpFn | ||
) |
A qsort implementation which allows client data to be passed to the sort function.
base | Array of elements to sort. |
nElm | Number of elements in array. |
elmSz | Element size. |
cData | Client data passed to the client comparison function. |
(*cmpFn) | Comparison function which is given the client data followed by the two data pointers for comparison. |
Referenced by WlzIDomainFromPItv2D(), WlzLBTBalanceDomain2D(), WlzLBTBalanceDomain3D(), WlzPDomainFromPItv3D(), and WlzSplitObj().