Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Add intersect method to bloom filter #136

Closed
wants to merge 3 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Jun 9, 2017

Per https://en.wikipedia.org/wiki/Bloom_filter#Interesting_properties , it is valid to construct a new bloom filter from a set of constituent bloom filters by applying an 'AND' operation to the constituent bits sets.

"... The intersect operation satisfies a weaker property: the false positive probability in the resulting Bloom filter is at most the false-positive probability in one of the constituent Bloom filters, but may be larger than the false positive probability in the Bloom filter created from scratch using the intersection of the two sets."

This PR adds a method to support this operation, and a unit test to verify.

@abramsm
Copy link
Contributor

abramsm commented Jul 7, 2017

@alstaplesmoore thanks. this looks good to me. Can you add another test that tests a larger intersection to ensure it works with non-trivial amounts of data?

@abramsm
Copy link
Contributor

abramsm commented Jul 7, 2017

PR #134 may have more tests that we can use.

@ghost ghost closed this Jul 8, 2017
@ghost ghost deleted the al/bloomFilterIntersection branch July 8, 2017 20:10
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant