Documentation
¶
Overview ¶
package fixvec provides a vector representation of value using fixed bits
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixVec ¶
type FixVec interface { // Get returns V[ind] Get(ind uint64) uint64 // Set sets V[ind] = val (val will be masked by &((1 << blen) -1)) Set(ind uint64, val uint64) // Blen returns the number of bits for value representation Blen() uint8 // KeysNum returns the number of elemens in V Num() uint64 // MarshalBinary encodes FixVec into a binary form and returns the result. MarshalBinary() ([]byte, error) // UnmarshalBinary decodes the FixVec from a binary from generated MarshalBinary UnmarshalBinary([]byte) error }
FixVec provides a vector representation of value using fixed bits Conceptually, FixVec represents a vector V[0...num), and each value V[i] can represent in [0...2^(blen)) The total working space is num * blen bits (+ some small overhead).
func NewFromArray ¶
NewFromArray returns a FixVec represents V[0...n) where each element V[i] equals to vs[i]
Click to show internal directories.
Click to hide internal directories.