Documentation
¶
Overview ¶
Package cover provides a cover-tree adapter that currently delegates to a brute-force implementation. It preserves a stable API so the internals can be switched to a real cover tree without changing callers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundStrategy ¶
type BoundStrategy int
BoundStrategy exposes the pruning strategy knobs for cover-tree searches.
const ( // BoundPerNode caches subtree radii per node (tighter pruning, more bookkeeping). BoundPerNode BoundStrategy = iota // BoundLevel uses level-derived bounds (looser but cheaper to evaluate). BoundLevel )
type DistanceFunction ¶
type DistanceFunction = ctree.DistanceFunction
DistanceFunction re-exports cover-tree distance identifiers for callers.
const ( // DistanceFunctionCosine uses cosine distance (default). DistanceFunctionCosine DistanceFunction = ctree.DistanceFunctionCosine // DistanceFunctionEuclidean uses Euclidean distance. DistanceFunctionEuclidean DistanceFunction = ctree.DistanceFunctionEuclidean )
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index wraps a cover tree (adapted from viant/gds) behind the sqlite-vec index API.
func (*Index) MarshalBinary ¶
MarshalBinary persists the cover tree along with document values.
func (*Index) UnmarshalBinary ¶
UnmarshalBinary restores the index from the cover-tree format or the legacy brute format.
type Option ¶
type Option func(*Index)
Option configures a cover Index instance.
func WithBoundStrategy ¶
func WithBoundStrategy(strategy BoundStrategy) Option
WithBoundStrategy selects the pruning strategy used during queries.
func WithBuildParallelism ¶
WithBuildParallelism sets the number of workers used to clone vectors/magnitudes during Build. Zero/negative values fall back to GOMAXPROCS with automatic throttling for small datasets.
func WithDistance ¶
func WithDistance(distance DistanceFunction) Option
WithDistance switches the cover-tree distance metric (default cosine).