-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindexmeta.h
73 lines (63 loc) · 1.3 KB
/
indexmeta.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
69
70
71
72
73
#ifndef INDEXMETA_H
#define INDEXMETA_H
#include <cstring>
class IndexMeta
{
public:
IndexMeta(const unsigned int Id, const float w)
{
this->Id = Id;
this->wgh = w;
this->pp = 0;
this->wgc = 1.0;
}
public:
unsigned int Id, pp;
float wgh, wgc;
static bool LGcomparer(const IndexMeta *a, const IndexMeta *b)
{
return (a->wgh > b->wgh);
}
static bool LLcomparer(const IndexMeta *a, const IndexMeta *b)
{
return (a->wgh < b->wgh);
}
};
class RetriItem
{
public:
RetriItem(const char *imgId0, const float w, const float wgc0)
{
strcpy(ImgId, imgId0);
this->wgh = w;
this->wgc = wgc0;
}
public:
char ImgId[96];
float wgh, wgc;
static bool LGcomparer(const RetriItem *a, const RetriItem *b)
{
if (a->wgh > b->wgh)
{
return true;
}else if(a->wgh == b->wgh)
{
return (a->wgc > b->wgc);
}else{
return false;
}
}
static bool LLcomparer(const RetriItem *a, const RetriItem *b)
{
if (a->wgh < b->wgh)
{
return true;
}else if(a->wgh == b->wgh)
{
return (a->wgc < b->wgc);
}else{
return false;
}
}
};
#endif