HOG2
Bloom.h
Go to the documentation of this file.
1 //
2 // Bloom.h
3 // hog2 glut
4 //
5 // Created by Nathan Sturtevant on 1/25/14.
6 // Copyright (c) 2014 University of Denver. All rights reserved.
7 //
8 
9 #ifndef __hog2_glut__Bloom__
10 #define __hog2_glut__Bloom__
11 
12 #include <iostream>
13 #include <stdint.h>
14 #include "BitVector.h"
15 
16 class BloomFilter {
17 public:
18  BloomFilter(uint64_t numItems, double targetHitRate, bool save, bool zero=true);
19  BloomFilter(uint64_t filterSize, int numHash, bool save, bool zero=true);
20  BloomFilter(uint64_t filterSize, int numHash, const char *loadPrefix);
21  ~BloomFilter();
22  void Analyze();
23  void Insert(uint64_t item);
24  bool Contains(uint64_t item);
25  uint64_t GetStorage() { return filterSize; }
26  int GetNumHash() { return numHash; }
27  void Load();
28 private:
29  uint64_t Hash(uint64_t value, int which);
30  int numHash;
31  bool saveAtExit;
32  uint64_t filterSize;
34 };
35 
36 #endif /* defined(__hog2_glut__Bloom__) */
BloomFilter::Hash
uint64_t Hash(uint64_t value, int which)
Definition: Bloom.cpp:242
BloomFilter::Load
void Load()
Definition: Bloom.cpp:216
BloomFilter::filterSize
uint64_t filterSize
Definition: Bloom.h:32
BloomFilter::bits
BitVector * bits
Definition: Bloom.h:33
BitVector
Definition: BitVector.h:34
BloomFilter::Insert
void Insert(uint64_t item)
Definition: Bloom.cpp:224
BloomFilter::GetStorage
uint64_t GetStorage()
Definition: Bloom.h:25
BloomFilter::saveAtExit
bool saveAtExit
Definition: Bloom.h:31
BloomFilter
Definition: Bloom.h:16
BloomFilter::BloomFilter
BloomFilter(uint64_t numItems, double targetHitRate, bool save, bool zero=true)
Definition: Bloom.cpp:163
BloomFilter::numHash
int numHash
Definition: Bloom.h:30
BitVector.h
BloomFilter::GetNumHash
int GetNumHash()
Definition: Bloom.h:26
BloomFilter::~BloomFilter
~BloomFilter()
Definition: Bloom.cpp:196
BloomFilter::Analyze
void Analyze()
Definition: Bloom.cpp:209
BloomFilter::Contains
bool Contains(uint64_t item)
Definition: Bloom.cpp:232