Documentation
¶
Index ¶
- type CommutativeDuplex64
- func (s *CommutativeDuplex64) AndInto(duplex Duplex[uint64])
- func (s *CommutativeDuplex64) Cardinality() uint64
- func (s *CommutativeDuplex64) Contains(value uint64) bool
- func (s *CommutativeDuplex64) Each(delegate func(value uint64) bool)
- func (s *CommutativeDuplex64) Or(duplex ...Duplex[uint64])
- func (s *CommutativeDuplex64) OrAll(other *CommutativeDuplex64)
- func (s *CommutativeDuplex64) OrInto(duplex Duplex[uint64])
- func (s *CommutativeDuplex64) Slice() []uint64
- type Duplex
- type DuplexConstructor
- type Iterator
- type Provider
- type ProviderConstructor
- type Simplex
- type SimplexConstructor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommutativeDuplex64 ¶ added in v0.4.0
type CommutativeDuplex64 struct {
// contains filtered or unexported fields
}
func NewCommutativeDuplex64 ¶ added in v0.4.0
func NewCommutativeDuplex64() *CommutativeDuplex64
func (*CommutativeDuplex64) AndInto ¶ added in v0.4.0
func (s *CommutativeDuplex64) AndInto(duplex Duplex[uint64])
func (*CommutativeDuplex64) Cardinality ¶ added in v0.4.0
func (s *CommutativeDuplex64) Cardinality() uint64
func (*CommutativeDuplex64) Contains ¶ added in v0.4.0
func (s *CommutativeDuplex64) Contains(value uint64) bool
func (*CommutativeDuplex64) Each ¶ added in v0.4.0
func (s *CommutativeDuplex64) Each(delegate func(value uint64) bool)
func (*CommutativeDuplex64) Or ¶ added in v0.4.0
func (s *CommutativeDuplex64) Or(duplex ...Duplex[uint64])
func (*CommutativeDuplex64) OrAll ¶ added in v0.4.0
func (s *CommutativeDuplex64) OrAll(other *CommutativeDuplex64)
func (*CommutativeDuplex64) OrInto ¶ added in v0.4.0
func (s *CommutativeDuplex64) OrInto(duplex Duplex[uint64])
func (*CommutativeDuplex64) Slice ¶ added in v0.4.0
func (s *CommutativeDuplex64) Slice() []uint64
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 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.