Documentation ¶
Index ¶
- func Abs[T types.RealNumbers](v []T) (res []T, err error)
- func Add[T types.RealNumbers](v1, v2 []T) ([]T, error)
- func Cast[I types.RealNumbers, O types.RealNumbers](in []I) (out []O, err error)
- func Compare[T types.RealNumbers](v1, v2 []T) int
- func CosineDistance[T types.RealNumbers](v1, v2 []T) (float64, error)
- func CosineSimilarity[T types.RealNumbers](v1, v2 []T) (float64, error)
- func Divide[T types.RealNumbers](v1, v2 []T) ([]T, error)
- func InnerProduct[T types.RealNumbers](v1, v2 []T) (float64, error)
- func L1Norm[T types.RealNumbers](v []T) (float64, error)
- func L2Distance[T types.RealNumbers](v1, v2 []T) (float64, error)
- func L2Norm[T types.RealNumbers](v []T) (float64, error)
- func Multiply[T types.RealNumbers](v1, v2 []T) ([]T, error)
- func NormalizeL2[T types.RealNumbers](v1 []T) ([]T, error)
- func Sqrt[T types.RealNumbers](v []T) (res []float64, err error)
- func Subtract[T types.RealNumbers](v1, v2 []T) ([]T, error)
- func Summation[T types.RealNumbers](v []T) (float64, error)
- func ToGonumVector[T types.RealNumbers](arr1 []T) *mat.VecDense
- func ToGonumVectors[T types.RealNumbers](arrays ...[]T) (res []*mat.VecDense, err error)
- func ToMoArray[T types.RealNumbers](vec *mat.VecDense) (arr []T)
- func ToMoArrays[T types.RealNumbers](vecs []*mat.VecDense) [][]T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T types.RealNumbers](v []T) (res []T, err error)
func Add ¶
func Add[T types.RealNumbers](v1, v2 []T) ([]T, error)
func Cast ¶
func Cast[I types.RealNumbers, O types.RealNumbers](in []I) (out []O, err error)
func Compare ¶
func Compare[T types.RealNumbers](v1, v2 []T) int
Compare returns an integer comparing two arrays/vectors lexicographically. TODO: this function might not be correct. we need to compare using tolerance for float values. TODO: need to check if we need len(v1)==len(v2) check.
func CosineDistance ¶
func CosineDistance[T types.RealNumbers](v1, v2 []T) (float64, error)
func CosineSimilarity ¶
func CosineSimilarity[T types.RealNumbers](v1, v2 []T) (float64, error)
func Divide ¶
func Divide[T types.RealNumbers](v1, v2 []T) ([]T, error)
func InnerProduct ¶
func InnerProduct[T types.RealNumbers](v1, v2 []T) (float64, error)
func L1Norm ¶
func L1Norm[T types.RealNumbers](v []T) (float64, error)
L1Norm returns l1 distance to origin.
func L2Distance ¶
func L2Distance[T types.RealNumbers](v1, v2 []T) (float64, error)
func L2Norm ¶
func L2Norm[T types.RealNumbers](v []T) (float64, error)
L2Norm returns l2 distance to origin.
func Multiply ¶
func Multiply[T types.RealNumbers](v1, v2 []T) ([]T, error)
func NormalizeL2 ¶
func NormalizeL2[T types.RealNumbers](v1 []T) ([]T, error)
func Subtract ¶
func Subtract[T types.RealNumbers](v1, v2 []T) ([]T, error)
func ToGonumVector ¶
func ToGonumVector[T types.RealNumbers](arr1 []T) *mat.VecDense
func ToGonumVectors ¶
func ToGonumVectors[T types.RealNumbers](arrays ...[]T) (res []*mat.VecDense, err error)
func ToMoArrays ¶
func ToMoArrays[T types.RealNumbers](vecs []*mat.VecDense) [][]T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.