Documentation
¶
Overview ¶
Package gocroaring is a wrapper for CRoaring in go. It provides a fast compressed bitmap data structure. See http://roaringbitmap.org for details.
The package exposes two types: Bitmap, which stores 32-bit integers and wraps the roaring_bitmap_t C type, and Bitmap64, which stores 64-bit integers and wraps the roaring64_bitmap_t C type.
Bitmaps hold memory allocated by C. That memory is released automatically once the Go value becomes unreachable (we rely on runtime.AddCleanup), but you may call Free explicitly to release it eagerly.
Index ¶
- Constants
- Variables
- func AlignedBuffer(size int) []byte
- func AlignedBuffer64(size int) []byte
- func PortableDeserializeSize(b []byte) int
- func PortableDeserializeSize64(b []byte) int
- type Bitmap
- func And(x1, x2 *Bitmap) *Bitmap
- func AndNot(x1, x2 *Bitmap) *Bitmap
- func FastOr(bitmaps ...*Bitmap) *Bitmap
- func FastOrHeap(bitmaps ...*Bitmap) *Bitmap
- func FastXor(bitmaps ...*Bitmap) *Bitmap
- func Flip(bm *Bitmap, rangeStart, rangeEnd uint64) *Bitmap
- func FlipClosed(bm *Bitmap, rangeStart, rangeEnd uint32) *Bitmap
- func FromRange(min, max uint64, step uint32) *Bitmap
- func LazyOr(x1, x2 *Bitmap, bitsetconversion bool) *Bitmap
- func LazyXor(x1, x2 *Bitmap) *Bitmap
- func New(x ...uint32) *Bitmap
- func NewWithCapacity(capacity uint32) *Bitmap
- func Or(x1, x2 *Bitmap) *Bitmap
- func Read(b []byte) (*Bitmap, error)
- func ReadFrozenView(b []byte) (*Bitmap, error)
- func ReadNative(b []byte) (*Bitmap, error)
- func ReadPortableFrozenView(b []byte) (*Bitmap, error)
- func ReadValidated(b []byte) (*Bitmap, error)
- func Xor(x1, x2 *Bitmap) *Bitmap
- func (rb *Bitmap) Add(x ...uint32)
- func (rb *Bitmap) AddBulk(ctx *BulkContext, x uint32)
- func (rb *Bitmap) AddChecked(x uint32) bool
- func (rb *Bitmap) AddOffset(offset int64) *Bitmap
- func (rb *Bitmap) AddRange(min, max uint64)
- func (rb *Bitmap) AddRangeClosed(min, max 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) Assign(x2 *Bitmap) bool
- func (rb *Bitmap) Cardinality() uint64
- func (rb *Bitmap) Clear()
- func (rb *Bitmap) Clone() *Bitmap
- func (rb *Bitmap) Contains(x uint32) bool
- func (rb *Bitmap) ContainsBulk(ctx *BulkContext, x uint32) bool
- func (rb *Bitmap) ContainsRange(x, y uint64) bool
- func (rb *Bitmap) ContainsRangeClosed(x, y uint32) bool
- func (rb *Bitmap) Equals(o interface{}) bool
- func (rb *Bitmap) Flip(rangeStart, rangeEnd uint64)
- func (rb *Bitmap) FlipClosed(rangeStart, rangeEnd uint32)
- func (rb *Bitmap) Free()
- func (rb *Bitmap) FrozenSizeInBytes() int
- func (rb *Bitmap) GetCardinality() uint64
- func (rb *Bitmap) GetCopyOnWrite() bool
- func (rb *Bitmap) GetIndex(x uint32) int64
- func (rb *Bitmap) InternalValidate() error
- func (rb *Bitmap) Intersect(x2 *Bitmap) bool
- func (rb *Bitmap) IntersectWithRange(x, y uint64) bool
- func (rb *Bitmap) IsEmpty() bool
- func (rb *Bitmap) IsStrictSubset(x2 *Bitmap) bool
- func (rb *Bitmap) IsSubset(x2 *Bitmap) bool
- func (rb *Bitmap) Iterate(cb func(x uint32) bool)
- func (rb *Bitmap) Iterator() IntIterable
- func (rb *Bitmap) JaccardIndex(x2 *Bitmap) float64
- func (rb *Bitmap) LazyOrInplace(x2 *Bitmap, bitsetconversion bool)
- func (rb *Bitmap) LazyXorInplace(x2 *Bitmap)
- func (rb *Bitmap) Maximum() uint32
- func (rb *Bitmap) Minimum() uint32
- func (rb *Bitmap) NativeSerializedSizeInBytes() int
- func (rb *Bitmap) NewIterator() *Iterator
- func (rb *Bitmap) Or(x2 *Bitmap)
- func (rb *Bitmap) OrCardinality(x2 *Bitmap) uint64
- func (rb *Bitmap) Printf()
- func (rb *Bitmap) RangeCardinality(min, max uint64) uint64
- func (rb *Bitmap) RangeCardinalityClosed(min, max uint32) uint64
- func (rb *Bitmap) RangeToArray(offset, limit uint64) []uint32
- func (rb *Bitmap) Rank(x uint32) uint64
- func (rb *Bitmap) RankMany(vals []uint32) []uint64
- func (rb *Bitmap) Remove(x uint32)
- func (rb *Bitmap) RemoveChecked(x uint32) bool
- func (rb *Bitmap) RemoveMany(x ...uint32)
- func (rb *Bitmap) RemoveRange(min, max uint64)
- func (rb *Bitmap) RemoveRangeClosed(min, max uint32)
- func (rb *Bitmap) RemoveRunCompression() bool
- func (rb *Bitmap) RepairAfterLazy()
- func (rb *Bitmap) ReverseIterator() *Iterator
- func (rb *Bitmap) RunOptimize() bool
- func (rb *Bitmap) Select(rank uint32) (uint32, error)
- func (rb *Bitmap) SerializedSizeInBytes() int
- func (rb *Bitmap) SetCopyOnWrite(cow bool)
- func (rb *Bitmap) ShrinkToFit() int
- func (rb *Bitmap) Stats() map[string]uint64
- func (rb *Bitmap) StatsStruct() Statistics
- func (rb *Bitmap) String() string
- func (rb *Bitmap) ToArray() []uint32
- func (rb *Bitmap) ToBytes() []byte
- func (rb *Bitmap) ToDenseBitset() ([]uint64, error)
- func (rb *Bitmap) Write(b []byte) error
- func (rb *Bitmap) WriteFrozen(b []byte) error
- func (rb *Bitmap) WriteNative(b []byte) error
- func (rb *Bitmap) Xor(x2 *Bitmap)
- func (rb *Bitmap) XorCardinality(x2 *Bitmap) uint64
- type Bitmap64
- func And64(x1, x2 *Bitmap64) *Bitmap64
- func AndNot64(x1, x2 *Bitmap64) *Bitmap64
- func Flip64(bm *Bitmap64, rangeStart, rangeEnd uint64) *Bitmap64
- func FlipClosed64(bm *Bitmap64, rangeStart, rangeEnd uint64) *Bitmap64
- func FromRange64(min, max, step uint64) *Bitmap64
- func MoveFrom32(from *Bitmap) *Bitmap64
- func New64(x ...uint64) *Bitmap64
- func Or64(x1, x2 *Bitmap64) *Bitmap64
- func Read64(b []byte) (*Bitmap64, error)
- func ReadFrozenView64(b []byte) (*Bitmap64, error)
- func ReadPortableFrozenView64(b []byte) (*Bitmap64, error)
- func ReadValidated64(b []byte) (*Bitmap64, error)
- func Xor64(x1, x2 *Bitmap64) *Bitmap64
- func (rb *Bitmap64) Add(x ...uint64)
- func (rb *Bitmap64) AddBulk(ctx *BulkContext64, x uint64)
- func (rb *Bitmap64) AddChecked(x uint64) bool
- func (rb *Bitmap64) AddOffset(offset int64) *Bitmap64
- func (rb *Bitmap64) AddRange(min, max uint64)
- func (rb *Bitmap64) AddRangeClosed(min, max uint64)
- func (rb *Bitmap64) And(x2 *Bitmap64)
- func (rb *Bitmap64) AndCardinality(x2 *Bitmap64) uint64
- func (rb *Bitmap64) AndNot(x2 *Bitmap64)
- func (rb *Bitmap64) AndNotCardinality(x2 *Bitmap64) uint64
- func (rb *Bitmap64) Assign(x2 *Bitmap64)
- func (rb *Bitmap64) Cardinality() uint64
- func (rb *Bitmap64) Clear()
- func (rb *Bitmap64) Clone() *Bitmap64
- func (rb *Bitmap64) Contains(x uint64) bool
- func (rb *Bitmap64) ContainsBulk(ctx *BulkContext64, x uint64) bool
- func (rb *Bitmap64) ContainsRange(x, y uint64) bool
- func (rb *Bitmap64) ContainsRangeClosed(x, y uint64) bool
- func (rb *Bitmap64) Equals(o interface{}) bool
- func (rb *Bitmap64) Flip(rangeStart, rangeEnd uint64)
- func (rb *Bitmap64) FlipClosed(rangeStart, rangeEnd uint64)
- func (rb *Bitmap64) Free()
- func (rb *Bitmap64) FrozenSizeInBytes() int
- func (rb *Bitmap64) GetCardinality() uint64
- func (rb *Bitmap64) GetIndex(x uint64) int64
- func (rb *Bitmap64) InternalValidate() error
- func (rb *Bitmap64) Intersect(x2 *Bitmap64) bool
- func (rb *Bitmap64) IntersectWithRange(x, y uint64) bool
- func (rb *Bitmap64) IsEmpty() bool
- func (rb *Bitmap64) IsStrictSubset(x2 *Bitmap64) bool
- func (rb *Bitmap64) IsSubset(x2 *Bitmap64) bool
- func (rb *Bitmap64) Iterate(cb func(x uint64) bool)
- func (rb *Bitmap64) Iterator() IntIterable64
- func (rb *Bitmap64) JaccardIndex(x2 *Bitmap64) float64
- func (rb *Bitmap64) Maximum() uint64
- func (rb *Bitmap64) Minimum() uint64
- func (rb *Bitmap64) NewIterator() *Iterator64
- func (rb *Bitmap64) Or(x2 *Bitmap64)
- func (rb *Bitmap64) OrCardinality(x2 *Bitmap64) uint64
- func (rb *Bitmap64) RangeCardinality(min, max uint64) uint64
- func (rb *Bitmap64) RangeCardinalityClosed(min, max uint64) uint64
- func (rb *Bitmap64) Rank(x uint64) uint64
- func (rb *Bitmap64) Remove(x uint64)
- func (rb *Bitmap64) RemoveBulk(ctx *BulkContext64, x uint64)
- func (rb *Bitmap64) RemoveChecked(x uint64) bool
- func (rb *Bitmap64) RemoveMany(x ...uint64)
- func (rb *Bitmap64) RemoveRange(min, max uint64)
- func (rb *Bitmap64) RemoveRangeClosed(min, max uint64)
- func (rb *Bitmap64) RemoveRunCompression() bool
- func (rb *Bitmap64) ReverseIterator() *Iterator64
- func (rb *Bitmap64) RunOptimize() bool
- func (rb *Bitmap64) Select(rank uint64) (uint64, error)
- func (rb *Bitmap64) SerializedSizeInBytes() int
- func (rb *Bitmap64) ShrinkToFit() int
- func (rb *Bitmap64) Stats() map[string]uint64
- func (rb *Bitmap64) StatsStruct() Statistics
- func (rb *Bitmap64) String() string
- func (rb *Bitmap64) ToArray() []uint64
- func (rb *Bitmap64) ToBytes() []byte
- func (rb *Bitmap64) Write(b []byte) error
- func (rb *Bitmap64) WriteFrozen(b []byte) error
- func (rb *Bitmap64) Xor(x2 *Bitmap64)
- func (rb *Bitmap64) XorCardinality(x2 *Bitmap64) uint64
- type BulkContext
- type BulkContext64
- type IntIterable
- type IntIterable64
- type Iterator
- func (i *Iterator) AdvanceIfNeeded(x uint32) bool
- func (i *Iterator) Clone() *Iterator
- func (i *Iterator) Free()
- func (i *Iterator) HasValue() bool
- func (i *Iterator) Next() bool
- func (i *Iterator) Previous() bool
- func (i *Iterator) Read(buf []uint32) int
- func (i *Iterator) ReadBackward(buf []uint32) int
- func (i *Iterator) ReadPreviousRanges(buf []Range) int
- func (i *Iterator) ReadRanges(buf []Range) int
- func (i *Iterator) Reset()
- func (i *Iterator) ResetToLast()
- func (i *Iterator) Skip(count uint32) uint32
- func (i *Iterator) SkipBackward(count uint32) uint32
- func (i *Iterator) Value() uint32
- type Iterator64
- func (i *Iterator64) AdvanceIfNeeded(x uint64) bool
- func (i *Iterator64) Clone() *Iterator64
- func (i *Iterator64) Free()
- func (i *Iterator64) HasValue() bool
- func (i *Iterator64) Next() bool
- func (i *Iterator64) Previous() bool
- func (i *Iterator64) Read(buf []uint64) int
- func (i *Iterator64) ReadBackward(buf []uint64) int
- func (i *Iterator64) ReadPreviousRanges(buf []Range64) int
- func (i *Iterator64) ReadRanges(buf []Range64) int
- func (i *Iterator64) Reset()
- func (i *Iterator64) ResetToLast()
- func (i *Iterator64) Value() uint64
- type Range
- type Range64
- type Statistics
Constants ¶
const CRoaringMajor = C.ROARING_VERSION_MAJOR
CRoaringMajor, CRoaringMinor and CRoaringRevision report the version of the bundled CRoaring library.
const CRoaringMinor = C.ROARING_VERSION_MINOR
const CRoaringRevision = C.ROARING_VERSION_REVISION
const CRoaringVersion = C.ROARING_VERSION
CRoaringVersion is the version of the bundled CRoaring library, as a string.
const Frozen64Alignment = 64
Frozen64Alignment is the alignment that a buffer must have before it can back a 64-bit frozen view. See AlignedBuffer64 and ReadFrozenView64.
const FrozenAlignment = 32
FrozenAlignment is the alignment that a buffer must have before it can back a frozen view. See AlignedBuffer and ReadFrozenView.
Variables ¶
var ( // ErrNotEnoughSpace is returned by the serialization routines when the // provided buffer is too small. ErrNotEnoughSpace = errors.New("not enough space") // ErrEmptyBuffer is returned when a deserialization routine is handed an // empty buffer. ErrEmptyBuffer = errors.New("empty buffer") // ErrDeserialize is returned when a buffer does not contain a valid bitmap. ErrDeserialize = errors.New("failed to read roaring bitmap") // ErrMisaligned is returned by the frozen view routines when the buffer is // not aligned on a FrozenAlignment boundary. ErrMisaligned = fmt.Errorf("buffer is not aligned on a %d-byte boundary", FrozenAlignment) // ErrNoSuchElement is returned by Select when the rank is out of range. ErrNoSuchElement = errors.New("no such element") )
var ErrMisaligned64 = fmt.Errorf("buffer is not aligned on a %d-byte boundary", Frozen64Alignment)
ErrMisaligned64 is returned by ReadFrozenView64 when the buffer is not aligned on a Frozen64Alignment boundary.
var ErrNotShrunken = errors.New("the bitmap must be shrunk to fit before it can be frozen")
ErrNotShrunken is returned by Bitmap64.WriteFrozen when ShrinkToFit has not been called since the last modification of the bitmap.
Functions ¶
func AlignedBuffer ¶ added in v1.1.0
AlignedBuffer returns a byte slice of the requested size whose first byte is aligned on a FrozenAlignment boundary, as required by ReadFrozenView.
func AlignedBuffer64 ¶ added in v1.1.0
AlignedBuffer64 returns a byte slice of the requested size whose first byte is aligned on a Frozen64Alignment boundary, as required by ReadFrozenView64.
func PortableDeserializeSize ¶ added in v1.1.0
PortableDeserializeSize returns how many bytes would be read from b by Read, or zero if b does not start with a valid bitmap.
func PortableDeserializeSize64 ¶ added in v1.1.0
PortableDeserializeSize64 returns how many bytes would be read from b by Read64, or zero if b does not start with a valid bitmap.
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
Bitmap is a compressed bitmap of 32-bit integers.
A Bitmap is not safe for concurrent modification.
func And ¶
And computes the intersection between two bitmaps and returns the result. This function may panic if the allocation failed.
func AndNot ¶
AndNot computes the difference between two bitmaps and returns the result. This function may panic if the allocation failed.
func FastOr ¶
FastOr computes the union between many bitmaps quickly, as opposed to having to call Or repeatedly. This function may panic if the allocation failed.
func FastOrHeap ¶ added in v1.1.0
FastOrHeap computes the union between many bitmaps using a heap. It can be faster than FastOr when the bitmaps are numerous and of uneven sizes. This function may panic if the allocation failed.
func FastXor ¶ added in v1.1.0
FastXor computes the symmetric difference between many bitmaps quickly, as opposed to having to call Xor repeatedly. This function may panic if the allocation failed.
func Flip ¶
Flip negates the bits in the given range (i.e., [rangeStart, rangeEnd)) and returns the result. This function may panic if the allocation failed.
func FlipClosed ¶ added in v1.1.0
FlipClosed negates the bits in the given range (i.e., [rangeStart, rangeEnd]) and returns the result. This function may panic if the allocation failed.
func FromRange ¶ added in v1.1.0
FromRange creates a bitmap containing min, min+step, min+2*step... up to but not including max. An empty range yields an empty bitmap. The step must be strictly positive. This function may panic if the allocation failed.
func LazyOr ¶ added in v1.1.0
LazyOr computes the union between two bitmaps, leaving the result in an invalid state until RepairAfterLazy is called on it. Set bitsetconversion to true to eagerly convert containers to bitsets when it might help. This function may panic if the allocation failed.
func LazyXor ¶ added in v1.1.0
LazyXor computes the symmetric difference between two bitmaps, leaving the result in an invalid state until RepairAfterLazy is called on it. This function may panic if the allocation failed.
func New ¶ added in v0.2.0
New creates a new Bitmap with any number of initial values. This function may panic if the allocation failed.
func NewWithCapacity ¶ added in v1.1.0
NewWithCapacity creates a new Bitmap with room for the given number of containers, avoiding some reallocations when the bitmap is populated. This function may panic if the allocation failed.
func Or ¶
Or computes the union between two bitmaps and returns the result. This function may panic if the allocation failed.
func Read ¶
Read reads a serialized version of the bitmap, in the portable format. The buffer is not retained. If the data comes from an untrusted source, prefer ReadValidated.
func ReadFrozenView ¶ added in v0.2.65
ReadFrozenView reads a frozen serialized version of the bitmap, as written by WriteFrozen. The result is immutable: attempting to mutate it will fail catastrophically. The buffer must be aligned on a FrozenAlignment boundary (see AlignedBuffer) and its length must be exactly the length that was written. A reference to the buffer is retained for the lifetime of the view.
func ReadNative ¶ added in v1.1.0
ReadNative reads a bitmap written by WriteNative. The buffer is not retained.
func ReadPortableFrozenView ¶ added in v1.1.0
ReadPortableFrozenView reads a bitmap written in the portable format (see Write) without copying the container data: the result is a read-only view over b. A reference to the buffer is retained for the lifetime of the view.
func ReadValidated ¶ added in v1.1.0
ReadValidated reads a serialized version of the bitmap, in the portable format, and checks its internal consistency. Use it when the data comes from an untrusted source. The deserialization and the validation are performed in a single crossing of the Go/C boundary.
func Xor ¶
Xor computes the symmetric difference between two bitmaps and returns the result. This function may panic if the allocation failed.
func (*Bitmap) AddBulk ¶ added in v1.1.0
func (rb *Bitmap) AddBulk(ctx *BulkContext, x uint32)
AddBulk adds the integer x to the bitmap, using ctx to remember the last container visited. Values should be provided in ascending order.
func (*Bitmap) AddChecked ¶ added in v1.1.0
AddChecked adds the integer x to the bitmap and reports whether a new value was actually added.
func (*Bitmap) AddOffset ¶ added in v1.1.0
AddOffset returns a copy of the bitmap with the given (possibly negative) offset added to every value. Values that fall outside the 32-bit range are dropped. This function may panic if the allocation failed.
func (*Bitmap) AddRangeClosed ¶ added in v1.1.0
AddRangeClosed adds all values in the range [min, max].
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) Assign ¶ added in v0.3.0
Assign copies x2 over rb, returning false if the copy failed.
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) Clone ¶
Clone creates a copy of the Bitmap. This function may panic if the allocation failed.
func (*Bitmap) ContainsBulk ¶ added in v1.1.0
func (rb *Bitmap) ContainsBulk(ctx *BulkContext, x uint32) bool
ContainsBulk reports whether the integer x is in the bitmap, using ctx to remember the last container visited. Values should be provided in ascending order.
func (*Bitmap) ContainsRange ¶ added in v0.3.0
ContainsRange returns true if all the integers in the range [x, y) are contained in the bitmap.
func (*Bitmap) ContainsRangeClosed ¶ added in v1.1.0
ContainsRangeClosed returns true if all the integers in the range [x, y] are contained in 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, and any integer in the range that was absent is added.
func (*Bitmap) FlipClosed ¶ added in v1.1.0
FlipClosed negates the bits in the given range (i.e., [rangeStart, rangeEnd]).
func (*Bitmap) Free ¶ added in v0.4.0
func (rb *Bitmap) Free()
Free releases the memory held by the bitmap. Using the bitmap afterwards is a mistake. Calling Free more than once is harmless.
func (*Bitmap) FrozenSizeInBytes ¶ added in v0.2.65
FrozenSizeInBytes computes the frozen serialized size in bytes.
func (*Bitmap) GetCardinality ¶
GetCardinality returns the number of integers contained in the bitmap.
func (*Bitmap) GetCopyOnWrite ¶ added in v1.1.0
GetCopyOnWrite reports whether the bitmap uses copy-on-write containers.
func (*Bitmap) GetIndex ¶ added in v1.1.0
GetIndex returns the index of x in the bitmap, or -1 if x is not present. Unlike Rank, it distinguishes a missing value from a value of rank zero.
func (*Bitmap) InternalValidate ¶ added in v1.1.0
InternalValidate performs internal consistency checks. It is useful after deserializing bitmaps from untrusted sources. It returns nil if the bitmap is consistent, and an error describing the problem otherwise.
func (*Bitmap) IntersectWithRange ¶ added in v1.1.0
IntersectWithRange checks whether the bitmap intersects the range [x, y).
func (*Bitmap) IsEmpty ¶
IsEmpty returns true if the Bitmap is empty (it is faster than doing Cardinality() == 0).
func (*Bitmap) IsStrictSubset ¶ added in v1.1.0
IsStrictSubset returns true if every integer of rb is also in x2 and the two bitmaps differ.
func (*Bitmap) IsSubset ¶ added in v1.1.0
IsSubset returns true if every integer of rb is also in x2.
func (*Bitmap) Iterate ¶ added in v1.1.0
Iterate calls cb with every integer in the bitmap, in sorted order, stopping early if cb returns false.
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. This function may panic if the allocation failed.
func (*Bitmap) JaccardIndex ¶ added in v0.2.7
JaccardIndex computes the Jaccard index between two bitmaps.
func (*Bitmap) LazyOrInplace ¶ added in v1.1.0
LazyOrInplace computes the union with x2 in place, leaving the bitmap in an invalid state until RepairAfterLazy is called. Set bitsetconversion to true to eagerly convert containers to bitsets when it might help.
func (*Bitmap) LazyXorInplace ¶ added in v1.1.0
LazyXorInplace computes the symmetric difference with x2 in place, leaving the bitmap in an invalid state until RepairAfterLazy is called.
func (*Bitmap) Maximum ¶ added in v0.2.4
Maximum returns the largest of the integers contained in the bitmap, or 0 if the bitmap is empty.
func (*Bitmap) Minimum ¶ added in v0.2.4
Minimum returns the smallest of the integers contained in the bitmap, or math.MaxUint32 if the bitmap is empty.
func (*Bitmap) NativeSerializedSizeInBytes ¶ added in v1.1.0
NativeSerializedSizeInBytes computes the serialized size in bytes of the Bitmap, using the non-portable native format. The native format is not compatible with the Java and Go implementations; prefer the portable format unless you know what you are doing.
func (*Bitmap) NewIterator ¶ added in v1.1.0
NewIterator returns an iterator positioned on the smallest value of the bitmap. This function may panic if the allocation failed.
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) RangeCardinality ¶ added in v1.1.0
RangeCardinality returns the number of integers in the bitmap that fall in the range [min, max).
func (*Bitmap) RangeCardinalityClosed ¶ added in v1.1.0
RangeCardinalityClosed returns the number of integers in the bitmap that fall in the range [min, max].
func (*Bitmap) RangeToArray ¶ added in v1.1.0
RangeToArray returns at most limit integers from the bitmap, in sorted order, starting at the given offset (a rank, not a value).
func (*Bitmap) RankMany ¶ added in v1.1.0
RankMany returns the rank of each value in vals. The values must be sorted in ascending order. It is faster than calling Rank repeatedly.
func (*Bitmap) RemoveChecked ¶ added in v1.1.0
RemoveChecked removes the integer x from the bitmap and reports whether a value was actually removed.
func (*Bitmap) RemoveMany ¶ added in v1.1.0
RemoveMany removes the integer(s) x from the bitmap.
func (*Bitmap) RemoveRange ¶ added in v0.3.0
RemoveRange removes all values in the range [min, max).
func (*Bitmap) RemoveRangeClosed ¶ added in v1.1.0
RemoveRangeClosed removes all values in the range [min, max].
func (*Bitmap) RemoveRunCompression ¶
RemoveRunCompression removes run-length encoding even when it is more space efficient; it returns whether a change was applied.
func (*Bitmap) RepairAfterLazy ¶ added in v1.1.0
func (rb *Bitmap) RepairAfterLazy()
RepairAfterLazy restores a bitmap produced by the lazy operations to a valid state. It must be called before any other operation.
func (*Bitmap) ReverseIterator ¶ added in v1.1.0
ReverseIterator returns an iterator positioned on the largest value of the bitmap, meant to be walked with Previous. This function may panic if the allocation failed.
func (*Bitmap) RunOptimize ¶
RunOptimize improves the compression of the bitmap (call this after populating a new bitmap); it returns 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 of the Bitmap, using the portable format.
func (*Bitmap) SetCopyOnWrite ¶ added in v1.1.0
SetCopyOnWrite turns copy-on-write on or off. Copy-on-write saves memory and avoids copies, but it requires more care in a threaded context. If you enable it, enable it on all of your bitmaps: mixing bitmaps with and without copy-on-write is unsafe.
func (*Bitmap) ShrinkToFit ¶ added in v1.1.0
ShrinkToFit releases unused memory and returns how many bytes were freed.
func (*Bitmap) StatsStruct ¶ added in v0.3.0
func (rb *Bitmap) StatsStruct() Statistics
StatsStruct is the same as Stats but returns a typed struct. See https://github.com/RoaringBitmap/roaring/pull/73 for the rationale.
func (*Bitmap) ToArray ¶
ToArray creates a new slice containing all of the integers stored in the Bitmap in sorted order.
func (*Bitmap) ToBytes ¶ added in v1.1.0
ToBytes returns a serialized version of this bitmap, using the portable format.
func (*Bitmap) ToDenseBitset ¶ added in v1.1.0
ToDenseBitset converts the bitmap to an uncompressed bitset, returned as a slice of 64-bit words in little-endian bit order: value x is present when bit x%64 of word x/64 is set. Beware that the result can be large: a bitmap containing a single large value produces a slice proportional to that value.
func (*Bitmap) Write ¶
Write writes a serialized version of this bitmap to b, using the portable format. The buffer must be at least SerializedSizeInBytes long.
func (*Bitmap) WriteFrozen ¶ added in v0.2.65
WriteFrozen writes a serialized version of the bitmap to b in the frozen format. The buffer must be at least FrozenSizeInBytes long. The frozen format is endian-sensitive and version-specific; it is meant for fast reloading of data you produced yourself, not for interchange.
func (*Bitmap) WriteNative ¶ added in v1.1.0
WriteNative writes a serialized version of this bitmap to b, using the non-portable native format.
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 Bitmap64 ¶ added in v1.1.0
type Bitmap64 struct {
// contains filtered or unexported fields
}
Bitmap64 is a compressed bitmap of 64-bit integers.
A Bitmap64 is not safe for concurrent modification.
func And64 ¶ added in v1.1.0
And64 computes the intersection between two bitmaps and returns the result. This function may panic if the allocation failed.
func AndNot64 ¶ added in v1.1.0
AndNot64 computes the difference between two bitmaps and returns the result. This function may panic if the allocation failed.
func Flip64 ¶ added in v1.1.0
Flip64 negates the bits in the given range (i.e., [rangeStart, rangeEnd)) and returns the result. This function may panic if the allocation failed.
func FlipClosed64 ¶ added in v1.1.0
FlipClosed64 negates the bits in the given range (i.e., [rangeStart, rangeEnd]) and returns the result. This function may panic if the allocation failed.
func FromRange64 ¶ added in v1.1.0
FromRange64 creates a bitmap containing min, min+step, min+2*step... up to but not including max. An empty range yields an empty bitmap. The step must be strictly positive. This function may panic if the allocation failed.
func MoveFrom32 ¶ added in v1.1.0
MoveFrom32 builds a 64-bit bitmap by moving the containers out of a 32-bit bitmap. This avoids copying the container data, but it leaves the source bitmap empty.
The containers are taken without regard for copy-on-write sharing, so do not use it on a bitmap whose containers are shared with another one (that is, a bitmap that has copy-on-write enabled and has been cloned). Clone first if you need the source intact. This function may panic if the allocation failed.
func New64 ¶ added in v1.1.0
New64 creates a new Bitmap64 with any number of initial values. This function may panic if the allocation failed.
func Or64 ¶ added in v1.1.0
Or64 computes the union between two bitmaps and returns the result. This function may panic if the allocation failed.
func Read64 ¶ added in v1.1.0
Read64 reads a serialized version of the bitmap, in the portable format. The buffer is not retained. If the data comes from an untrusted source, prefer ReadValidated64.
func ReadFrozenView64 ¶ added in v1.1.0
ReadFrozenView64 reads a frozen serialized version of the bitmap, as written by Bitmap64.WriteFrozen. The result is immutable: attempting to mutate it will fail catastrophically. The buffer must be aligned on a Frozen64Alignment boundary (see AlignedBuffer64) and its length must be exactly the length that was written. A reference to the buffer is retained for the lifetime of the view.
func ReadPortableFrozenView64 ¶ added in v1.1.0
ReadPortableFrozenView64 reads a bitmap written in the portable format (see Bitmap64.Write) without copying the container data: the result is a read-only view over b. A reference to the buffer is retained for the lifetime of the view. It fails on big-endian systems, where the portable format cannot be viewed in place.
func ReadValidated64 ¶ added in v1.1.0
ReadValidated64 reads a serialized version of the bitmap, in the portable format, and checks its internal consistency. Use it when the data comes from an untrusted source. The deserialization and the validation are performed in a single crossing of the Go/C boundary.
func Xor64 ¶ added in v1.1.0
Xor64 computes the symmetric difference between two bitmaps and returns the result. This function may panic if the allocation failed.
func (*Bitmap64) AddBulk ¶ added in v1.1.0
func (rb *Bitmap64) AddBulk(ctx *BulkContext64, x uint64)
AddBulk adds the integer x to the bitmap, using ctx to remember the last container visited. Values should be provided in ascending order.
func (*Bitmap64) AddChecked ¶ added in v1.1.0
AddChecked adds the integer x to the bitmap and reports whether a new value was actually added.
func (*Bitmap64) AddOffset ¶ added in v1.1.0
AddOffset returns a copy of the bitmap with the given (possibly negative) offset added to every value. Values that fall outside the 64-bit range are dropped. This function may panic if the allocation failed.
func (*Bitmap64) AddRangeClosed ¶ added in v1.1.0
AddRangeClosed adds all values in the range [min, max].
func (*Bitmap64) And ¶ added in v1.1.0
And computes the intersection between two bitmaps and stores the result in the current bitmap.
func (*Bitmap64) AndCardinality ¶ added in v1.1.0
AndCardinality computes the size of the intersection between two bitmaps.
func (*Bitmap64) AndNot ¶ added in v1.1.0
AndNot computes the difference between two bitmaps and stores the result in the current bitmap.
func (*Bitmap64) AndNotCardinality ¶ added in v1.1.0
AndNotCardinality computes the size of the difference between two bitmaps.
func (*Bitmap64) Cardinality ¶ added in v1.1.0
Cardinality returns the number of integers contained in the bitmap.
func (*Bitmap64) Clear ¶ added in v1.1.0
func (rb *Bitmap64) Clear()
Clear removes all elements from the bitmap.
func (*Bitmap64) Clone ¶ added in v1.1.0
Clone creates a copy of the Bitmap64. This function may panic if the allocation failed.
func (*Bitmap64) Contains ¶ added in v1.1.0
Contains returns true if the integer is contained in the bitmap.
func (*Bitmap64) ContainsBulk ¶ added in v1.1.0
func (rb *Bitmap64) ContainsBulk(ctx *BulkContext64, x uint64) bool
ContainsBulk reports whether the integer x is in the bitmap, using ctx to remember the last container visited. Values should be provided in ascending order.
func (*Bitmap64) ContainsRange ¶ added in v1.1.0
ContainsRange returns true if all the integers in the range [x, y) are contained in the bitmap.
func (*Bitmap64) ContainsRangeClosed ¶ added in v1.1.0
ContainsRangeClosed returns true if all the integers in the range [x, y] are contained in the bitmap.
func (*Bitmap64) Equals ¶ added in v1.1.0
Equals returns true if the two bitmaps contain the same integers.
func (*Bitmap64) Flip ¶ added in v1.1.0
Flip negates the bits in the given range (i.e., [rangeStart, rangeEnd)).
func (*Bitmap64) FlipClosed ¶ added in v1.1.0
FlipClosed negates the bits in the given range (i.e., [rangeStart, rangeEnd]).
func (*Bitmap64) Free ¶ added in v1.1.0
func (rb *Bitmap64) Free()
Free releases the memory held by the bitmap. Using the bitmap afterwards is a mistake. Calling Free more than once is harmless.
func (*Bitmap64) FrozenSizeInBytes ¶ added in v1.1.0
FrozenSizeInBytes computes the frozen serialized size in bytes. ShrinkToFit must have been called since the last modification of the bitmap; otherwise this returns zero.
func (*Bitmap64) GetCardinality ¶ added in v1.1.0
GetCardinality returns the number of integers contained in the bitmap.
func (*Bitmap64) GetIndex ¶ added in v1.1.0
GetIndex returns the index of x in the bitmap, or -1 if x is not present. Unlike Rank, it distinguishes a missing value from a value of rank zero.
func (*Bitmap64) InternalValidate ¶ added in v1.1.0
InternalValidate performs internal consistency checks. It is useful after deserializing bitmaps from untrusted sources. It returns nil if the bitmap is consistent, and an error describing the problem otherwise.
func (*Bitmap64) IntersectWithRange ¶ added in v1.1.0
IntersectWithRange checks whether the bitmap intersects the range [x, y).
func (*Bitmap64) IsEmpty ¶ added in v1.1.0
IsEmpty returns true if the Bitmap64 is empty (it is faster than doing Cardinality() == 0).
func (*Bitmap64) IsStrictSubset ¶ added in v1.1.0
IsStrictSubset returns true if every integer of rb is also in x2 and the two bitmaps differ.
func (*Bitmap64) IsSubset ¶ added in v1.1.0
IsSubset returns true if every integer of rb is also in x2.
func (*Bitmap64) Iterate ¶ added in v1.1.0
Iterate calls cb with every integer in the bitmap, in sorted order, stopping early if cb returns false.
func (*Bitmap64) Iterator ¶ added in v1.1.0
func (rb *Bitmap64) Iterator() IntIterable64
Iterator creates a new IntIterable64 to iterate over the integers contained in the bitmap, in sorted order. This function may panic if the allocation failed.
func (*Bitmap64) JaccardIndex ¶ added in v1.1.0
JaccardIndex computes the Jaccard index between two bitmaps.
func (*Bitmap64) Maximum ¶ added in v1.1.0
Maximum returns the largest of the integers contained in the bitmap, or 0 if the bitmap is empty.
func (*Bitmap64) Minimum ¶ added in v1.1.0
Minimum returns the smallest of the integers contained in the bitmap, or math.MaxUint64 if the bitmap is empty.
func (*Bitmap64) NewIterator ¶ added in v1.1.0
func (rb *Bitmap64) NewIterator() *Iterator64
NewIterator returns an iterator positioned on the smallest value of the bitmap. This function may panic if the allocation failed.
func (*Bitmap64) Or ¶ added in v1.1.0
Or computes the union between two bitmaps and stores the result in the current bitmap.
func (*Bitmap64) OrCardinality ¶ added in v1.1.0
OrCardinality computes the size of the union between two bitmaps.
func (*Bitmap64) RangeCardinality ¶ added in v1.1.0
RangeCardinality returns the number of integers in the bitmap that fall in the range [min, max).
func (*Bitmap64) RangeCardinalityClosed ¶ added in v1.1.0
RangeCardinalityClosed returns the number of integers in the bitmap that fall in the range [min, max].
func (*Bitmap64) RemoveBulk ¶ added in v1.1.0
func (rb *Bitmap64) RemoveBulk(ctx *BulkContext64, x uint64)
RemoveBulk removes the integer x from the bitmap, using ctx to remember the last container visited. Values should be provided in ascending order.
func (*Bitmap64) RemoveChecked ¶ added in v1.1.0
RemoveChecked removes the integer x from the bitmap and reports whether a value was actually removed.
func (*Bitmap64) RemoveMany ¶ added in v1.1.0
RemoveMany removes the integer(s) x from the bitmap.
func (*Bitmap64) RemoveRange ¶ added in v1.1.0
RemoveRange removes all values in the range [min, max).
func (*Bitmap64) RemoveRangeClosed ¶ added in v1.1.0
RemoveRangeClosed removes all values in the range [min, max].
func (*Bitmap64) RemoveRunCompression ¶ added in v1.1.0
RemoveRunCompression removes run-length encoding even when it is more space efficient; it returns whether a change was applied.
func (*Bitmap64) ReverseIterator ¶ added in v1.1.0
func (rb *Bitmap64) ReverseIterator() *Iterator64
ReverseIterator returns an iterator positioned on the largest value of the bitmap, meant to be walked with Previous. This function may panic if the allocation failed.
func (*Bitmap64) RunOptimize ¶ added in v1.1.0
RunOptimize improves the compression of the bitmap (call this after populating a new bitmap); it returns true if the bitmap was modified.
func (*Bitmap64) Select ¶ added in v1.1.0
Select returns the element having the designated rank, if it exists.
func (*Bitmap64) SerializedSizeInBytes ¶ added in v1.1.0
SerializedSizeInBytes computes the serialized size in bytes of the Bitmap64, using the portable format.
func (*Bitmap64) ShrinkToFit ¶ added in v1.1.0
ShrinkToFit releases unused memory and returns how many bytes were freed.
func (*Bitmap64) StatsStruct ¶ added in v1.1.0
func (rb *Bitmap64) StatsStruct() Statistics
StatsStruct returns statistics describing the internal structure of the bitmap.
func (*Bitmap64) ToArray ¶ added in v1.1.0
ToArray creates a new slice containing all of the integers stored in the Bitmap64 in sorted order.
func (*Bitmap64) ToBytes ¶ added in v1.1.0
ToBytes returns a serialized version of this bitmap, using the portable format.
func (*Bitmap64) Write ¶ added in v1.1.0
Write writes a serialized version of this bitmap to b, using the portable format. The buffer must be at least SerializedSizeInBytes long.
func (*Bitmap64) WriteFrozen ¶ added in v1.1.0
WriteFrozen writes a serialized version of the bitmap to b in the frozen format. ShrinkToFit must have been called since the last modification of the bitmap. The buffer must be at least FrozenSizeInBytes long. The frozen format is endian-sensitive and version-specific; it is meant for fast reloading of data you produced yourself, not for interchange.
func (*Bitmap64) Xor ¶ added in v1.1.0
Xor computes the symmetric difference between two bitmaps and stores the result in the current bitmap.
func (*Bitmap64) XorCardinality ¶ added in v1.1.0
XorCardinality computes the size of the symmetric difference between two bitmaps.
type BulkContext ¶ added in v1.1.0
type BulkContext struct {
// contains filtered or unexported fields
}
BulkContext accelerates repeated accesses to a bitmap when the values are provided in ascending order. A context is tied to the bitmap it was last used with: it must not be reused across bitmaps, and it must be discarded whenever the bitmap is modified by anything other than AddBulk.
func NewBulkContext ¶ added in v1.1.0
func NewBulkContext() *BulkContext
NewBulkContext returns a fresh context for use with AddBulk and ContainsBulk.
type BulkContext64 ¶ added in v1.1.0
type BulkContext64 struct {
// contains filtered or unexported fields
}
BulkContext64 accelerates repeated accesses to a Bitmap64 when the values are provided in ascending order. A context is tied to the bitmap it was last used with: it must not be reused across bitmaps, and it must be discarded whenever the bitmap is modified by anything other than AddBulk or RemoveBulk.
func NewBulkContext64 ¶ added in v1.1.0
func NewBulkContext64() *BulkContext64
NewBulkContext64 returns a fresh context for use with AddBulk, RemoveBulk and ContainsBulk.
type IntIterable ¶ added in v0.2.3
IntIterable allows you to iterate over the values in a Bitmap.
type IntIterable64 ¶ added in v1.1.0
IntIterable64 allows you to iterate over the values in a Bitmap64.
type Iterator ¶ added in v1.1.0
type Iterator struct {
// contains filtered or unexported fields
}
Iterator is a full-featured iterator over the values of a Bitmap. Unlike the iterator returned by Bitmap.Iterator, it can move backwards and can seek.
An Iterator points at a value or is exhausted; use HasValue to tell the two apart. It is invalidated by any modification of the underlying bitmap.
func (*Iterator) AdvanceIfNeeded ¶ added in v1.1.0
AdvanceIfNeeded moves the iterator to the smallest value that is greater than or equal to x, and reports whether it points at a value. The iterator does not move if it already points at such a value.
func (*Iterator) Clone ¶ added in v1.1.0
Clone returns a copy of the iterator, positioned on the same value. This function may panic if the allocation failed.
func (*Iterator) Free ¶ added in v1.1.0
func (i *Iterator) Free()
Free releases the memory held by the iterator. Using the iterator afterwards is a mistake. Calling Free more than once is harmless.
func (*Iterator) HasValue ¶ added in v1.1.0
HasValue reports whether the iterator points at a value.
func (*Iterator) Next ¶ added in v1.1.0
Next moves the iterator to the next value and reports whether it points at one.
func (*Iterator) Previous ¶ added in v1.1.0
Previous moves the iterator to the previous value and reports whether it points at one.
func (*Iterator) Read ¶ added in v1.1.0
Read fills buf with up to len(buf) values, in ascending order, and returns how many were written. A return value smaller than len(buf) means the iterator is exhausted.
func (*Iterator) ReadBackward ¶ added in v1.1.0
ReadBackward fills buf with up to len(buf) values, in descending order, and returns how many were written.
func (*Iterator) ReadPreviousRanges ¶ added in v1.1.0
ReadPreviousRanges fills buf with up to len(buf) runs of consecutive values, in descending order, and returns how many were written.
func (*Iterator) ReadRanges ¶ added in v1.1.0
ReadRanges fills buf with up to len(buf) runs of consecutive values, in ascending order, and returns how many were written.
func (*Iterator) Reset ¶ added in v1.1.0
func (i *Iterator) Reset()
Reset repositions the iterator on the smallest value of the bitmap it was created from.
func (*Iterator) ResetToLast ¶ added in v1.1.0
func (i *Iterator) ResetToLast()
ResetToLast repositions the iterator on the largest value of the bitmap it was created from.
func (*Iterator) Skip ¶ added in v1.1.0
Skip advances the iterator by count values and returns how many values were actually skipped.
func (*Iterator) SkipBackward ¶ added in v1.1.0
SkipBackward moves the iterator back by count values and returns how many values were actually skipped.
type Iterator64 ¶ added in v1.1.0
type Iterator64 struct {
// contains filtered or unexported fields
}
Iterator64 is a full-featured iterator over the values of a Bitmap64. Unlike the iterator returned by Bitmap64.Iterator, it can move backwards and can seek.
An Iterator64 points at a value or is exhausted; use HasValue to tell the two apart. It is invalidated by any modification of the underlying bitmap.
func (*Iterator64) AdvanceIfNeeded ¶ added in v1.1.0
func (i *Iterator64) AdvanceIfNeeded(x uint64) bool
AdvanceIfNeeded moves the iterator to the smallest value that is greater than or equal to x, and reports whether it points at a value. The iterator does not move if it already points at such a value.
func (*Iterator64) Clone ¶ added in v1.1.0
func (i *Iterator64) Clone() *Iterator64
Clone returns a copy of the iterator, positioned on the same value. This function may panic if the allocation failed.
func (*Iterator64) Free ¶ added in v1.1.0
func (i *Iterator64) Free()
Free releases the memory held by the iterator. Using the iterator afterwards is a mistake. Calling Free more than once is harmless.
func (*Iterator64) HasValue ¶ added in v1.1.0
func (i *Iterator64) HasValue() bool
HasValue reports whether the iterator points at a value.
func (*Iterator64) Next ¶ added in v1.1.0
func (i *Iterator64) Next() bool
Next moves the iterator to the next value and reports whether it points at one.
func (*Iterator64) Previous ¶ added in v1.1.0
func (i *Iterator64) Previous() bool
Previous moves the iterator to the previous value and reports whether it points at one.
func (*Iterator64) Read ¶ added in v1.1.0
func (i *Iterator64) Read(buf []uint64) int
Read fills buf with up to len(buf) values, in ascending order, and returns how many were written. A return value smaller than len(buf) means the iterator is exhausted.
func (*Iterator64) ReadBackward ¶ added in v1.1.0
func (i *Iterator64) ReadBackward(buf []uint64) int
ReadBackward fills buf with up to len(buf) values, in descending order, and returns how many were written.
func (*Iterator64) ReadPreviousRanges ¶ added in v1.1.0
func (i *Iterator64) ReadPreviousRanges(buf []Range64) int
ReadPreviousRanges fills buf with up to len(buf) runs of consecutive values, in descending order, and returns how many were written.
func (*Iterator64) ReadRanges ¶ added in v1.1.0
func (i *Iterator64) ReadRanges(buf []Range64) int
ReadRanges fills buf with up to len(buf) runs of consecutive values, in ascending order, and returns how many were written.
func (*Iterator64) Reset ¶ added in v1.1.0
func (i *Iterator64) Reset()
Reset repositions the iterator on the smallest value of the bitmap it was created from.
func (*Iterator64) ResetToLast ¶ added in v1.1.0
func (i *Iterator64) ResetToLast()
ResetToLast repositions the iterator on the largest value of the bitmap it was created from.
func (*Iterator64) Value ¶ added in v1.1.0
func (i *Iterator64) Value() uint64
Value returns the value the iterator points at. It is meaningless when HasValue is false.
type Statistics ¶ added in v0.3.0
type Statistics struct {
Cardinality uint64
Containers uint64
ArrayContainers uint64
ArrayContainerBytes uint64
ArrayContainerValues uint64
BitmapContainers uint64
BitmapContainerBytes uint64
BitmapContainerValues uint64
RunContainers uint64
RunContainerBytes uint64
RunContainerValues uint64
// MinValue and MaxValue are undefined when Cardinality is zero.
MinValue uint64
MaxValue uint64
}
Statistics describes the internal structure of a bitmap.