distancer

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DotProductGo

func DotProductGo(a, b []float32) float32

func Normalize

func Normalize(v []float32) []float32

Types

type CosineDistance

type CosineDistance struct {
	// contains filtered or unexported fields
}

func (*CosineDistance) Distance

func (d *CosineDistance) Distance(b []float32) (float32, bool, error)

type CosineDistanceProvider

type CosineDistanceProvider struct{}

func NewCosineDistanceProvider

func NewCosineDistanceProvider() CosineDistanceProvider

func (CosineDistanceProvider) New

func (CosineDistanceProvider) SingleDist

func (d CosineDistanceProvider) SingleDist(a, b []float32) (float32, bool, error)

func (CosineDistanceProvider) Type

func (d CosineDistanceProvider) Type() string

type Distancer

type Distancer interface {
	Distance(vec []float32) (float32, bool, error)
}

type DotProduct

type DotProduct struct {
	// contains filtered or unexported fields
}

func (*DotProduct) Distance

func (d *DotProduct) Distance(b []float32) (float32, bool, error)

type DotProductProvider

type DotProductProvider struct{}

func NewDotProductProvider

func NewDotProductProvider() DotProductProvider

func (DotProductProvider) New

func (DotProductProvider) SingleDist

func (d DotProductProvider) SingleDist(a, b []float32) (float32, bool, error)

func (DotProductProvider) Type

func (d DotProductProvider) Type() string

type GeoDistancer

type GeoDistancer struct {
	// contains filtered or unexported fields
}

func (GeoDistancer) Distance

func (g GeoDistancer) Distance(b []float32) (float32, bool, error)

type GeoProvider

type GeoProvider struct{}

func (GeoProvider) New

func (p GeoProvider) New(vec []float32) Distancer

func (GeoProvider) SingleDist

func (p GeoProvider) SingleDist(vec1, vec2 []float32) (float32, bool, error)

func (GeoProvider) Type

func (p GeoProvider) Type() string

type Hamming

type Hamming struct {
	// contains filtered or unexported fields
}

func (Hamming) Distance

func (l Hamming) Distance(b []float32) (float32, bool, error)

type HammingProvider

type HammingProvider struct{}

func NewHammingProvider

func NewHammingProvider() HammingProvider

func (HammingProvider) New

func (l HammingProvider) New(a []float32) Distancer

func (HammingProvider) SingleDist

func (l HammingProvider) SingleDist(a, b []float32) (float32, bool, error)

func (HammingProvider) Type

func (l HammingProvider) Type() string

type L2Squared

type L2Squared struct {
	// contains filtered or unexported fields
}

func (L2Squared) Distance

func (l L2Squared) Distance(b []float32) (float32, bool, error)

type L2SquaredProvider

type L2SquaredProvider struct{}

func NewL2SquaredProvider

func NewL2SquaredProvider() L2SquaredProvider

func (L2SquaredProvider) New

func (l L2SquaredProvider) New(a []float32) Distancer

func (L2SquaredProvider) SingleDist

func (l L2SquaredProvider) SingleDist(a, b []float32) (float32, bool, error)

func (L2SquaredProvider) Type

func (l L2SquaredProvider) Type() string

type Manhattan

type Manhattan struct {
	// contains filtered or unexported fields
}

func (Manhattan) Distance

func (l Manhattan) Distance(b []float32) (float32, bool, error)

type ManhattanProvider

type ManhattanProvider struct{}

func NewManhattanProvider

func NewManhattanProvider() ManhattanProvider

func (ManhattanProvider) New

func (l ManhattanProvider) New(a []float32) Distancer

func (ManhattanProvider) SingleDist

func (l ManhattanProvider) SingleDist(a, b []float32) (float32, bool, error)

func (ManhattanProvider) Type

func (l ManhattanProvider) Type() string

type Provider

type Provider interface {
	New(vec []float32) Distancer
	SingleDist(vec1, vec2 []float32) (float32, bool, error)
	Type() string
}

func NewGeoProvider

func NewGeoProvider() Provider

Directories

Path Synopsis
asm only has amd64 specific implementations at the moment
asm only has amd64 specific implementations at the moment

Jump to

Keyboard shortcuts

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