Documentation
¶
Index ¶
- type HalfVector
- func (v HalfVector) EncodeText(buf []byte) (newBuf []byte, err error)
- func (v HalfVector) MarshalJSON() ([]byte, error)
- func (v *HalfVector) Parse(s string) error
- func (v *HalfVector) Scan(src interface{}) (err error)
- func (v *HalfVector) SetSlice(vec []float32)
- func (v HalfVector) Slice() []float32
- func (v HalfVector) String() string
- func (v *HalfVector) UnmarshalJSON(data []byte) error
- func (v HalfVector) Value() (driver.Value, error)
- type SparseVector
- func (v *SparseVector) DecodeBinary(buf []byte) error
- func (v SparseVector) Dimensions() int32
- func (v SparseVector) EncodeBinary(buf []byte) (newBuf []byte, err error)
- func (v SparseVector) Indices() []int32
- func (v *SparseVector) Parse(s string) error
- func (v *SparseVector) Scan(src interface{}) (err error)
- func (v SparseVector) Slice() []float32
- func (v SparseVector) String() string
- func (v SparseVector) Value() (driver.Value, error)
- func (v SparseVector) Values() []float32
- type Vector
- func (v *Vector) DecodeBinary(buf []byte) error
- func (v Vector) EncodeBinary(buf []byte) (newBuf []byte, err error)
- func (v Vector) MarshalJSON() ([]byte, error)
- func (v *Vector) Parse(s string) error
- func (v *Vector) Scan(src interface{}) (err error)
- func (v Vector) Slice() []float32
- func (v Vector) String() string
- func (v *Vector) UnmarshalJSON(data []byte) error
- func (v Vector) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HalfVector ¶ added in v0.2.0
type HalfVector struct {
// contains filtered or unexported fields
}
HalfVector is a wrapper for []float32 to implement sql.Scanner and driver.Valuer.
func NewHalfVector ¶ added in v0.2.0
func NewHalfVector(vec []float32) HalfVector
NewHalfVector creates a new HalfVector from a slice of float32.
func (HalfVector) EncodeText ¶ added in v0.2.1
func (v HalfVector) EncodeText(buf []byte) (newBuf []byte, err error)
EncodeText encodes a text representation of the half vector.
func (HalfVector) MarshalJSON ¶ added in v0.2.0
func (v HalfVector) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*HalfVector) Parse ¶ added in v0.2.0
func (v *HalfVector) Parse(s string) error
Parse parses a string representation of a half vector.
func (*HalfVector) Scan ¶ added in v0.2.0
func (v *HalfVector) Scan(src interface{}) (err error)
Scan implements the sql.Scanner interface.
func (*HalfVector) SetSlice ¶ added in v0.3.0
func (v *HalfVector) SetSlice(vec []float32)
SetSlice sets the underlying slice of float32.
func (HalfVector) Slice ¶ added in v0.2.0
func (v HalfVector) Slice() []float32
Slice returns the underlying slice of float32.
func (HalfVector) String ¶ added in v0.2.0
func (v HalfVector) String() string
String returns a string representation of the half vector.
func (*HalfVector) UnmarshalJSON ¶ added in v0.2.0
func (v *HalfVector) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type SparseVector ¶ added in v0.2.0
type SparseVector struct {
// contains filtered or unexported fields
}
SparseVector is a wrapper to implement sql.Scanner and driver.Valuer.
func NewSparseVector ¶ added in v0.2.0
func NewSparseVector(vec []float32) SparseVector
NewSparseVector creates a new SparseVector from a slice of float32.
func NewSparseVectorFromMap ¶ added in v0.2.0
func NewSparseVectorFromMap(elements map[int32]float32, dim int32) SparseVector
NewSparseVectorFromMap creates a new SparseVector from a map of non-zero elements.
func (*SparseVector) DecodeBinary ¶ added in v0.2.1
func (v *SparseVector) DecodeBinary(buf []byte) error
DecodeBinary decodes a binary representation of a sparse vector.
func (SparseVector) Dimensions ¶ added in v0.2.0
func (v SparseVector) Dimensions() int32
Dimensions returns the number of dimensions.
func (SparseVector) EncodeBinary ¶ added in v0.2.1
func (v SparseVector) EncodeBinary(buf []byte) (newBuf []byte, err error)
EncodeBinary encodes a binary representation of the sparse vector.
func (SparseVector) Indices ¶ added in v0.2.0
func (v SparseVector) Indices() []int32
Indices returns the non-zero indices.
func (*SparseVector) Parse ¶ added in v0.2.0
func (v *SparseVector) Parse(s string) error
Parse parses a string representation of a sparse vector.
func (*SparseVector) Scan ¶ added in v0.2.0
func (v *SparseVector) Scan(src interface{}) (err error)
Scan implements the sql.Scanner interface.
func (SparseVector) Slice ¶ added in v0.2.0
func (v SparseVector) Slice() []float32
Slice returns a slice of float32.
func (SparseVector) String ¶ added in v0.2.0
func (v SparseVector) String() string
String returns a string representation of the sparse vector.
func (SparseVector) Value ¶ added in v0.2.0
func (v SparseVector) Value() (driver.Value, error)
Value implements the driver.Valuer interface.
func (SparseVector) Values ¶ added in v0.2.0
func (v SparseVector) Values() []float32
Values returns the non-zero values.
type Vector ¶
type Vector struct {
// contains filtered or unexported fields
}
Vector is a wrapper for []float32 to implement sql.Scanner and driver.Valuer.
func (*Vector) DecodeBinary ¶ added in v0.2.1
DecodeBinary decodes a binary representation of a vector.
func (Vector) EncodeBinary ¶ added in v0.2.1
EncodeBinary encodes a binary representation of the vector.
func (Vector) MarshalJSON ¶ added in v0.2.0
MarshalJSON implements the json.Marshaler interface.
func (*Vector) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON implements the json.Unmarshaler interface.