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

Implement BSI Addition #260

Closed
jacksonrnewhouse opened this issue Jul 22, 2020 · 13 comments · Fixed by #268
Closed

Implement BSI Addition #260

jacksonrnewhouse opened this issue Jul 22, 2020 · 13 comments · Fixed by #268
Assignees

Comments

@jacksonrnewhouse
Copy link

Bit Slice Indexes basically provide a map[int]int with some very fast operations. One operation that can be implemented against BSIs is addition, which basically sums up the values by key for two BSI's. This can be entirely accomplished using bitwise arithmetic. The primary functions you need are addToValues(*Bitmap) and addDigit(*Bitmap, int). pseudo-code for the inplace versions is something like

func (bsi *BSI) addToValues(bitmap *Bitmap) { 
    bsi.eBM.Or(bitmap)
}

func (bsi *BSI) addDigit(bitmap *Bitmap, digit i) {
    carry := roaring.And(bsi.bA[i], bitmap)
    bsi.bA[i].Xor(bitmap)
    if carry.GetCardinality() > 0 {
        addDigit(carry, i+1)
    }
}
@guymolinari
Copy link
Contributor

This has been implemented. I am preparing a pull request with this and some other enhancements.

@lemire
Copy link
Member

lemire commented Sep 9, 2020

@guymolinari Did you close the issue deliberately ?

guymolinari pushed a commit to guymolinari/roaring that referenced this issue Sep 9, 2020
@guymolinari
Copy link
Contributor

guymolinari commented Sep 9, 2020 via email

@lemire
Copy link
Member

lemire commented Sep 9, 2020

@guymolinari My proposal is to reopen the issue and close it when the PR will have been merged. Less confusing that way.

@guymolinari
Copy link
Contributor

guymolinari commented Sep 10, 2020 via email

@lemire lemire reopened this Sep 10, 2020
@lemire
Copy link
Member

lemire commented Sep 10, 2020

Sounds good. Didn't know the process. My apologies.

Do not apologize.

I have reopened the issue.

When creating a pull request, add "Fixes #260" as part of your description. This will link the issue with the PR. You can also link the issue explicitly by entering it the addresses at the right locations in the web pages.

@guymolinari
Copy link
Contributor

guymolinari commented Sep 10, 2020 via email

lemire added a commit that referenced this issue Sep 28, 2020
Implement issue #260 BSI Add() method and other enhancements
@lemire
Copy link
Member

lemire commented Sep 28, 2020

Issue resolved by @guymolinari

@Smallhi
Copy link

Smallhi commented Nov 27, 2020

@guymolinari For BSI, the function transpose can be used for vectorization. I found the fucntion use a RoraingBitmap to return. It make me confused. Could u tell me how can we use it to process groupBy computing? I think the return value RoraingBitmap discard the original Info.
Thanks a lot!

@guymolinari
Copy link
Contributor

guymolinari commented Nov 27, 2020 via email

@Smallhi
Copy link

Smallhi commented Nov 29, 2020

@guymolinari If you don't mind me asking,could you give me an example of how to "transpose values in the BSI and convert those values to columnIDs in a Bitmap". That would be very useful for me!
Thanks a lot!

@guymolinari
Copy link
Contributor

guymolinari commented Nov 30, 2020 via email

@Smallhi
Copy link

Smallhi commented Dec 1, 2020

@guymolinari I had read and run all your code .... Thanks anyway!

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 a pull request may close this issue.

4 participants