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

Method GetCardinality

roaring64/roaring64.go:388–394  ·  view source on GitHub ↗

GetCardinality returns the number of integers contained in the bitmap

()

Source from the content-addressed store, hash-verified

386
387// GetCardinality returns the number of integers contained in the bitmap
388func (rb *Bitmap) GetCardinality() uint64 {
389 size := uint64(0)
390 for _, c := range rb.highlowcontainer.containers {
391 size += c.GetCardinality()
392 }
393 return size
394}
395
396// Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality())
397func (rb *Bitmap) Rank(x uint64) uint64 {

Callers 15

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

Calls

no outgoing calls

Tested by 15

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