tools

package
v0.0.0-...-9ee2875 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cosine

func Cosine(a []float64, b []float64) (cosine float64)

func Euclidean

func Euclidean(a []float64, b []float64) float64

func GetMaxNumsOfCosine

func GetMaxNumsOfCosine(arr []dto.CosineLabel, k int) []dto.CosineLabel

func ReadTxt

func ReadTxt(filePath string) []string

func WriteTxt

func WriteTxt(filePath string, content []string)

Types

type Float64Heap

type Float64Heap []dto.CosineLabel

func (*Float64Heap) Len

func (f *Float64Heap) Len() int

func (*Float64Heap) Less

func (f *Float64Heap) Less(i, j int) bool

func (*Float64Heap) Pop

func (f *Float64Heap) Pop() any

func (*Float64Heap) Push

func (f *Float64Heap) Push(x any)

func (*Float64Heap) Swap

func (f *Float64Heap) Swap(i, j int)

Swap swaps the elements with indexes i and j.

Jump to

Keyboard shortcuts

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