|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73234 - sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/tut
From: cpp.cabrera_at_[hidden]
Date: 2011-07-19 02:38:46
Author: alejandro
Date: 2011-07-19 02:38:45 EDT (Tue, 19 Jul 2011)
New Revision: 73234
URL: http://svn.boost.org/trac/boost/changeset/73234
Log:
Completed hashers tutorial module.
Text files modified:
sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/tut/hashers.html | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/tut/hashers.html
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/tut/hashers.html (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/tut/hashers.html 2011-07-19 02:38:45 EDT (Tue, 19 Jul 2011)
@@ -66,7 +66,7 @@
<code class="c_keyword">using namespace</code> <code class="c_namespace">std</code>;
<code class="c_type">int</code> <code class="c_func">main</code>() {
- <code class="c_keyword">typedef</code> <code class="c_namespace">boost::mpl::vector</code><<code class="c_type">boost_hash</code><<code class="c_type">int, 0</code>> > <code class="c_type">HashFns</code>;
+ <code class="c_keyword">typedef</code> <code class="c_namespace">boost::mpl::vector</code><<code class="c_type">boost_hash</code><<code class="c_type">int, 0</code>>, <code class="c_type">boost_hash</code><<code class="c_type">int, 1</code>> > <code class="c_type">HashFns</code>;
<code class="c_keyword">static const</code> <code class="c_type">size_t</code> <code class="c_id">INSERT_MAX</code> = 5000;
<code class="c_keyword">static const</code> <code class="c_type">size_t</code> <code class="c_id">CONTAINS_MAX</code> = 10000;
@@ -110,6 +110,16 @@
collisions (false positives): 1808
</div>
+ <p>
+ All it takes to customize the hashers used by a given Bloom filter is to
+ type-define a Boost.MPL vector of hashers and pass this as the HashFns
+ template parameter of the Bloom filter. All this is handled at compile-time,
+ so no cost is incurred at run-time for instantiation, regardless of the
+ complexity of the Hasher vector. The mechanics of insertion, querying, and
+ element removal are all handled transparently by this scheme. This makes it
+ very convenient to experiment with many different types of Hash vectors.
+ </p>
+
<hr/>
<div class="spirit-nav">
<a accesskey="p" href="false_positive.html">
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