Woolz Image Processing  Version 1.8.3
AlgRank

Files

file  AlgRank.c
 Rank selection algorithms which provide fast rank selection from an array of values. This is the general case of mimimum, median and maximum value rank selection.
 

Functions

void AlgRankSelectI (int *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of integers such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectUB (unsigned char *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of unsigned bytes such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectS (short *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of shorts such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectF (float *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of floats such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectD (double *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of doubles such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectV (void *elm, int nElm, unsigned int elmSz, int rank, void *buf, int(*compFn)(void *, void *))
 Performs the minimum of sorting on an array of values such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 

Detailed Description

Function Documentation

◆ AlgRankSelectI()

void AlgRankSelectI ( int *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of integers such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

◆ AlgRankSelectUB()

void AlgRankSelectUB ( unsigned char *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of unsigned bytes such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

◆ AlgRankSelectS()

void AlgRankSelectS ( short *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of shorts such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

◆ AlgRankSelectF()

void AlgRankSelectF ( float *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of floats such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

◆ AlgRankSelectD()

void AlgRankSelectD ( double *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of doubles such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

Referenced by WlzCMeshCmpElmFeat2D(), WlzCMeshCmpElmFeat3D(), WlzDistMetricDirVertex2D(), and WlzDistMetricDirVertex3D().

◆ AlgRankSelectV()

void AlgRankSelectV ( void *  elm,
int  nElm,
unsigned int  elmSz,
int  rank,
void *  buf,
int(*)(void *, void *)  compFn 
)

Performs the minimum of sorting on an array of values such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of values.
nElmNumber of values.
elmSzSize of each value.
rankRequired rank in the range [0 - (nElm - 1)].
bufA pointer to a single value to be used as a workspace.
compFnA value comparison function in the same form as qsort(3).