vec32

package
v0.0.0-...-3c9b827 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package vec32 provides operations on float32 vectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a, b []float32)

Add adds b to a. Add panics if the vector lengths are unequal.

func Bytes

func Bytes(vec []float32) []byte

Bytes serializes vec into a byte slice.

func Dot

func Dot(a, b []float32) float32

Dot returns the dot product of a and b. Dot panics if the vector lengths are unequal.

func FromBytes

func FromBytes(data []byte) ([]float32, error)

FromBytes converts a byte slice into slice of float32.

func Norm

func Norm(a []float32) float32

Norm returns the Euclidean norm of a.

func Normalize

func Normalize(a []float32)

Normalize converts a to its unit vector.

func Scale

func Scale(a []float32, n float32)

Scale scales a by n.

Types

This section is empty.

Jump to

Keyboard shortcuts

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