linalg

package
v0.0.0-...-9560b92 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[T Number](x T) T

func Cast

func Cast[T Number, U Number](v T) U

func Max

func Max[T Number](x, y T) T

func Mid

func Mid[T Number](x, y T) T

func Min

func Min[T Number](x, y T) T

func WithLinAlg

func WithLinAlg(ctx context.Context, conf Config) context.Context

Types

type Config

type Config struct {
	DisableAVX2 bool
}

type Env

type Env[T Number] struct {
	SqL2        func(x, y []T) float32
	SqL2WithF32 func(x []T, y []float32) float32
	Dot         func(x, y []T) float32
	DotWithF32  func(x []T, y []float32) float32
}

func NewLinAlg

func NewLinAlg[T Number](conf Config) Env[T]

func NewLinAlgFromContext

func NewLinAlgFromContext[T Number](ctx context.Context) Env[T]

type LinAlgKey

type LinAlgKey string

type Number

type Number interface {
	~uint8 | ~float32 | ~float64 | ~uint | ~int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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