24 #ifndef BLOOM_FILTER_HPP
25 #define BLOOM_FILTER_HPP
26 #include <graphlab/util/dense_bitset.hpp>
28 template <
size_t len,
size_t probes>
29 class fixed_bloom_filter {
31 fixed_dense_bitset<len> bits;
33 inline fixed_bloom_filter() { }
39 inline void insert(uint64_t i) {
40 for (
size_t i = 0;i < probes; ++i) {
41 bits.set_bit_unsync(i % len);
42 i = i * 0x9e3779b97f4a7c13LL;
46 inline bool may_contain(
size_t i) {
47 for (
size_t i = 0;i < probes; ++i) {
48 if (bits.get_bit_unsync(i % len) ==
false)
return false;
49 i = i * 0x9e3779b97f4a7c13LL;