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

Function testDense

roaring_test.go:3265–3296  ·  view source on GitHub ↗
(fn func(string, *Bitmap))

Source from the content-addressed store, hash-verified

3263}
3264
3265func testDense(fn func(string, *Bitmap)) {
3266 bc := New()
3267 for i := 0; i <= arrayDefaultMaxSize; i++ {
3268 bc.Add(uint32(1 + MaxUint16 + i*2))
3269 }
3270
3271 rc := New()
3272 rc.AddRange(1, 2)
3273 rc.AddRange(bc.GetCardinality(), bc.GetCardinality()*2)
3274
3275 ac := New()
3276 for i := 1; i <= arrayDefaultMaxSize; i++ {
3277 ac.Add(uint32(MaxUint16 + i*2))
3278 }
3279
3280 brc := New()
3281 for i := 150000; i < 450000; i++ {
3282 brc.Add(uint32(i))
3283 }
3284
3285 for _, tc := range []struct {
3286 name string
3287 rb *Bitmap
3288 }{
3289 {"bitmap", bc},
3290 {"run", rc},
3291 {"array", ac},
3292 {"bitmaps-and-runs", brc},
3293 } {
3294 fn(tc.name+"-"+strconv.FormatUint(tc.rb.GetCardinality(), 10), tc.rb)
3295 }
3296}
3297
3298func TestToDense(t *testing.T) {
3299 testDense(func(name string, rb *Bitmap) {

Callers 5

TestToDenseFunction · 0.85
TestFromDenseFunction · 0.85
TestFromBitSetFunction · 0.85
BenchmarkFromDenseFunction · 0.85
BenchmarkWriteDenseToFunction · 0.85

Calls 4

NewFunction · 0.70
AddMethod · 0.45
AddRangeMethod · 0.45
GetCardinalityMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…