MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / ToDense

Method ToDense

roaring.go:80–89  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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
80func (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

Callers 3

ToBitSetMethod · 0.95
TestToDenseFunction · 0.80
TestFromDenseFunction · 0.80

Calls 2

DenseSizeMethod · 0.95
WriteDenseToMethod · 0.95

Tested by 2

TestToDenseFunction · 0.64
TestFromDenseFunction · 0.64