-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcountmin.hpp
More file actions
40 lines (30 loc) · 879 Bytes
/
countmin.hpp
File metadata and controls
40 lines (30 loc) · 879 Bytes
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
// Mark Fuge
// CountMin Sketch Implementation
#include <string>
#include <boost/functional/hash.hpp>
#include <vector>
#include <deque>
//#define NUM_BINS 4194304
//#define NUM_HASH 20
//#define NUM_BINS 2097152
//#define NUM_HASH 8
#define NUM_BINS 512
#define NUM_HASH 4
using namespace std;
class CountMin{
public:
CountMin(); // Initializes the data structures
~CountMin(); // Cleans up remaining data structures
void ClearAll(); // Clean Up Memory Structures
void updateSketchWithWord(string word);
vector<int> returnHashFunctionsOfString(string word);
int queryCountOfString(std::string word);
void outputCountsOfWordList(std::deque<string> wordlist);
deque<int> returnCountsOfWordList(std::deque<string> wordlist);
protected:
vector<vector<int>> table;
};
class InsertCountMin: public CountMin {
public:
void updateSketchWithWord(string word);
};