Documentation
¶
Index ¶
- Constants
- type Set
- func (s *Set) Add(value int)
- func (s *Set) And(other *Set) *Set
- func (s *Set) AndCount(other *Set) int
- func (s *Set) Assign(other *Set)
- func (s *Set) AssignAll()
- func (s *Set) AssignAnd(other *Set)
- func (s *Set) AssignIff(other *Set)
- func (s *Set) AssignImply(other *Set)
- func (s *Set) AssignNone()
- func (s *Set) AssignNor(other *Set)
- func (s *Set) AssignNot()
- func (s *Set) AssignOr(other *Set)
- func (s *Set) AssignSub(other *Set)
- func (s *Set) AssignXor(other *Set)
- func (s *Set) Compare(other *Set) int
- func (s *Set) Count() int
- func (s *Set) Each() iter.Seq[int]
- func (s *Set) Equal(other *Set) bool
- func (s *Set) Has(value int) bool
- func (s *Set) HasAll(other *Set) bool
- func (s *Set) HasAny(other *Set) bool
- func (s *Set) HasNone(other *Set) bool
- func (s *Set) Iff(other *Set) *Set
- func (s *Set) Imply(other *Set) *Set
- func (s *Set) IsAll() bool
- func (s *Set) IsNone() bool
- func (s *Set) LessCount(value int) int
- func (s *Set) Max() int
- func (s *Set) Min() int
- func (s *Set) MoreCount(value int) int
- func (s *Set) Nor(other *Set) *Set
- func (s *Set) Not() *Set
- func (s *Set) Or(other *Set) *Set
- func (s *Set) Ranges() iter.Seq2[int, int]
- func (s *Set) Remove(value int)
- func (s *Set) String() string
- func (s *Set) Sub(other *Set) *Set
- func (s *Set) Xor(other *Set) *Set
Constants ¶
const ( // Cap is the maximum possible size for the set. Cap = 8192 // Max is the largest value that can be stored. Max = 8191 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set [128]uint64
Set is fixed-width bitset able to store non-negative `int` values up to 8191. The zero value is empty and ready to use.
func (*Set) AssignImply ¶
AssignImply assigns the set of values on the right side, or not the left.
func (*Set) Compare ¶
Compare returns 0 if the set are equal, else, for the smallest value whose presence is not the same between the two sets, a positive (negative) number if present in the left (right) hand side.
func (*Set) HasNone ¶
HasNone reports whether the set does not have any values in common with another.
func (*Set) LessCount ¶
LessCount returns the number of values in the set less than the given value.
func (*Set) MoreCount ¶
MoreCount returns the number of values in the set greater than the given value.
func (*Set) Ranges ¶
Ranges loops over contiguous sub-ranges of the set in ascending order. Each iteration produces the first value of the range, and the smallest value greater than that absent from the set.