-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeatureStore.h
59 lines (37 loc) · 893 Bytes
/
FeatureStore.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
//
// Created by Matthieu Rudelle on 27/05/16.
//
#ifndef DEVSEARCH_DB_FEATURESTORE_H
#define DEVSEARCH_DB_FEATURESTORE_H
#include "FeatureIndex.h"
struct db_feature {
int file_id;
int feature_id;
int line_nb;
float reporank;
};
class FeatureStore {
private:
db_feature* db;
int maxSize;
int HS_end;
bool isSorted;
public:
int size;
FeatureStore(int InitSize);
void add(int feature, int file, float reporank, int line);
void sort();
db_feature* at(int pos);
int HS_parent(int i);
int HS_firstChild(int i);
int HS_secondChild(int i);
void HS_siftUp(int i);
void HS_siftDown(int i);
void HS_heapify();
void HS_swap(int i, int j);
void HS_sort();
bool HS_isBefore(int i, int j);
void print();
void buildFeatureIndex(FeatureIndex *index);
};
#endif //DEVSEARCH_DB_FEATURESTORE_H