DIPlib Documentation - ©1995-2009 Quantitative Imaging Group, Delft University of Technology.

# SortAnything

Sort data of any type

## SYNOPSIS

`#include "dip_sort.h"`

dip_Error dip_SortAnything ( data, size, compareFunction, swapFunction, tmpData, algorithm )

## FUNCTION

Sorts a block of data (of size `size`) using the algorithm specified by `algorithm`. This routine requires the user to write two functions in order to fully implement the sorting procedure. These are `SortCompareFunction` and `SortSwapFunction`.

## ARGUMENTS

Data type | Name | Description
`void *` | `data` | Data
`dip_int` | `size` | Size
`dip_SortCompareFunction` | `compareFunction` | Function for comparing two data points
`dip_SortSwapFunction` | `swapFunction` | Function for swapping two data points, or copying one to the other
`void *` | `tmpData` | Pointer to a variable of the same type as the data, used as temporary space by some of the algorithms
`dip_Sort` | `algorithm` | Sort algorithm

## SEE ALSO

General information about sorting

`QuickSortAnything`, `SortCompareFunction`, `SortSwapFunction`

DIPlib on-line documentation | Function reference | Global function index