Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreben committed Oct 12, 2024
1 parent 2dbdcb4 commit 870041c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lsh/nearest_wide.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions model_wide.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nearest_wide.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 870041c

Please sign in to comment.