Versions in this module Expand all Collapse all v0 v0.25.2 Jun 5, 2025 Changes in this version + const MaxDim + var ErrIntOverflowVector = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthVector = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrUnexpectedEndOfGroupVector = fmt.Errorf("proto: unexpected end of group") + func CosDistance(t T, t2 T) (float64, error) + func Encode(appendTo []byte, t T) ([]byte, error) + func InnerProduct(t T, t2 T) (float64, error) + func L1Distance(t T, t2 T) (float64, error) + func L2Distance(t T, t2 T) (float64, error) + func NegInnerProduct(t T, t2 T) (float64, error) + func Norm(t T) float64 + type Set struct + Count int + Data []float32 + Dims int + func MakeSet(dims int) Set + func MakeSetFromRawData(data []float32, dims int) Set + func (*Set) Descriptor() ([]byte, []int) + func (*Set) ProtoMessage() + func (m *Set) Marshal() (dAtA []byte, err error) + func (m *Set) MarshalTo(dAtA []byte) (int, error) + func (m *Set) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Set) Reset() + func (m *Set) Size() (n int) + func (m *Set) String() string + func (m *Set) Unmarshal(dAtA []byte) error + func (m *Set) XXX_DiscardUnknown() + func (m *Set) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Set) XXX_Merge(src proto.Message) + func (m *Set) XXX_Size() int + func (m *Set) XXX_Unmarshal(b []byte) error + func (vs *Set) Add(v T) + func (vs *Set) AddSet(vectors Set) + func (vs *Set) AddUndefined(count int) + func (vs *Set) AsMatrix() num32.Matrix + func (vs *Set) At(offset int) T + func (vs *Set) Centroid(centroid T) T + func (vs *Set) Clear() + func (vs *Set) Clone() Set + func (vs *Set) EnsureCapacity(capacity int) + func (vs *Set) Equal(other *Set) bool + func (vs *Set) ReplaceWithLast(offset int) + func (vs *Set) Slice(offset, count int) Set + func (vs *Set) SplitAt(offset int) Set + type T []float32 + func Add(t T, t2 T) (T, error) + func Decode(b []byte) (remaining []byte, ret T, err error) + func Minus(t T, t2 T) (T, error) + func Mult(t T, t2 T) (T, error) + func ParseVector(input string) (T, error) + func Random(rng *rand.Rand, maxDim int) T + func (v T) AsSet() Set + func (v T) Compare(v2 T) (int, error) + func (v T) Size() uintptr + func (v T) String() string