1 |
greg |
2.1 |
/* |
2 |
|
|
================================================================== |
3 |
|
|
Header for N-way hybrid out-of-core merge sort |
4 |
|
|
|
5 |
|
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
6 |
|
|
(c) Fraunhofer Institute for Solar Energy Systems, |
7 |
|
|
Lucerne University of Applied Sciences & Arts |
8 |
|
|
================================================================== |
9 |
|
|
|
10 |
|
|
$Id $ |
11 |
|
|
*/ |
12 |
|
|
|
13 |
|
|
#ifndef OOC_SORT_H |
14 |
|
|
#define OOC_SORT_H |
15 |
|
|
#include <stdint.h> |
16 |
|
|
|
17 |
|
|
#define OOC_SORT_BUFSIZE (1 << 13) /* 8kb */ |
18 |
|
|
|
19 |
|
|
typedef uint64_t OOC_Sort_Key; |
20 |
|
|
|
21 |
|
|
#if 0 |
22 |
|
|
int OOC_Sort (const char *inFile, const char *outFile, |
23 |
|
|
unsigned long blkSize, unsigned recSize, |
24 |
|
|
OOC_Sort_Key (*priority)(const void *)); |
25 |
|
|
/* Sort records in inFile and output to outFile by (a) internally |
26 |
|
|
* quicksorting block of blkSize bytes at a time, then (b) merging them |
27 |
|
|
* via a priority queue. RecSize specifies the size in bytes of each |
28 |
|
|
* data record. The priority() callback evaluates a record's priority |
29 |
|
|
* and must be supplied by the caller. */ |
30 |
|
|
#else |
31 |
|
|
int OOC_Sort (const char *inFile, const char *outFile, |
32 |
|
|
unsigned numBlocks, unsigned recSize, |
33 |
|
|
OOC_Sort_Key (*priority)(const void *)); |
34 |
|
|
/* Sort records in inFile and output to outFile by (a) internally |
35 |
|
|
* quicksorting numBlocks blocks at a time, then (b) merging them |
36 |
|
|
* via a priority queue. RecSize specifies the size in bytes of each |
37 |
|
|
* data record. The priority() callback evaluates a record's priority |
38 |
|
|
* (ordinal index) and must be supplied by the caller. */ |
39 |
|
|
#endif |
40 |
|
|
|
41 |
|
|
#endif |