All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BloomFilter.h
Go to the documentation of this file.
1 /*
2  * BloomFilter.h
3  *
4  * Created on: 08.08.2015
5  * Author: Henning
6  */
7 
8 #ifndef BLOOMFILTER_H_
9 #define BLOOMFILTER_H_
10 
11 #include "../auxiliary/Log.h"
12 #include "../Globals.h"
13 
14 namespace Aux {
15 
18 
23 class BloomFilter {
24 private:
25  count numHashes;
26  count size;
27  std::vector<std::vector<char> > membership;
28  std::vector<index> salts;
29 
36  index hash(index key, index hfunc) const;
37 
38 public:
46  BloomFilter(count numHashes, count size = 6291469);
47 
51  virtual ~BloomFilter() = default;
52 
57  void insert(index key);
58 
63  bool isMember(index key) const;
64 };
65 
66 }
67 
68 #endif /* BLOOMFILTER_H_ */
NetworKit::index index
Definition: BloomFilter.h:16
BloomFilter(count numHashes, count size=6291469)
Constructor.
Definition: BloomFilter.cpp:13
Bloom filter for fast set membership queries for type index with one-sided error (false positives)...
Definition: BloomFilter.h:23
uint64_t index
Typedefs.
Definition: Globals.h:20
NetworKit::count count
Definition: BloomFilter.h:17
bool isMember(index key) const
Definition: BloomFilter.cpp:29
uint64_t count
Definition: Globals.h:21
virtual ~BloomFilter()=default
Destructor.
void insert(index key)
Inserts key into Bloom filter.
Definition: BloomFilter.cpp:22