Documentation ¶
Overview ¶
Package gocroaring is an wrapper for CRoaring in go It provides a fast compressed bitmap data structure. See http://roaringbitmap.org for details.
Index ¶
- Constants
- type Bitmap
- func (rb *Bitmap) Add(x ...uint32)
- func (rb *Bitmap) And(x2 *Bitmap)
- func (rb *Bitmap) AndCardinality(x2 *Bitmap) uint64
- func (rb *Bitmap) AndNot(x2 *Bitmap)
- func (rb *Bitmap) AndNotCardinality(x2 *Bitmap) uint64
- func (rb *Bitmap) Cardinality() uint64
- func (rb *Bitmap) Clear()
- func (rb *Bitmap) Clone() *Bitmap
- func (rb *Bitmap) Contains(x uint32) bool
- func (rb *Bitmap) Equals(o interface{}) bool
- func (rb *Bitmap) Flip(rangeStart, rangeEnd uint64)
- func (rb *Bitmap) Intersect(x2 *Bitmap) bool
- func (rb *Bitmap) IsEmpty() bool
- func (rb *Bitmap) Iterator() IntIterable
- func (rb *Bitmap) JaccardIndex(x2 *Bitmap) float64
- func (rb *Bitmap) Maximum() uint32
- func (rb *Bitmap) Minimum() uint32
- func (rb *Bitmap) Or(x2 *Bitmap)
- func (rb *Bitmap) OrCardinality(x2 *Bitmap) uint64
- func (rb *Bitmap) Printf()
- func (rb *Bitmap) Rank(x uint32) uint64
- func (rb *Bitmap) Remove(x uint32)
- func (rb *Bitmap) RemoveRunCompression() bool
- func (rb *Bitmap) RunOptimize() bool
- func (rb *Bitmap) Select(rank uint32) (uint32, error)
- func (rb *Bitmap) SerializedSizeInBytes() int
- func (rb *Bitmap) Stats() map[string]uint64
- func (rb *Bitmap) String() string
- func (rb *Bitmap) ToArray() []uint32
- func (rb *Bitmap) Write(b []byte) error
- func (rb *Bitmap) Xor(x2 *Bitmap)
- func (rb *Bitmap) XorCardinality(x2 *Bitmap) uint64
- type IntIterable
Constants ¶
const CRoaringMajor = C.ROARING_VERSION_MAJOR
const CRoaringMinor = C.ROARING_VERSION_MINOR
const CRoaringRevision = C.ROARING_VERSION_REVISION
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
Bitmap is the roaring bitmap
func FastOr ¶
FastOr computes the union between many bitmaps quickly, as opposed to having to call Or repeatedly. It might also be faster than calling Or repeatedly.
func Flip ¶
Flip negates the bits in the given range (i.e., [rangeStart,rangeEnd)), any integer present in this range and in the bitmap is removed,
func Read ¶
Read reads a serialized version of the bitmap (you need to call Free on it once you are done)
func (*Bitmap) And ¶
And computes the intersection between two bitmaps and stores the result in the current bitmap
func (*Bitmap) AndCardinality ¶ added in v0.2.7
AndCardinality computes the size of the intersection between two bitmaps
func (*Bitmap) AndNot ¶
AndNot computes the difference between two bitmaps and stores the result in the current bitmap
func (*Bitmap) AndNotCardinality ¶ added in v0.2.7
AndNotCardinality computes the size of the difference between two bitmaps
func (*Bitmap) Cardinality ¶ added in v0.2.0
Cardinality returns the number of integers contained in the bitmap
func (*Bitmap) Clear ¶ added in v0.2.9
func (rb *Bitmap) Clear()
Clear removes all elements from the bitmap
func (*Bitmap) Flip ¶
Flip negates the bits in the given range (i.e., [rangeStart,rangeEnd)), any integer present in this range and in the bitmap is removed,
func (*Bitmap) IsEmpty ¶
IsEmpty returns true if the Bitmap is empty (it is faster than doing (Cardinality() == 0))
func (*Bitmap) Iterator ¶ added in v0.2.3
func (rb *Bitmap) Iterator() IntIterable
Iterator creates a new IntIterable to iterate over the integers contained in the bitmap, in sorted order
func (*Bitmap) JaccardIndex ¶ added in v0.2.7
JaccardIndex computes the Jaccard index between two bitmaps
func (*Bitmap) Maximum ¶ added in v0.2.4
Maximum returns the largest of the integers contained in the bitmap assuming that it is not empty
func (*Bitmap) Minimum ¶ added in v0.2.4
Minimum returns the smallest of the integers contained in the bitmap assuming that it is not empty
func (*Bitmap) Or ¶
Or computes the union between two bitmaps and stores the result in the current bitmap
func (*Bitmap) OrCardinality ¶ added in v0.2.7
OrCardinality computes the size of the union between two bitmaps
func (*Bitmap) Printf ¶
func (rb *Bitmap) Printf()
Printf writes a description of the bitmap to stdout
func (*Bitmap) RemoveRunCompression ¶
RemoveRunCompression Remove run-length encoding even when it is more space efficient return whether a change was applied
func (*Bitmap) RunOptimize ¶
RunOptimize the compression of the bitmap (call this after populating a new bitmap), return true if the bitmap was modified
func (*Bitmap) Select ¶ added in v0.2.4
Select returns the element having the designated rank, if it exists
func (*Bitmap) SerializedSizeInBytes ¶ added in v0.2.0
SerializedSizeInBytes computes the serialized size in bytes the Bitmap.
func (*Bitmap) ToArray ¶
ToArray creates a new slice containing all of the integers stored in the Bitmap in sorted order
func (*Bitmap) Write ¶
Write writes a serialized version of this bitmap to stream (you should have enough space)
func (*Bitmap) Xor ¶
Xor computes the symmetric difference between two bitmaps and stores the result in the current bitmap
func (*Bitmap) XorCardinality ¶ added in v0.2.7
XorCardinality computes the size of the symmetric difference between two bitmaps
type IntIterable ¶ added in v0.2.3
IntIterable allows you to iterate over the values in a Bitmap