MCPcopy Index your code
hub / github.com/RoaringBitmap/roaring / TestBitmapRank

Function TestBitmapRank

roaring_test.go:1216–1232  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1214}
1215
1216func TestBitmapRank(t *testing.T) {
1217 for N := uint32(1); N <= 1048576; N *= 2 {
1218 t.Run("rank tests"+strconv.Itoa(int(N)), func(t *testing.T) {
1219 for gap := uint32(1); gap <= 65536; gap *= 2 {
1220 rb1 := NewBitmap()
1221 for x := uint32(0); x <= N; x += gap {
1222 rb1.Add(x)
1223 }
1224 for y := uint32(0); y <= N; y++ {
1225 if rb1.Rank(y) != uint64((y+1+gap-1)/gap) {
1226 assert.Equal(t, (y+1+gap-1)/gap, rb1.Rank(y))
1227 }
1228 }
1229 }
1230 })
1231 }
1232}
1233
1234func TestBitmapSelect(t *testing.T) {
1235 for N := uint32(1); N <= 1048576; N *= 2 {

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
RankMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…