-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.cpp
More file actions
41 lines (35 loc) · 1.42 KB
/
Settings.cpp
File metadata and controls
41 lines (35 loc) · 1.42 KB
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
#include "Settings.h"
#include <functional>
namespace IndexUpdate {
template<typename T>
unsigned long hashMe(T val) { return std::hash<T>()(val); }
size_t Settings::hash(const Settings& s) {
return
hashMe(s.ioMBS) ^
hashMe(s.ioSeek) ^
hashMe(s.szOfPostingBytes) ^
hashMe(s.totalExperimentPostings) ^
hashMe(s.updateBufferPostingsLimit) ^
hashMe(s.updatesQuant) ^
hashMe(s.quieriesQuant) ^ hashMe(s.percentsUBLeft);
}
bool operator==(const Settings& lhs, const Settings& rhs) {
return
lhs.ioMBS == rhs.ioMBS &&
lhs.ioSeek == rhs.ioSeek &&
lhs.szOfPostingBytes == rhs.szOfPostingBytes &&
lhs.totalExperimentPostings == rhs.totalExperimentPostings &&
lhs.updateBufferPostingsLimit == rhs.updateBufferPostingsLimit &&
lhs.updatesQuant == rhs.updatesQuant &&
lhs.quieriesQuant == rhs.quieriesQuant &&
lhs.percentsUBLeft == rhs.percentsUBLeft;
}
const std::string& Settings::name(Algorithm alg) {
static const std::string names[] = {"Never-Merge",
"AlwaysMerge",
"LogrthMerge",
"SkiBsdMerge",
"Prgnstcator"};
return names[alg];
}
}