HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BloomFilter Class Reference

#include <Bloom.h>

Collaboration diagram for BloomFilter:
Collaboration graph
[legend]

Public Member Functions

 BloomFilter (uint64_t numItems, double targetHitRate, bool save, bool zero=true)
 
 BloomFilter (uint64_t filterSize, int numHash, bool save, bool zero=true)
 
 BloomFilter (uint64_t filterSize, int numHash, const char *loadPrefix)
 
 ~BloomFilter ()
 
void Analyze ()
 
void Insert (uint64_t item)
 
bool Contains (uint64_t item)
 
uint64_t GetStorage ()
 
int GetNumHash ()
 
void Load ()
 

Private Member Functions

uint64_t Hash (uint64_t value, int which)
 

Private Attributes

int numHash
 
bool saveAtExit
 
uint64_t filterSize
 
BitVectorbits
 

Detailed Description

Definition at line 16 of file Bloom.h.

Constructor & Destructor Documentation

◆ BloomFilter() [1/3]

BloomFilter::BloomFilter ( uint64_t  numItems,
double  targetHitRate,
bool  save,
bool  zero = true 
)

Definition at line 163 of file Bloom.cpp.

References bits, filterSize, numHash, and saveAtExit.

◆ BloomFilter() [2/3]

BloomFilter::BloomFilter ( uint64_t  filterSize,
int  numHash,
bool  save,
bool  zero = true 
)

Definition at line 141 of file Bloom.cpp.

References bits, filterSize, numHash, and saveAtExit.

◆ BloomFilter() [3/3]

BloomFilter::BloomFilter ( uint64_t  filterSize,
int  numHash,
const char *  loadPrefix 
)

Definition at line 149 of file Bloom.cpp.

References bits, filterSize, BitVector::Load(), numHash, and saveAtExit.

◆ ~BloomFilter()

BloomFilter::~BloomFilter ( )

Definition at line 196 of file Bloom.cpp.

References bits, filterSize, numHash, BitVector::Save(), and saveAtExit.

Member Function Documentation

◆ Analyze()

void BloomFilter::Analyze ( )

Definition at line 209 of file Bloom.cpp.

References bits, BitVector::GetNumSetBits(), and BitVector::GetSize().

◆ Contains()

bool BloomFilter::Contains ( uint64_t  item)

Definition at line 232 of file Bloom.cpp.

References bits, filterSize, BitVector::Get(), Hash(), and numHash.

◆ GetNumHash()

int BloomFilter::GetNumHash ( )
inline

Definition at line 26 of file Bloom.h.

References numHash.

◆ GetStorage()

uint64_t BloomFilter::GetStorage ( )
inline

Definition at line 25 of file Bloom.h.

References filterSize.

◆ Hash()

uint64_t BloomFilter::Hash ( uint64_t  value,
int  which 
)
private

Definition at line 242 of file Bloom.cpp.

References salt, and zobrist.

Referenced by Contains(), and Insert().

◆ Insert()

void BloomFilter::Insert ( uint64_t  item)

Definition at line 224 of file Bloom.cpp.

References bits, filterSize, Hash(), numHash, and BitVector::SetTrue().

◆ Load()

void BloomFilter::Load ( )

Definition at line 216 of file Bloom.cpp.

References bits, filterSize, BitVector::Load(), numHash, and saveAtExit.

Member Data Documentation

◆ bits

BitVector* BloomFilter::bits
private

Definition at line 33 of file Bloom.h.

Referenced by Analyze(), BloomFilter(), Contains(), Insert(), Load(), and ~BloomFilter().

◆ filterSize

uint64_t BloomFilter::filterSize
private

Definition at line 32 of file Bloom.h.

Referenced by BloomFilter(), Contains(), GetStorage(), Insert(), Load(), and ~BloomFilter().

◆ numHash

int BloomFilter::numHash
private

Definition at line 30 of file Bloom.h.

Referenced by BloomFilter(), Contains(), GetNumHash(), Insert(), Load(), and ~BloomFilter().

◆ saveAtExit

bool BloomFilter::saveAtExit
private

Definition at line 31 of file Bloom.h.

Referenced by BloomFilter(), Load(), and ~BloomFilter().


The documentation for this class was generated from the following files: