Documentation
¶
Index ¶
- type BitSet
- func (b *BitSet) And(other *BitSet)
- func (b *BitSet) Capacity() int
- func (b *BitSet) Clear()
- func (b *BitSet) Clone() *BitSet
- func (b *BitSet) Get(bit int) bool
- func (b *BitSet) Grow(capacity int)
- func (b *BitSet) IsEmpty() bool
- func (b *BitSet) Not()
- func (b *BitSet) Or(other *BitSet)
- func (b *BitSet) Set(bit int)
- func (b *BitSet) Shrink(capacity int)
- func (b *BitSet) String() string
- func (b *BitSet) Toggle(bit int)
- func (b *BitSet) Unset(bit int)
- func (b *BitSet) Xor(other *BitSet)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitSet ¶
type BitSet struct {
// contains filtered or unexported fields
}
BitSet is an implementation of a resizable bit set.
func New ¶
New creates a BitSet with the given bit capacity.
All methods will panic if the specified bit index is out of range.
func (*BitSet) And ¶
And performs the bitwise AND operation with another BitSet.
If the other BitSet is larger than the current one, this operation will panic. If it is smaller, only the existing bits from the other BitSet will be used for the operation.
func (*BitSet) Grow ¶
Grow grows the BitSet to a greater capacity.
Panics if the capacity is not greater than the current capacity.
func (*BitSet) Or ¶
Or performs the bitwise OR operation with another BitSet.
If the other BitSet is larger than the current one, this operation will panic. If it is smaller, only the existing bits from the other BitSet will be used for the operation.
func (*BitSet) Shrink ¶
Shrink shrinks the BitSet to a smaller capacity.
Panics if the capacity is not smaller than the current capacity.