// Ensure bitmap can return the number of intersecting bits in two bitmaps.
Ensure bitmap can return the number of intersecting bits in two bitmaps.
// Ensure bitmap can return the number of intersecting bits in two bitmaps .
func TestBitmap_IntersectionCount_RunRun(t *testing.T) {
	bm0 := roaring.NewFileBitmap(3, 4, 5, 6, 7, 8, 1000001, 1000002, 1000003, 1000004)
	bm0.Optimize() 
	bm1 := roaring.NewFileBitmap(0, 1, 2, 3, 4, 5, 1000000, 1000002, 1000003, 1000004, 1000005, 1000006)
	bm1.Optimize() 
	if n := bm0.IntersectionCount(bm1); n != 6 {
		t.Fatalf("unexpected n: %d", n)
	} else if n := bm1.IntersectionCount(bm0); n != 6 {
		t.Fatalf("unexpected n (reverse): %d", n)
	}
}
func TestBitmap_IntersectionCount_RunRun ( t * testing . T ) { bm0 := roaring . NewFileBitmap ( 3 , 4 , 5 , 6 , 7 , 8 , 1000001 , 1000002 , 1000003 , 1000004 ) bm0 . Optimize ( ) bm1 := roaring . NewFileBitmap ( 0 , 1 , 2 , 3 , 4 , 5 , 1000000 , 1000002 , 1000003 , 1000004 , 1000005 , 1000006 ) bm1 . Optimize ( ) if n := bm0 . IntersectionCount ( bm1 ) ; n != 6 { t . Fatalf ( " " , n ) } else if n := bm1 . IntersectionCount ( bm0 ) ; n != 6 { t . Fatalf ( " " , n ) } }
Ensure bitmap can return the number of intersecting bits in two bitmaps.
Ensure bitmap can return the number of intersecting bits in two bitmaps .
// convert to runs // convert to runs