Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cube ¶
type Cube []int
Hypercube is represented by a slice of its coordinates.
func CentralCube ¶
CentralCube returns the hypercube containing the vector end. Arguments are the same as for the CubeSet function.
func (Cube) DecimalHash ¶
DecimalHash hashes hypercubes without collisions. IMPORTANT: To work correctly, the number of buckets must be less than 11 and the number of dimensions less than 20. Else at certain unexpected moment you might get a hash value overflow.
type Cubes ¶
type Cubes []Cube
func CubeSet ¶
CubeSet returns a set of hypercubes, which represent fuzzy discretization of one n-dimensional vector, as described in https://vitali-fedulov.github.io/similar.pictures/algorithm-for-hashing-high-dimensional-float-vectors.html One hupercube is defined by bucket numbers in each dimension. min and max are minimum and maximum possible values of the vector components. The assumption is that min and max are the same for all dimensions.
type Params ¶
type Params struct {
// Value limits per dimension. For example 0, 255 for pixel values.
Min, Max float64
// Uncertainty interval expressed as a fraction of bucketWidth
// (for example 0.25 for eps = 1/4 of bucketWidth).
EpsPercent float64
// Number of buckets per dimension.
NumBuckets int
}
Parameters of space discretization.