// 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_ArrayBitmap(t *testing.T) {
	bm0 := roaring.NewFileBitmap(1, 70, 200, 4097, 4098)
	bm1 := roaring.NewFileBitmap()
	for i := uint64(0); i <= 10000; i += 2 {
		bm1.Add(i)
	}
	if n := bm0.IntersectionCount(bm1); n != 3 {
		t.Fatalf("unexpected n: %d", n)
	} else if n := bm1.IntersectionCount(bm0); n != 3 {
		t.Fatalf("unexpected n (reverse): %d", n)
	}
}
func TestBitmap_IntersectionCount_ArrayBitmap ( t * testing . T ) { bm0 := roaring . NewFileBitmap ( 1 , 70 , 200 , 4097 , 4098 ) bm1 := roaring . NewFileBitmap ( ) for i := uint64 ( 0 ) ; i <= 10000 ; i += 2 { bm1 . Add ( i ) } if n := bm0 . IntersectionCount ( bm1 ) ; n != 3 { t . Fatalf ( " " , n ) } else if n := bm1 . IntersectionCount ( bm0 ) ; n != 3 { 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 .