|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71984 - sandbox/bloom_filter/branches/prototype
From: cpp.cabrera_at_[hidden]
Date: 2011-05-16 12:25:20
Author: alejandro
Date: 2011-05-16 12:25:20 EDT (Mon, 16 May 2011)
New Revision: 71984
URL: http://svn.boost.org/trac/boost/changeset/71984
Log:
Added clear function to Bloom prototype.
Text files modified:
sandbox/bloom_filter/branches/prototype/bloom.hpp | 5 +++++
sandbox/bloom_filter/branches/prototype/test_bloom.cpp | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
Modified: sandbox/bloom_filter/branches/prototype/bloom.hpp
==============================================================================
--- sandbox/bloom_filter/branches/prototype/bloom.hpp (original)
+++ sandbox/bloom_filter/branches/prototype/bloom.hpp 2011-05-16 12:25:20 EDT (Mon, 16 May 2011)
@@ -39,6 +39,7 @@
return (_bits[Hash::hash(t) % Size]);
}
};
+
template <typename T,
size_t Size,
class HashFunctions = std::tuple<MurmurHash3<T, 3>,
@@ -70,6 +71,10 @@
return this->contains(t);
}
+ void clear() {
+ bits.reset();
+ }
+
private:
std::bitset<Size> bits;
};
Modified: sandbox/bloom_filter/branches/prototype/test_bloom.cpp
==============================================================================
--- sandbox/bloom_filter/branches/prototype/test_bloom.cpp (original)
+++ sandbox/bloom_filter/branches/prototype/test_bloom.cpp 2011-05-16 12:25:20 EDT (Mon, 16 May 2011)
@@ -42,6 +42,7 @@
}
std::cout << collisions << " collisions" << std::endl;
+ bloom.clear();
return 0;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk