-
Notifications
You must be signed in to change notification settings - Fork 2
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] Add try_increase_bin_number_to #253
Conversation
Documentation preview available at https://docs.seqan.de/preview/seqan/hibf/253 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #253 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 51 51
Lines 1963 1974 +11
Branches 5 5
=======================================
+ Hits 1955 1966 +11
Misses 8 8 ☔ View full report in Codecov by Sentry. |
9c4d95e
to
26defd9
Compare
* \returns `true` if the number of bins was set, `false` if the number of bins was not set. | ||
* \sa seqan::hibf::interleaved_bloom_filter::increase_bin_number_to | ||
* | ||
* If increasing the number of bins would require a resize, the function returns `false` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add warning about agents being invalidated.
@@ -300,8 +300,20 @@ class interleaved_bloom_filter : private seqan::hibf::bit_vector | |||
(*this)[bin.value + offset] = 0; | |||
} | |||
|
|||
/*!\brief Tries increasing the number of bins stored in the Interleaved Bloom Filter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/*!\brief Tries increasing the number of bins stored in the Interleaved Bloom Filter. | |
/*!\brief Tries increasing the number of bins stored in the Interleaved Bloom Filter without reallocating memory. |
* If increasing the number of bins would require a resize, the function returns `false` and | ||
* does not increase the number of bins. | ||
* If old and new bin count are the same, `true` is returned. | ||
* If the new bin count is smaller than the old bin count, `false` is returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* If increasing the number of bins would require a resize, the function returns `false` and | |
* does not increase the number of bins. | |
* If old and new bin count are the same, `true` is returned. | |
* If the new bin count is smaller than the old bin count, `false` is returned. | |
* If the new bin is bigger than the current bin count: | |
* - and if a resize is required, returns `false` and nothing happens | |
* - and if no resize is necessary, sets the old bin count to the new and return `true` | |
* If old and new bin count are the same, `true` is returned. | |
* If the new bin count is smaller than the old bin count, `false` is returned. |
26defd9
to
9b1acaa
Compare
It's handy for the dynamic IBF because I need to differentiate whether increasing the number of bins is costly (resizing).
It also seems like a useful API to have; manually determining whether a resize happens is not trivial and requires some knowledge about the IBF.