All pastes #540478 Raw Edit

Mine

public text v1 · immutable
·published 2007-06-05 16:08 UTC
rendered paste body
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <sys/time.h>	// use to obtain time (system dependent)

#include <LEDA/set.h>

// function prototypes
unsigned int BFhash(const string  & str, unsigned int m, unsigned int salt);
void print_measurements(const int *, const int, const int, \
	const int, const int, const int);

// class prototype
template< class BFTYPE >
class BloomFilter {
public:
	BloomFilter(int, int);
	~BloomFilter();
	void insert(const BFTYPE &); // inserts a new key in the set
	bool member(const BFTYPE &); // checks for a key's membership in the set
private:
	int range;		// store filter's capacity
	int hashes;		// number of hash functions to use
	std::vector<bool> ivec;	// use it as bit vector
}; //end of BloomFilter class