-
Notifications
You must be signed in to change notification settings - Fork 63
Add boolean and equality partial operators #53
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
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #53 +/- ##
===========================================
+ Coverage 95.80% 96.61% +0.80%
===========================================
Files 5 5
Lines 668 826 +158
===========================================
+ Hits 640 798 +158
Misses 28 28
Continue to review full report at Codecov.
|
|
My apologies, it's my first time contributing in Github and I've mistakenly added a new commit to this branch (which should be in a different branch), which I have since reverted |
|
So the problem you are trying to solve with this is to allow for operators on subsets of the data; two observations to consider:
An example of #2, in pseudocode: set one(...) Here is how the pull request proposes to do it: result = one.iand(two, some_offset_into_one, two, some_offset_into_two, length) Or perhaps instead, think about: result = one.view(some_offset_into_one, length) & two.view(some_offset_into_two, length) where view returns a bitset that references the original data at the given offset and length, and then the operator& can be used naturally for an "and" operation. That said, comments from others that use bitset more regularly would be appreciated. |
|
Yes, this change introduces alternate paths. I didn't want to compromise the speed (and correctness!) of the already existing solution. |
|
First, I would like to apologise for the time it took me for this change. I've refactored the code, to create the aforementioned "view", which I called span, due to the similarity with C++20 span. There are some questions I had while doing this work, and I would like to hear your thoughts on them:
Thank you for your attention. |
|
@joprodrigues please rebase on develop for a more complete CI suite |
|
I'd recommend squashing your changes and then rebasing so we can get CI running on this. |
697c159 to
ad67ef2
Compare
ad67ef2 to
3e01079
Compare
Create boolean (or, and, xor and sub) and equality operators, that operate
on two distinct bitsets with different starting points, but same length, in place.