rtbulksort.h
来自「此文件包含了在linux下实现tpr-tree索引的源代码」· C头文件 代码 · 共 74 行
H
74 行
// -*- Mode: C++ -*-//--------------------------------------------------------------------// RTbulksort.h// ------------// Declares the interface of the array that can be sorted // as required by STR bulk loading algorithms //// Declared class:// RTsortArray//// TPR-tree - Index for continuously moving objects// July 2001 release, Aalborg University//#ifndef RTBULKSORT_H#define RTBULKSORT_H#include <fstream.h>//------------------------------------------------// Comparison functions - controls how data in // the array is interpreted //extern "C" int ComparePid (const void *i, const void *j);extern "C" int CompareCoord (const void *i, const void *j);extern "C" int CompareCoordParam (const void *i, const void *j);extern "C" int CompareHilbert (const void *i, const void *j);extern RTperiod RTparam; // Time parameter accessible to Compare* functions extern int RToffset; // Offset added to the beginning of coords in Compare* // functions. Used to enable sorting of rectangles // augmented with their center points //------------------------------------------------// RTsortArray//class RTsortArray{public: RTsortArray() : data(NULL), len(0), num(0) {} RTsortArray(int ln, int rc_size); ~RTsortArray(); int GetNum () const { return num; } void* operator[] (int n) const; void* NewRec (); // Give address of a new record at the end void Sort (int (*cmpf)(const void *, const void *)); void HilbertSort (); void SortNTimes (int from, int numRecs, int maxRecs, double alpha, int (*cmpf)(const void *, const void *)); //void OrderData (char* dataptr, int numRecs, int maxRecs, RTcoord* uexts, int j, // int (*cmpf)(const void *, const void *)); void ReadPoints (ifstream& is); // reads points from the binary stream void AdjustPoints (RTperiod deltaT); private: int rec_size; int len; int num; char* data; };#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?