f32

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package f32 provides float32 vector primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AxpyInc

func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr)

AxpyInc is

for i := 0; i < int(n); i++ {
	y[iy] += alpha * x[ix]
	ix += incX
	iy += incY
}

func AxpyIncTo

func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr)

AxpyIncTo is

for i := 0; i < int(n); i++ {
	dst[idst] = alpha*x[ix] + y[iy]
	ix += incX
	iy += incY
	idst += incDst
}

func AxpyUnitary

func AxpyUnitary(alpha float32, x, y []float32)

AxpyUnitary is

for i, v := range x {
	y[i] += alpha * v
}

func AxpyUnitaryTo

func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32)

AxpyUnitaryTo is

for i, v := range x {
	dst[i] = alpha*v + y[i]
}

func DdotInc

func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64)

DdotInc is

for i := 0; i < int(n); i++ {
	sum += float64(y[iy]) * float64(x[ix])
	ix += incX
	iy += incY
}
return

func DdotUnitary

func DdotUnitary(x, y []float32) (sum float64)

DdotUnitary is

for i, v := range x {
	sum += float64(y[i]) * float64(v)
}
return

func DotInc

func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32)

DotInc is

for i := 0; i < int(n); i++ {
	sum += y[iy] * x[ix]
	ix += incX
	iy += incY
}
return sum

func DotUnitary

func DotUnitary(x, y []float32) (sum float32)

DotUnitary is

for i, v := range x {
	sum += y[i] * v
}
return sum

func Ger

func Ger(m, n uintptr, alpha float32,
	x []float32, incX uintptr,
	y []float32, incY uintptr,
	a []float32, lda uintptr)

Ger performs the rank-one operation

A += alpha * x * yᵀ

where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar.

func L2DistanceUnitary added in v0.7.0

func L2DistanceUnitary(x, y []float32) (sum float32)

L2DistanceUnitary is the L2 norm of x-y.

func L2NormInc added in v0.7.0

func L2NormInc(x []float32, n, incX uintptr) (sum float32)

L2NormInc is the level 2 norm of x.

func L2NormUnitary added in v0.7.0

func L2NormUnitary(x []float32) (sum float32)

L2NormUnitary is the level 2 norm of x.

func ScalInc

func ScalInc(alpha float32, x []float32, n, incX uintptr)

ScalInc is

var ix uintptr
for i := 0; i < int(n); i++ {
	x[ix] *= alpha
	ix += incX
}

func ScalIncTo

func ScalIncTo(dst []float32, incDst uintptr, alpha float32, x []float32, n, incX uintptr)

ScalIncTo is

var idst, ix uintptr
for i := 0; i < int(n); i++ {
	dst[idst] = alpha * x[ix]
	ix += incX
	idst += incDst
}

func ScalUnitary

func ScalUnitary(alpha float32, x []float32)

ScalUnitary is

for i := range x {
	x[i] *= alpha
}

func ScalUnitaryTo

func ScalUnitaryTo(dst []float32, alpha float32, x []float32)

ScalUnitaryTo is

for i, v := range x {
	dst[i] = alpha * v
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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