forked from starkdg/Redis-ImageScout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datapoint.hpp
46 lines (36 loc) · 840 Bytes
/
datapoint.hpp
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
#ifndef _DATAPOINT_H
#define _DATAPOINT_H
#include <cmath>
#include "defs.hpp"
using namespace std;
struct DataPoint {
long long id;
unsigned long long value;
bool active;
DataPoint():id(0),active(true){}
DataPoint(const long long id, const double value):id(id),value(value),active(true){}
DataPoint(const DataPoint &other){
active = other.active;
value = other.value;
}
DataPoint& operator=(const DataPoint &other){
active = other.active;
value = other.value;
return *this;
}
};
struct QueryResult {
DataPoint *dp;
double distance;
QueryResult():dp(NULL),distance(0){};
QueryResult(const QueryResult &other){
dp = other.dp;
distance = other.distance;
}
QueryResult& operator=(const QueryResult &other){
dp = other.dp;
distance = other.distance;
return *this;
}
};
#endif /* _DATAPOINT_H */