User's manual for SLIM programs in Madagascar |
Written by: Gilles Hennenfent & Henryk Modzelewski, UBC Created: February 2006
bool | ascmode=n | [y/n] | y=ascending; n=descending |
---|---|---|---|
int | dim=dim | maximum dimension | |
int | memsize=sf_memsize() | Max amount of RAM (in Mb) to be used |
sfsort is useful for sorting Madagascar vectors either in ascending or descending order with respect to their amplitudes. The sorting is done using qsort from stdlib.h. This function is an implementation of the quicksort algorithm. sfsort has two modes: 1) in-core if the user-specified memsize is big enough to load the full dataset in memory and sort it, and else 2) out-of-core. In the latter case, we implemented a divide and conquer approach. The large dataset is first divided into pieces that fit in memory. These pieces are sorted and written to disk in temporary files. The second step is a merge process of the temporary files.
datasort,incore,outofcore
Figure 3. Sorting example. |
---|
User's manual for SLIM programs in Madagascar |