1 USING: help.markup help.syntax kernel math ;
5 { $values { "error-rate" "The desired false positive rate. A " { $link float } " between 0 and 1." }
6 { "capacity" "The expected number of object in the set. A positive " { $link integer } "." }
7 { "bloom-filter" bloom-filter } }
8 { $description "Creates an empty Bloom filter." }
9 { $errors "Throws a " { $link invalid-size } " when unable to produce a filter meeting the given constraints. Throws a " { $link invalid-error-rate } " or a " { $link invalid-capacity } " when input is invalid." } ;
12 HELP: bloom-filter-insert
13 { $values { "object" object }
14 { "bloom-filter" bloom-filter } }
15 { $description "Records the item as a member of the filter." }
16 { $side-effects "bloom-filter" } ;
18 HELP: bloom-filter-member?
19 { $values { "object" object }
20 { "bloom-filter" bloom-filter }
22 { $description "Returns " { $link t } " if the object may be a member of Bloom filter, " { $link f } " otherwise. The false positive rate is configurable; there are no false negatives." } ;
25 { $class-description "This is the class for Bloom filters. These provide constant-time insertion and probabilistic membership-testing operations, but do not actually store any elements." } ;
27 ARTICLE: "bloom-filters" "Bloom filters"
28 "This is a library for Bloom filters, sets that provide a constant-time insertion operation and probabilistic membership tests, but do not actually store any elements."
30 "The accuracy of the membership test is configurable; a Bloom filter will never incorrectly report an item is not a member of the set, but may incorrectly report than an item is a member of the set."
32 "Bloom filters cannot be resized and do not support removal."
40 ABOUT: "bloom-filters"