internal

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConst

func AddConst(alpha float32, x []float32)

AddConst is

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

func CumSum

func CumSum(dst, s []float32) []float32

CumSum is

if len(s) == 0 {
	return dst
}
dst[0] = s[0]
for i, v := range s[1:] {
	dst[i+1] = dst[i] + v
}
return dst

func Dgemm

func Dgemm(tA, tB Transpose, m, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int)

Dgemm performs one of the matrix-matrix operations

C = alpha * A * B + beta * C
C = alpha * Aᵀ * B + beta * C
C = alpha * A * Bᵀ + beta * C
C = alpha * Aᵀ * Bᵀ + beta * C

where A is an m×k or k×m dense matrix, B is an n×k or k×n dense matrix, C is an m×n matrix, and alpha and beta are scalars. tA and tB specify whether A or B are transposed.

func DgemmSerial

func DgemmSerial(aTrans, bTrans bool, m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32)

DgemmSerial is serial matrix multiply

func DivTo

func DivTo(dst, s, t []float32) []float32

DivTo is

for i, v := range s {
	dst[i] = v / t[i]
}
return dst

func GemvT

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

GemvT computes

y = alpha * Aᵀ * x + beta * y

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

func Sum

func Sum(x []float32) float32

Sum is

var sum float32
for i := range x {
    sum += x[i]
}

Types

type Transpose

type Transpose byte

Transpose specifies the transposition operation of a matrix.

const (

	// NoTrans is a Transpose option.
	NoTrans Transpose = 'N'
	// Trans is a Transpose option.
	Trans Transpose = 'T'
	// ConjTrans is a Transpose option.
	ConjTrans Transpose = 'C'
)

Directories

Path Synopsis
asm
f32
Package f32 provides float32 vector primitives.
Package f32 provides float32 vector primitives.

Jump to

Keyboard shortcuts

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