Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/estimate set cardinality #11

Merged
merged 5 commits into from
Oct 7, 2023

Conversation

t0k4rt
Copy link

@t0k4rt t0k4rt commented Oct 4, 2023

Implement set cardinality estimate using the given formula:

$$|S| = { \ln(z / m) \over k * \ln(1 - 1 / m)} $$

With
$z$: number of zeros in the bit set
$k$: number of hash functions
$m$: size of the bit set

Reference: https://inria.hal.science/hal-01284874/document

@t0k4rt t0k4rt marked this pull request as ready for review October 4, 2023 14:22
assert_eq!(vec.count_zeros(), 253);
#[cfg(target_pointer_width = "32")]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yankun1992 This should fix unit tests ?

@yankun1992 yankun1992 merged commit 5e685f3 into yankun1992:main Oct 7, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants