Documentation ¶
Index ¶
- Constants
- type Bitset
- func (bs Bitset) GetElements() []Bitset
- func (bs Bitset) GetInts() []int
- func (bs Bitset) GetIterator() *Iterator
- func (bs Bitset) GetSmallestInt() int
- func (bs1 Bitset) IsStrictSubsetOf(bs2 Bitset) bool
- func (bs1 Bitset) IsStrictSupersetOf(bs2 Bitset) bool
- func (bs1 Bitset) IsSubsetOf(bs2 Bitset) bool
- func (bs1 Bitset) IsSupersetOf(bs2 Bitset) bool
- func (bs Bitset) Len() int
- type Iterator
Constants ¶
const EmptySet = Bitset(0)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitset ¶
type Bitset uint64
func DeleteInts ¶
DeleteInts retunrs a bitset containing the elements of bs except for the given integers values
func Intersection ¶
Intersection returns the intersection of two bitsets bs1 ∩ bs2
func (Bitset) GetElements ¶
GetElements returns all elements of a bitsets. "Elements" are equivalent to to singleton sets containing one and only one integer.
func (Bitset) GetIterator ¶
GetIterator returns an iterator to loop across all elements of a set:
it := set.GetIterator() for it.HasNext() { fmt.Printf("Value: %d\n", it.NextInt()) }
or after
resultSet := EmptySet() it := set.GetIterator() for it.HasNext() { resultSet |= it.Next() }
resultSet and set coincide.
func (Bitset) GetSmallestInt ¶
GetSmallestInt returns the smallest integer of a bitset.
func (Bitset) IsStrictSubsetOf ¶
IsStrictSubsetOf returns true if b1 is subset of bs2 but not equal to b2
func (Bitset) IsStrictSupersetOf ¶
IsStrictSupersetOf returns true if b1 is a superset of b2 but not equal to b2
func (Bitset) IsSubsetOf ¶
IsSubsetOf returns true if b1 is subset of bs2 (or equal to b2)
func (Bitset) IsSupersetOf ¶
IsSupersetOf returns true if b1 is a superset of (or equal to) b2
type Iterator ¶
type Iterator uint64
func (*Iterator) NumRemaining ¶
NumRemaining returns the remaining number of elements to iterate across
func (*Iterator) RemainingSet ¶
RemainingSet returns a bitset containing the remaining elements to loop across