From 870041cbb334def1a4d7d090064c82376bcf1a85 Mon Sep 17 00:00:00 2001 From: Sergey Grebenshchikov Date: Sat, 12 Oct 2024 02:36:35 +0200 Subject: [PATCH] doc --- lsh/nearest_wide.go | 2 +- model_wide.go | 8 ++++---- nearest_wide.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lsh/nearest_wide.go b/lsh/nearest_wide.go index 31f9e3d..bf2ff20 100644 --- a/lsh/nearest_wide.go +++ b/lsh/nearest_wide.go @@ -7,7 +7,7 @@ import ( "github.com/keilerkonzept/bitknn/internal/slice" ) -// Nearest, but for wide data. +// [Nearest], but for wide data. func NearestWide(data [][]uint64, bucketIDs []uint64, buckets map[uint64]slice.IndexRange, k int, xh uint64, x []uint64, bucketDistances []int, heapBucketIDs []uint64, distances []int, indices []int) (int, int) { dataHeap := heap.MakeMax[int](distances, indices) exactBucket := buckets[xh] diff --git a/model_wide.go b/model_wide.go index f11a1ac..2cfb9e6 100644 --- a/model_wide.go +++ b/model_wide.go @@ -29,7 +29,7 @@ func (me *WideModel) Find(k int, x []uint64) ([]int, []int) { return me.FindInto(k, x, me.Narrow.HeapDistances, me.Narrow.HeapIndices) } -// FindV is [Find], but vectorizable (currently only on ARM64 with NEON instructions). +// FindV is [WideModel.Find], but vectorizable (currently only on ARM64 with NEON instructions). // The provided [batch] slice must have length >=k and is used to pre-compute batches of distances. func (me *WideModel) FindV(k int, x []uint64, batch []uint32) ([]int, []int) { me.PreallocateHeap(k) @@ -45,7 +45,7 @@ func (me *WideModel) FindInto(k int, x []uint64, distances []int, indices []int) return distances[:k], indices[:k] } -// FindIntoV is [FindInto], but vectorizable (currently only on ARM64 with NEON instructions). +// FindIntoV is [WideModel.FindInto], but vectorizable (currently only on ARM64 with NEON instructions). // The provided [batch] slice must have length >=k and is used to pre-compute batches of distances. func (me *WideModel) FindIntoV(k int, x []uint64, batch []uint32, distances []int, indices []int) ([]int, []int) { k = NearestWideV(me.WideData, k, x, batch, distances, indices) @@ -67,14 +67,14 @@ func (me *WideModel) PredictInto(k int, x []uint64, distances []int, indices []i return k } -// PredictV is [Predict], but vectorizable (currently only on ARM64 with NEON instructions). +// PredictV is [WideModel.Predict], but vectorizable (currently only on ARM64 with NEON instructions). // The provided [batch] slice must have length >=k and is used to pre-compute batches of distances. func (me *WideModel) PredictV(k int, x []uint64, batch []uint32, votes VoteCounter) int { me.PreallocateHeap(k) return me.PredictIntoV(k, x, batch, me.Narrow.HeapDistances, me.Narrow.HeapIndices, votes) } -// PredictIntoV is [PredictInto], but vectorizable (currently only on ARM64 with NEON instructions). +// PredictIntoV is [WideModel.PredictInto], but vectorizable (currently only on ARM64 with NEON instructions). // The provided [batch] slice must have length >=k and is used to pre-compute batches of distances. func (me *WideModel) PredictIntoV(k int, x []uint64, batch []uint32, distances []int, indices []int, votes VoteCounter) int { k = NearestWideV(me.WideData, k, x, batch, distances, indices) diff --git a/nearest_wide.go b/nearest_wide.go index 840cb62..4876505 100644 --- a/nearest_wide.go +++ b/nearest_wide.go @@ -7,7 +7,7 @@ import ( "github.com/keilerkonzept/bitknn/internal/neon" ) -// [bitknn.Nearest], but for wide data. +// [Nearest], but for wide data. func NearestWide(data [][]uint64, k int, x []uint64, distances, indices []int) int { heap := heap.MakeMax(distances, indices) distance0 := &distances[0]