Documentation ¶
Index ¶
- func GetDiscreteStatuses[T constraints.Integer](s T, max T) []T
- func PrintN(n, size uint)
- type BitVector
- func (bv *BitVector) Bytes() []byte
- func (bv *BitVector) Print()
- func (bv *BitVector) PrintHex()
- func (bv *BitVector) Set(position uint)
- func (bv *BitVector) SetN(value, n, start uint)
- func (bv *BitVector) SizeForPosition(position uint)
- func (bv *BitVector) UnSet(position uint)
- func (bv *BitVector) Value(position uint) int
- func (bv *BitVector) ValueN(n, start uint) uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDiscreteStatuses ¶ added in v2.4.0
func GetDiscreteStatuses[T constraints.Integer](s T, max T) []T
GetDiscreteStatuses in a slice of valid statuses from the given T value
Types ¶
type BitVector ¶
type BitVector []bits
BitVector is a convenience structure for setting inividual bits in an array of bytes. Create a new BitVector using 'new(BitVector)'. The BitVector will be automatically sized to accomadate the positions passed in, however you preallocate space by calling SizeForPosition with the highest bit position required.
func (*BitVector) Print ¶
func (bv *BitVector) Print()
Print the bit vector LSB to MSB and MSb to LSb within bytes.
func (*BitVector) PrintHex ¶
func (bv *BitVector) PrintHex()
PrintHex prints the bytes in order (0->N) in their Hexadecimal representation.
func (*BitVector) SetN ¶
SetN sets the bits in the BitVector to the same values as the 'n' bits in the passed uint starting at the specified place.
func (*BitVector) SizeForPosition ¶
SizeForPosition resizes the BitVector to accomodate the position passed.