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] Add try_increase_bin_number_to #253

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Conversation

eseiler
Copy link
Member

@eseiler eseiler commented Dec 10, 2024

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.

@seqan-actions seqan-actions added lint [INTERNAL] used for linting and removed lint [INTERNAL] used for linting labels Dec 10, 2024
@seqan-actions
Copy link
Member

Documentation preview available at https://docs.seqan.de/preview/seqan/hibf/253

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.59%. Comparing base (75856d1) to head (9b1acaa).
Report is 5 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@seqan-actions seqan-actions added lint [INTERNAL] used for linting and removed lint [INTERNAL] used for linting labels Dec 10, 2024
* \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
Copy link
Member Author

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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/*!\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.

Comment on lines 308 to 311
* 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* 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.

@seqan-actions seqan-actions added lint [INTERNAL] used for linting and removed lint [INTERNAL] used for linting labels Dec 12, 2024
@eseiler eseiler merged commit 8381399 into seqan:main Dec 12, 2024
37 checks passed
@eseiler eseiler deleted the misc/set_bins branch December 12, 2024 23:10
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.

3 participants