MCPcopy
hub / github.com/RoaringBitmap/roaring / GetCardinality

Method GetCardinality

roaring.go:1247–1253  ·  view source on GitHub ↗

GetCardinality returns the number of integers contained in the bitmap

()

Source from the content-addressed store, hash-verified

1245
1246// GetCardinality returns the number of integers contained in the bitmap
1247func (rb *Bitmap) GetCardinality() uint64 {
1248 size := uint64(0)
1249 for _, c := range rb.highlowcontainer.containers {
1250 size += uint64(c.getCardinality())
1251 }
1252 return size
1253}
1254
1255// Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).
1256// If you pass the smallest value, you get the value 1. If you pass a value that is smaller than the smallest

Callers 15

ToArrayMethod · 0.95
SelectMethod · 0.95
TestIssue386Function · 0.95
TestCloneOfCOWFunction · 0.95
TestFastCardCOWFunction · 0.95
TestRangeRemovalCOWFunction · 0.95
TestFlipOnEmptyCOWFunction · 0.95
TestBitmapExtraCOWFunction · 0.95
TestBitmapCOWFunction · 0.95
TestXORtest4COWFunction · 0.95

Calls 1

getCardinalityMethod · 0.65

Tested by 15

TestIssue386Function · 0.76
TestCloneOfCOWFunction · 0.76
TestFastCardCOWFunction · 0.76
TestRangeRemovalCOWFunction · 0.76
TestFlipOnEmptyCOWFunction · 0.76
TestBitmapExtraCOWFunction · 0.76
TestBitmapCOWFunction · 0.76
TestXORtest4COWFunction · 0.76
rTestCOWFunction · 0.76
TestDoubleAddCOWFunction · 0.76