-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKDPointDisk.h
68 lines (42 loc) · 1.35 KB
/
KDPointDisk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef INCLUDED_KDPOINTDISK_H
#define INCLUDED_KDPOINTDISK_H
#include <cstdint>
#include <cstddef>
#include <cstdio>
#include "sdsl/int_vector.hpp"
#include "rect.h"
#include "DiskFile.h"
using namespace sdsl;
class KDPointDisk {
public:
static int32_t m_B; // the size of a disk page in bytes.
static int32_t m_xBitWidth; // the width of x point
static int32_t m_yBitWidth; // the width of y point.
int_vector<0> * m_vx; // The number of x value.
int_vector<0> * m_vy; // The number of y value.
public:
//Constructor
KDPointDisk(uint64_t nPoint);
/***
*init the int_vector
* @param nPoint: the length of the int_vector
* @param xWidth: the width of m_xv
* @param yWidth: the width of m_yv
****/
//void init(uint64_t nPoint);
~KDPointDisk();
void setPoint(uint64_t idx, uint64_t xValue, uint64_t yPoint);
/****************
* write the KDPointDisk into really disk.
* @return the # of disk which it writes into.
*****************/
int32_t writeToDisk(DiskFile *diskOut);
/***************
* @return the bytes that it read into.
****************/
int32_t writePadding(int64_t bytes, FILE* out);
// We set these value in the begining of the program.
static void Set(int32_t B, int32_t xBitWidth, int32_t yBitWidth);
static int32_t GetMaxPoint(); // the max number of points that can be stored in a disk page.
};
#endif