Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommutativeDuplexes ¶ added in v0.4.8
func (*CommutativeDuplexes[T]) And ¶ added in v0.4.8
func (s *CommutativeDuplexes[T]) And(dc DuplexCommutation[T])
func (*CommutativeDuplexes[T]) Contains ¶ added in v0.4.8
func (s *CommutativeDuplexes[T]) Contains(value T) bool
func (*CommutativeDuplexes[T]) Or ¶ added in v0.4.8
func (s *CommutativeDuplexes[T]) Or(dc DuplexCommutation[T])
type Duplex ¶
type Duplex[T uint32 | uint64] interface { Provider[T] Xor(other Provider[T]) And(other Provider[T]) AndNot(other Provider[T]) Remove(value T) Slice() []T Contains(value T) bool Each(delegate func(value T) bool) CheckedAdd(value T) bool Clone() Duplex[T] }
Duplex is a two-way cardinality provider that allows a user to retrieve encoded values back out of the provider. This interface is suitable for algorithms that behave similar to bitvectors.
func NewBitmap32 ¶
func NewBitmap32With ¶
func NewBitmap64 ¶
func NewBitmap64With ¶
type DuplexCommutation ¶ added in v0.4.8
func CommutativeOr ¶ added in v0.4.8
func CommutativeOr[T uint32 | uint64](duplexes ...Duplex[T]) DuplexCommutation[T]
func (DuplexCommutation[T]) Contains ¶ added in v0.4.8
func (s DuplexCommutation[T]) Contains(value T) bool
func (DuplexCommutation[T]) Or ¶ added in v0.4.8
func (s DuplexCommutation[T]) Or(duplexes ...Duplex[T]) DuplexCommutation[T]
type DuplexConstructor ¶
type Iterator ¶
Iterator allows enumeration of a duplex cardinality provider without requiring the allocation of the provider's set.
type Provider ¶
type Provider[T uint32 | uint64] interface { Add(value ...T) Or(other Provider[T]) Clear() Cardinality() uint64 }
Provider describes the most basic functionality of a cardinality provider algorithm: adding elements to the provider and producing the cardinality of those elements.
func NewBitmap32Provider ¶
func NewBitmap64Provider ¶
type ProviderConstructor ¶
type Simplex ¶
Simplex is a one-way cardinality provider that does not allow a user to retrieve encoded values back out of the provider. This interface is suitable for algorithms such as HyperLogLog which utilizes a hash function to merge identifiers into the cardinality provider.