Documentation
¶
Index ¶
- func Add(a, b []float32) []float32
- func CosineSimilarity(a, b []float32) float32
- func DotProduct(a, b []float32) float32
- func DotProductSSE2(a, b []float32) float32
- func L2Distance(a, b []float32) float32
- func L2SquaredDistance(a, b []float32) float32
- func L2SquaredDistanceSSE2(a, b []float32) float32
- func Normalize(a []float32) []float32
- func NormalizeVector(v []float32) []float32
- func NormalizeVectorInplace(v []float32)
- func NormalizeVectorSSE2(a []float32) []float32
- func Scale(a []float32, scale float32) []float32
- func Subtract(a, b []float32) []float32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DotProductSSE2 ¶
DotProductSSE2 使用SSE2指令集优化的点积计算 SSE2可以一次处理4个float32
func L2SquaredDistance ¶
L2SquaredDistance 优化的L2距离平方计算
func L2SquaredDistanceSSE2 ¶
L2SquaredDistanceSSE2 使用SSE2优化的L2距离平方计算
func NormalizeVectorInplace ¶
func NormalizeVectorInplace(v []float32)
NormalizeVectorInplace 原地归一化向量,减少内存分配
func NormalizeVectorSSE2 ¶
NormalizeVectorSSE2 使用SSE2优化的向量归一化
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.