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

Method DenseSize

roaring.go:64–75  ·  view source on GitHub ↗

DenseSize returns the size of the bitmap when stored as a dense bitmap.

()

Source from the content-addressed store, hash-verified

62
63// DenseSize returns the size of the bitmap when stored as a dense bitmap.
64func (rb *Bitmap) DenseSize() uint64 {
65 if rb.highlowcontainer.size() == 0 {
66 return 0
67 }
68
69 maximum := 1 + uint64(rb.Maximum())
70 if maximum > (capacity - wordSize + 1) {
71 return capacity >> log2WordSize
72 }
73
74 return (maximum + (wordSize - 1)) >> log2WordSize
75}
76
77// ToDense returns a slice of uint64s representing the bitmap as a dense bitmap.
78// Useful to convert a roaring bitmap to a format that can be used by other libraries

Callers 3

ToDenseMethod · 0.95
BenchmarkFromDenseFunction · 0.80
BenchmarkWriteDenseToFunction · 0.80

Calls 2

MaximumMethod · 0.95
sizeMethod · 0.45

Tested by 2

BenchmarkFromDenseFunction · 0.64
BenchmarkWriteDenseToFunction · 0.64