brute_force

package
v0.0.0-debug-20260702 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUsearchQuantizationFromType

func GetUsearchQuantizationFromType(v any) (usearch.Quantization, error)

func NewAdhocBruteForceIndex

func NewAdhocBruteForceIndex[T types.RealNumbers](dataset [][]T,
	dimension uint,
	m metric.MetricType,
	elemsz uint,
	_ bool) (cache.VectorIndexSearchIf, error)

func NewAdhocBruteForceIndexFlattened

func NewAdhocBruteForceIndexFlattened[T types.RealNumbers](dataset []T,
	count uint,
	dimension uint,
	m metric.MetricType,
	elemsz uint,
	_ bool) (cache.VectorIndexSearchIf, error)

func NewBruteForceIndex

func NewBruteForceIndex[T types.RealNumbers](dataset [][]T,
	dimension uint,
	m metric.MetricType,
	elemsz uint,
	nthread uint,
	_ bool) (cache.VectorIndexSearchIf, error)

gpuMode is accepted-but-ignored in non-gpu builds — CPU is the only option here. The signature matches the gpu.go version so callers pass the flag uniformly regardless of build tag.

func NewCpuBruteForceIndex

func NewCpuBruteForceIndex[T types.RealNumbers](dataset [][]T,
	dimension uint,
	m metric.MetricType,
	elemsz uint) (cache.VectorIndexSearchIf, error)

func NewGoBruteForceIndex

func NewGoBruteForceIndex[T types.RealNumbers](dataset [][]T,
	dimension uint,
	m metric.MetricType,
	elemsz uint) (cache.VectorIndexSearchIf, error)

func NewUsearchBruteForceIndex

func NewUsearchBruteForceIndex[T types.RealNumbers](dataset [][]T,
	dimension uint,
	m metric.MetricType,
	elemsz uint) (cache.VectorIndexSearchIf, error)

func NewUsearchBruteForceIndexFlattened

func NewUsearchBruteForceIndexFlattened[T types.RealNumbers](dataset []T,
	count uint,
	dimension uint,
	m metric.MetricType,
	elemsz uint) (cache.VectorIndexSearchIf, error)

Types

type GoBruteForceIndex

type GoBruteForceIndex[T types.RealNumbers] struct {
	Dataset   [][]T // flattend vector
	Metric    metric.MetricType
	Dimension uint
	Count     uint
}

func (*GoBruteForceIndex[T]) Destroy

func (idx *GoBruteForceIndex[T]) Destroy()

func (*GoBruteForceIndex[T]) Load

func (idx *GoBruteForceIndex[T]) Load(sqlproc *sqlexec.SqlProcess) error

func (*GoBruteForceIndex[T]) Search

func (idx *GoBruteForceIndex[T]) Search(proc *sqlexec.SqlProcess, _queries any, rt vectorindex.RuntimeConfig) (keys any, distances []float64, err error)

func (*GoBruteForceIndex[T]) SearchFloat32

func (idx *GoBruteForceIndex[T]) SearchFloat32(proc *sqlexec.SqlProcess, _queries any, rt vectorindex.RuntimeConfig, outKeys []int64, outDists []float32) error

SearchFloat32 implements VectorIndexSearchIf — writes results directly into caller-provided slices, eliminating the intermediate []int64 and []float64 heap allocations of Search.

func (*GoBruteForceIndex[T]) UpdateConfig

func (idx *GoBruteForceIndex[T]) UpdateConfig(sif cache.VectorIndexSearchIf) error

type UsearchBruteForceIndex

type UsearchBruteForceIndex[T types.RealNumbers] struct {
	Dataset      *[]T // flattend vector
	Metric       usearch.Metric
	Dimension    uint
	Count        uint
	Quantization usearch.Quantization
	ElementSize  uint
	// contains filtered or unexported fields
}

func (*UsearchBruteForceIndex[T]) Destroy

func (idx *UsearchBruteForceIndex[T]) Destroy()

func (*UsearchBruteForceIndex[T]) Load

func (idx *UsearchBruteForceIndex[T]) Load(sqlproc *sqlexec.SqlProcess) error

func (*UsearchBruteForceIndex[T]) Search

func (idx *UsearchBruteForceIndex[T]) Search(proc *sqlexec.SqlProcess, _queries any, rt vectorindex.RuntimeConfig) (keys any, distances []float64, err error)

func (*UsearchBruteForceIndex[T]) SearchFloat32

func (idx *UsearchBruteForceIndex[T]) SearchFloat32(proc *sqlexec.SqlProcess, _queries any, rt vectorindex.RuntimeConfig, outKeys []int64, outDists []float32) error

func (*UsearchBruteForceIndex[T]) UpdateConfig

func (idx *UsearchBruteForceIndex[T]) UpdateConfig(sif cache.VectorIndexSearchIf) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL