Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric func(a, b interface{}) float64
A Metric is a function that measures the distance between two provided interface{}-values. The function *must* be a metric in the mathematical sense, that is, the metric d must fullfill the following requirements:
- d(x, y) >= 0
- d(x, y) = 0 if and only if x = y
- d(x, y) = d(y, x)
- d(x, z) <= d(x, y) + d(y, z) (triangle inequality)
type VPTree ¶
type VPTree struct {
// contains filtered or unexported fields
}
A VPTree struct represents a Vantage-point tree. Vantage-point trees are useful for nearest-neighbour searches in high-dimensional metric spaces.
func New ¶
New creates a new VP-tree using the metric and items provided. The metric measures the distance between two items, so that the VP-tree can find the nearest neighbour(s) of a target item.
Click to show internal directories.
Click to hide internal directories.