rp-tree 0.3.1 → 0.3.2
raw patch · 2 files changed
+9/−1 lines, 2 files
Files
- rp-tree.cabal +1/−1
- src/Data/RPTree.hs +8/−0
rp-tree.cabal view
@@ -1,5 +1,5 @@ name: rp-tree-version: 0.3.1+version: 0.3.2 synopsis: Random projection trees description: Random projection trees for approximate nearest neighbor search in high-dimensional vector spaces .
src/Data/RPTree.hs view
@@ -134,6 +134,14 @@ -- | Look up the \(k\) nearest neighbors to a query point+--+-- The supplied distance function @d@ must satisfy the definition of a metric, i.e.+--+-- * identity of indiscernible elements : \( d(x, y) = 0 \leftrightarrow x \equiv y \)+--+-- * symmetry : \( d(x, y) = d(y, x) \)+--+-- * triangle inequality : \( d(x, y) + d(y, z) \geq d(x, z) \) knn :: (Ord p, Inner SVector v, VU.Unbox d, Real d) => (u d -> v d -> p) -- ^ distance function -> Int -- ^ k neighbors