ToDense returns a slice of uint64s representing the bitmap as a dense bitmap. Useful to convert a roaring bitmap to a format that can be used by other libraries like https://github.com/bits-and-blooms/bitset or https://github.com/kelindar/bitmap
()
| 78 | // Useful to convert a roaring bitmap to a format that can be used by other libraries |
| 79 | // like https://github.com/bits-and-blooms/bitset or https://github.com/kelindar/bitmap |
| 80 | func (rb *Bitmap) ToDense() []uint64 { |
| 81 | sz := rb.DenseSize() |
| 82 | if sz == 0 { |
| 83 | return nil |
| 84 | } |
| 85 | |
| 86 | bitmap := make([]uint64, sz) |
| 87 | rb.WriteDenseTo(bitmap) |
| 88 | return bitmap |
| 89 | } |
| 90 | |
| 91 | // FromDense creates a bitmap from a slice of uint64s representing the bitmap as a dense bitmap. |
| 92 | // Useful to convert bitmaps from libraries like https://github.com/bits-and-blooms/bitset or |