Documentation
¶
Overview ¶
Package hashprobe provides implementations of probing tables for various data types.
Probing tables are specialized hash tables supporting only a single "probing" operation which behave like a "lookup or insert". When a key is probed, either its value is retrieved if it already existed in the table, or it is inserted and assigned its index in the insert sequence as value.
Values are represented as signed 32 bits integers, which means that probing tables defined in this package may contain at most 2^31-1 entries.
Probing tables have a method named Probe with the following signature:
func (t *Int64Table) Probe(keys []int64, values []int32) int { ... }
The method takes an array of keys to probe as first argument, an array of values where the indexes of each key will be written as second argument, and returns the number of keys that were inserted during the call.
Applications that need to determine which keys were inserted can capture the length of the probing table prior to the call, and scan the list of values looking for indexes greater or equal to the length of the table before the call.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Float32Table ¶
type Float32Table struct {
// contains filtered or unexported fields
}
func NewFloat32Table ¶
func NewFloat32Table(cap int, maxLoad float64) *Float32Table
func (*Float32Table) Cap ¶
func (t *Float32Table) Cap() int
func (*Float32Table) Len ¶
func (t *Float32Table) Len() int
func (*Float32Table) ProbeArray ¶
func (t *Float32Table) ProbeArray(keys sparse.Float32Array, values []int32) int
func (*Float32Table) Reset ¶
func (t *Float32Table) Reset()
type Float64Table ¶
type Float64Table struct {
// contains filtered or unexported fields
}
func NewFloat64Table ¶
func NewFloat64Table(cap int, maxLoad float64) *Float64Table
func (*Float64Table) Cap ¶
func (t *Float64Table) Cap() int
func (*Float64Table) Len ¶
func (t *Float64Table) Len() int
func (*Float64Table) ProbeArray ¶
func (t *Float64Table) ProbeArray(keys sparse.Float64Array, values []int32) int
func (*Float64Table) Reset ¶
func (t *Float64Table) Reset()
type Int32Table ¶
type Int32Table struct {
// contains filtered or unexported fields
}
func NewInt32Table ¶
func NewInt32Table(cap int, maxLoad float64) *Int32Table
func (*Int32Table) Cap ¶
func (t *Int32Table) Cap() int
func (*Int32Table) Len ¶
func (t *Int32Table) Len() int
func (*Int32Table) Probe ¶
func (t *Int32Table) Probe(keys, values []int32) int
func (*Int32Table) ProbeArray ¶
func (t *Int32Table) ProbeArray(keys sparse.Int32Array, values []int32) int
func (*Int32Table) Reset ¶
func (t *Int32Table) Reset()
type Int64Table ¶
type Int64Table struct {
// contains filtered or unexported fields
}
func NewInt64Table ¶
func NewInt64Table(cap int, maxLoad float64) *Int64Table
func (*Int64Table) Cap ¶
func (t *Int64Table) Cap() int
func (*Int64Table) Len ¶
func (t *Int64Table) Len() int
func (*Int64Table) ProbeArray ¶
func (t *Int64Table) ProbeArray(keys sparse.Int64Array, values []int32) int
func (*Int64Table) Reset ¶
func (t *Int64Table) Reset()
type Uint128Table ¶
type Uint128Table struct {
// contains filtered or unexported fields
}
func NewUint128Table ¶
func NewUint128Table(cap int, maxLoad float64) *Uint128Table
func (*Uint128Table) Cap ¶
func (t *Uint128Table) Cap() int
func (*Uint128Table) Len ¶
func (t *Uint128Table) Len() int
func (*Uint128Table) ProbeArray ¶
func (t *Uint128Table) ProbeArray(keys sparse.Uint128Array, values []int32) int
func (*Uint128Table) Reset ¶
func (t *Uint128Table) Reset()
type Uint32Table ¶
type Uint32Table struct {
// contains filtered or unexported fields
}
func NewUint32Table ¶
func NewUint32Table(cap int, maxLoad float64) *Uint32Table
func (*Uint32Table) Cap ¶
func (t *Uint32Table) Cap() int
func (*Uint32Table) Len ¶
func (t *Uint32Table) Len() int
func (*Uint32Table) ProbeArray ¶
func (t *Uint32Table) ProbeArray(keys sparse.Uint32Array, values []int32) int
func (*Uint32Table) Reset ¶
func (t *Uint32Table) Reset()
type Uint64Table ¶
type Uint64Table struct {
// contains filtered or unexported fields
}
func NewUint64Table ¶
func NewUint64Table(cap int, maxLoad float64) *Uint64Table
func (*Uint64Table) Cap ¶
func (t *Uint64Table) Cap() int
func (*Uint64Table) Len ¶
func (t *Uint64Table) Len() int
func (*Uint64Table) ProbeArray ¶
func (t *Uint64Table) ProbeArray(keys sparse.Uint64Array, values []int32) int
func (*Uint64Table) Reset ¶
func (t *Uint64Table) Reset()
Directories
¶
Path | Synopsis |
---|---|
Package aeshash implements hashing functions derived from the Go runtime's internal hashing based on the support of AES encryption in CPU instructions.
|
Package aeshash implements hashing functions derived from the Go runtime's internal hashing based on the support of AES encryption in CPU instructions. |
Package wyhash implements a hashing algorithm derived from the Go runtime's internal hashing fallback, which uses a variation of the wyhash algorithm.
|
Package wyhash implements a hashing algorithm derived from the Go runtime's internal hashing fallback, which uses a variation of the wyhash algorithm. |