Documentation
¶
Index ¶
- type BitVector
- func (s *BitVector) And(vector *BitVector)
- func (s *BitVector) Concat(vectors []*BitVector) *BitVector
- func (s *BitVector) Copy(vector *BitVector, indexStart, indexEnd int)
- func (s *BitVector) Enumerate() *BitVectorIterator
- func (s *BitVector) EnumerateFromOffset(indexStart, indexEnd int) *BitVectorIterator
- func (s BitVector) Get(index int) bool
- func (s *BitVector) Length() int
- func (s *BitVector) Not()
- func (s *BitVector) Or(vector *BitVector)
- func (s *BitVector) Rank(bit bool, offset int) int
- func (s *BitVector) Resize(length int)
- func (s *BitVector) Select(bit bool, rank int) int
- func (s BitVector) Set(index int, bit bool)
- func (s *BitVector) SetAll(bit bool)
- func (s BitVector) String() string
- func (s *BitVector) TrueBits() int
- func (s *BitVector) Xor(vector *BitVector)
- type BitVectorIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitVector ¶
type BitVector struct {
// contains filtered or unexported fields
}
func NewBitVector ¶
Allocates space to hold the length of bit. All of the values in the BitVector are set to false.
func NewBitVectorFromBool ¶
Allocates space to hold the values from the booleans.
func NewBitVectorFromVector ¶
Allocates a new BitVector with the same length and bit values as vector.
func NewBitVectorFromVectorPadStart ¶
Allocates a new BitVector padded with the same length and values as the vector but left shifted by the padding.
func NewBitVectorOfLength ¶
Allocates space to hold the length of bit. All of the values in the BitVector are set to defaultBit.
func (*BitVector) Enumerate ¶
func (s *BitVector) Enumerate() *BitVectorIterator
func (*BitVector) EnumerateFromOffset ¶
func (s *BitVector) EnumerateFromOffset(indexStart, indexEnd int) *BitVectorIterator
func (*BitVector) Not ¶
func (s *BitVector) Not()
Inverts all the bit values. On/true bit values are converted to off/false. Off/false bit values are turned on/true.
func (*BitVector) Rank ¶
Rank counts the number of true or false (depending on what the bit is set to) in the bitvector but not including the offset
func (*BitVector) Select ¶
find the offset of true or false (depending on what the bit is set to) from the rank (number of times the bit occurs)
type BitVectorIterator ¶
type BitVectorIterator struct {
// contains filtered or unexported fields
}
func NewBitVectorIteratorWithOffset ¶
func NewBitVectorIteratorWithOffset(vector *BitVector, indexStart, indexEnd int) *BitVectorIterator
func (*BitVectorIterator) HasNext ¶
func (s *BitVectorIterator) HasNext() bool
func (*BitVectorIterator) Next ¶
func (s *BitVectorIterator) Next() (bool, int)
func (*BitVectorIterator) Reset ¶
func (s *BitVectorIterator) Reset()