gonum: gonum.org/v1/gonum/blas/blas32 Index | Files

package blas32

import "gonum.org/v1/gonum/blas/blas32"

Package blas32 provides a simple interface to the float32 BLAS API.

Index

Package Files

blas32.go conv.go conv_symmetric.go doc.go

func Asum Uses

func Asum(n int, x Vector) float32

Asum computes the sum of the absolute values of the elements of x:

\sum_i |x[i]|.

Asum will panic if the vector increment is negative.

func Axpy Uses

func Axpy(n int, alpha float32, x, y Vector)

Axpy adds x scaled by alpha to y:

y[i] += alpha*x[i] for all i.

func Copy Uses

func Copy(n int, x, y Vector)

Copy copies the elements of x into the elements of y:

y[i] = x[i] for all i.

func DDot Uses

func DDot(n int, x, y Vector) float64

DDot computes the dot product of the two vectors:

\sum_i x[i]*y[i].

func Dot Uses

func Dot(n int, x, y Vector) float32

Dot computes the dot product of the two vectors:

\sum_i x[i]*y[i].

func Gbmv Uses

func Gbmv(t blas.Transpose, alpha float32, a Band, x Vector, beta float32, y Vector)

Gbmv computes

y = alpha * A * x + beta * y   if t == blas.NoTrans,
y = alpha * Aᵀ * x + beta * y  if t == blas.Trans or blas.ConjTrans,

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

func Gemm Uses

func Gemm(tA, tB blas.Transpose, alpha float32, a, b General, beta float32, c General)

Gemm computes

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

where A, B, and C are dense matrices, and alpha and beta are scalars. tA and tB specify whether A or B are transposed.

func Gemv Uses

func Gemv(t blas.Transpose, alpha float32, a General, x Vector, beta float32, y Vector)

Gemv computes

y = alpha * A * x + beta * y   if t == blas.NoTrans,
y = alpha * Aᵀ * x + beta * y  if t == blas.Trans or blas.ConjTrans,

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

func Ger Uses

func Ger(alpha float32, x, y Vector, a General)

Ger performs a rank-1 update

A += alpha * x * yᵀ,

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

func Iamax Uses

func Iamax(n int, x Vector) int

Iamax returns the index of an element of x with the largest absolute value. If there are multiple such indices the earliest is returned. Iamax returns -1 if n == 0.

Iamax will panic if the vector increment is negative.

func Implementation Uses

func Implementation() blas.Float32

Implementation returns the current BLAS float32 implementation.

Implementation allows direct calls to the current the BLAS float32 implementation giving finer control of parameters.

func Nrm2 Uses

func Nrm2(n int, x Vector) float32

Nrm2 computes the Euclidean norm of the vector x:

sqrt(\sum_i x[i]*x[i]).

Nrm2 will panic if the vector increment is negative.

func Rot Uses

func Rot(n int, x, y Vector, c, s float32)

Rot applies a plane transformation to n points represented by the vectors x and y:

x[i] =  c*x[i] + s*y[i],
y[i] = -s*x[i] + c*y[i], for all i.

func Rotg Uses

func Rotg(a, b float32) (c, s, r, z float32)

Rotg computes the parameters of a Givens plane rotation so that

⎡ c s⎤   ⎡a⎤   ⎡r⎤
⎣-s c⎦ * ⎣b⎦ = ⎣0⎦

where a and b are the Cartesian coordinates of a given point. c, s, and r are defined as

r = ±Sqrt(a^2 + b^2),
c = a/r, the cosine of the rotation angle,
s = a/r, the sine of the rotation angle,

and z is defined such that

if |a| > |b|,        z = s,
otherwise if c != 0, z = 1/c,
otherwise            z = 1.

func Rotm Uses

func Rotm(n int, x, y Vector, p blas.SrotmParams)

Rotm applies the modified Givens rotation to n points represented by the vectors x and y.

func Rotmg Uses

func Rotmg(d1, d2, b1, b2 float32) (p blas.SrotmParams, rd1, rd2, rb1 float32)

Rotmg computes the modified Givens rotation. See http://www.netlib.org/lapack/explore-html/df/deb/drotmg_8f.html for more details.

func SDDot Uses

func SDDot(n int, alpha float32, x, y Vector) float32

SDDot computes the dot product of the two vectors adding a constant:

alpha + \sum_i x[i]*y[i].

func Sbmv Uses

func Sbmv(alpha float32, a SymmetricBand, x Vector, beta float32, y Vector)

Sbmv performs

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

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

func Scal Uses

func Scal(n int, alpha float32, x Vector)

Scal scales the vector x by alpha:

x[i] *= alpha for all i.

Scal will panic if the vector increment is negative.

func Spmv Uses

func Spmv(alpha float32, a SymmetricPacked, x Vector, beta float32, y Vector)

Spmv performs

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

where A is an n×n symmetric matrix in packed format, x and y are vectors, and alpha and beta are scalars.

func Spr Uses

func Spr(alpha float32, x Vector, a SymmetricPacked)

Spr performs the rank-1 update

A += alpha * x * xᵀ,

where A is an n×n symmetric matrix in packed format, x is a vector, and alpha is a scalar.

func Spr2 Uses

func Spr2(alpha float32, x, y Vector, a SymmetricPacked)

Spr2 performs a rank-2 update

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

where A is an n×n symmetric matrix in packed format, x and y are vectors, and alpha is a scalar.

func Swap Uses

func Swap(n int, x, y Vector)

Swap exchanges the elements of the two vectors:

x[i], y[i] = y[i], x[i] for all i.

func Symm Uses

func Symm(s blas.Side, alpha float32, a Symmetric, b General, beta float32, c General)

Symm performs

C = alpha * A * B + beta * C  if s == blas.Left,
C = alpha * B * A + beta * C  if s == blas.Right,

where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha is a scalar.

func Symv Uses

func Symv(alpha float32, a Symmetric, x Vector, beta float32, y Vector)

Symv computes

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

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

func Syr Uses

func Syr(alpha float32, x Vector, a Symmetric)

Syr performs a rank-1 update

A += alpha * x * xᵀ,

where A is an n×n symmetric matrix, x is a vector, and alpha is a scalar.

func Syr2 Uses

func Syr2(alpha float32, x, y Vector, a Symmetric)

Syr2 performs a rank-2 update

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

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

func Syr2k Uses

func Syr2k(t blas.Transpose, alpha float32, a, b General, beta float32, c Symmetric)

Syr2k performs a symmetric rank-2k update

C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C  if t == blas.NoTrans,
C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C  if t == blas.Trans or blas.ConjTrans,

where C is an n×n symmetric matrix, A and B are n×k matrices if t == NoTrans and k×n matrices otherwise, and alpha and beta are scalars.

func Syrk Uses

func Syrk(t blas.Transpose, alpha float32, a General, beta float32, c Symmetric)

Syrk performs a symmetric rank-k update

C = alpha * A * Aᵀ + beta * C  if t == blas.NoTrans,
C = alpha * Aᵀ * A + beta * C  if t == blas.Trans or blas.ConjTrans,

where C is an n×n symmetric matrix, A is an n×k matrix if t == blas.NoTrans and a k×n matrix otherwise, and alpha and beta are scalars.

func Tbmv Uses

func Tbmv(t blas.Transpose, a TriangularBand, x Vector)

Tbmv computes

x = A * x   if t == blas.NoTrans,
x = Aᵀ * x  if t == blas.Trans or blas.ConjTrans,

where A is an n×n triangular band matrix, and x is a vector.

func Tbsv Uses

func Tbsv(t blas.Transpose, a TriangularBand, x Vector)

Tbsv solves

A * x = b   if t == blas.NoTrans,
Aᵀ * x = b  if t == blas.Trans or blas.ConjTrans,

where A is an n×n triangular band matrix, and x and b are vectors.

At entry to the function, x contains the values of b, and the result is stored in place into x.

No test for singularity or near-singularity is included in this routine. Such tests must be performed before calling this routine.

func Tpmv Uses

func Tpmv(t blas.Transpose, a TriangularPacked, x Vector)

Tpmv computes

x = A * x   if t == blas.NoTrans,
x = Aᵀ * x  if t == blas.Trans or blas.ConjTrans,

where A is an n×n triangular matrix in packed format, and x is a vector.

func Tpsv Uses

func Tpsv(t blas.Transpose, a TriangularPacked, x Vector)

Tpsv solves

A * x = b   if t == blas.NoTrans,
Aᵀ * x = b  if t == blas.Trans or blas.ConjTrans,

where A is an n×n triangular matrix in packed format, and x and b are vectors.

At entry to the function, x contains the values of b, and the result is stored in place into x.

No test for singularity or near-singularity is included in this routine. Such tests must be performed before calling this routine.

func Trmm Uses

func Trmm(s blas.Side, tA blas.Transpose, alpha float32, a Triangular, b General)

Trmm performs

B = alpha * A * B   if tA == blas.NoTrans and s == blas.Left,
B = alpha * Aᵀ * B  if tA == blas.Trans or blas.ConjTrans, and s == blas.Left,
B = alpha * B * A   if tA == blas.NoTrans and s == blas.Right,
B = alpha * B * Aᵀ  if tA == blas.Trans or blas.ConjTrans, and s == blas.Right,

where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar.

func Trmv Uses

func Trmv(t blas.Transpose, a Triangular, x Vector)

Trmv computes

x = A * x   if t == blas.NoTrans,
x = Aᵀ * x  if t == blas.Trans or blas.ConjTrans,

where A is an n×n triangular matrix, and x is a vector.

func Trsm Uses

func Trsm(s blas.Side, tA blas.Transpose, alpha float32, a Triangular, b General)

Trsm solves

A * X = alpha * B   if tA == blas.NoTrans and s == blas.Left,
Aᵀ * X = alpha * B  if tA == blas.Trans or blas.ConjTrans, and s == blas.Left,
X * A = alpha * B   if tA == blas.NoTrans and s == blas.Right,
X * Aᵀ = alpha * B  if tA == blas.Trans or blas.ConjTrans, and s == blas.Right,

where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a scalar.

At entry to the function, X contains the values of B, and the result is stored in-place into X.

No check is made that A is invertible.

func Trsv Uses

func Trsv(t blas.Transpose, a Triangular, x Vector)

Trsv solves

A * x = b   if t == blas.NoTrans,
Aᵀ * x = b  if t == blas.Trans or blas.ConjTrans,

where A is an n×n triangular matrix, and x and b are vectors.

At entry to the function, x contains the values of b, and the result is stored in-place into x.

No test for singularity or near-singularity is included in this routine. Such tests must be performed before calling this routine.

func Use Uses

func Use(b blas.Float32)

Use sets the BLAS float32 implementation to be used by subsequent BLAS calls. The default implementation is gonum.org/v1/gonum/blas/gonum.Implementation.

type Band Uses

type Band struct {
    Rows, Cols int
    KL, KU     int
    Stride     int
    Data       []float32
}

Band represents a band matrix using the band storage scheme.

func (Band) From Uses

func (t Band) From(a BandCols)

From fills the receiver with elements from a. The receiver must have the same dimensions and bandwidth as a and have adequate backing data storage.

type BandCols Uses

type BandCols Band

BandCols represents a matrix using the band column-major storage scheme.

func (BandCols) From Uses

func (t BandCols) From(a Band)

From fills the receiver with elements from a. The receiver must have the same dimensions and bandwidth as a and have adequate backing data storage.

type General Uses

type General struct {
    Rows, Cols int
    Stride     int
    Data       []float32
}

General represents a matrix using the conventional storage scheme.

func (General) From Uses

func (t General) From(a GeneralCols)

From fills the receiver with elements from a. The receiver must have the same dimensions as a and have adequate backing data storage.

type GeneralCols Uses

type GeneralCols General

GeneralCols represents a matrix using the conventional column-major storage scheme.

func (GeneralCols) From Uses

func (t GeneralCols) From(a General)

From fills the receiver with elements from a. The receiver must have the same dimensions as a and have adequate backing data storage.

type Symmetric Uses

type Symmetric struct {
    N      int
    Stride int
    Data   []float32
    Uplo   blas.Uplo
}

Symmetric represents a symmetric matrix using the conventional storage scheme.

func (Symmetric) From Uses

func (t Symmetric) From(a SymmetricCols)

From fills the receiver with elements from a. The receiver must have the same dimensions and uplo as a and have adequate backing data storage.

type SymmetricBand Uses

type SymmetricBand struct {
    N, K   int
    Stride int
    Data   []float32
    Uplo   blas.Uplo
}

SymmetricBand represents a symmetric matrix using the band storage scheme.

func (SymmetricBand) From Uses

func (t SymmetricBand) From(a SymmetricBandCols)

From fills the receiver with elements from a. The receiver must have the same dimensions, bandwidth and uplo as a and have adequate backing data storage.

type SymmetricBandCols Uses

type SymmetricBandCols SymmetricBand

SymmetricBandCols represents a symmetric matrix using the band column-major storage scheme.

func (SymmetricBandCols) From Uses

func (t SymmetricBandCols) From(a SymmetricBand)

From fills the receiver with elements from a. The receiver must have the same dimensions, bandwidth and uplo as a and have adequate backing data storage.

type SymmetricCols Uses

type SymmetricCols Symmetric

SymmetricCols represents a matrix using the conventional column-major storage scheme.

func (SymmetricCols) From Uses

func (t SymmetricCols) From(a Symmetric)

From fills the receiver with elements from a. The receiver must have the same dimensions and uplo as a and have adequate backing data storage.

type SymmetricPacked Uses

type SymmetricPacked struct {
    N    int
    Data []float32
    Uplo blas.Uplo
}

SymmetricPacked represents a symmetric matrix using the packed storage scheme.

type Triangular Uses

type Triangular struct {
    N      int
    Stride int
    Data   []float32
    Uplo   blas.Uplo
    Diag   blas.Diag
}

Triangular represents a triangular matrix using the conventional storage scheme.

func (Triangular) From Uses

func (t Triangular) From(a TriangularCols)

From fills the receiver with elements from a. The receiver must have the same dimensions, uplo and diag as a and have adequate backing data storage.

type TriangularBand Uses

type TriangularBand struct {
    N, K   int
    Stride int
    Data   []float32
    Uplo   blas.Uplo
    Diag   blas.Diag
}

TriangularBand represents a triangular matrix using the band storage scheme.

func (TriangularBand) From Uses

func (t TriangularBand) From(a TriangularBandCols)

From fills the receiver with elements from a. The receiver must have the same dimensions, bandwidth and uplo as a and have adequate backing data storage.

type TriangularBandCols Uses

type TriangularBandCols TriangularBand

TriangularBandCols represents a triangular matrix using the band column-major storage scheme.

func (TriangularBandCols) From Uses

func (t TriangularBandCols) From(a TriangularBand)

From fills the receiver with elements from a. The receiver must have the same dimensions, bandwidth and uplo as a and have adequate backing data storage.

type TriangularCols Uses

type TriangularCols Triangular

TriangularCols represents a matrix using the conventional column-major storage scheme.

func (TriangularCols) From Uses

func (t TriangularCols) From(a Triangular)

From fills the receiver with elements from a. The receiver must have the same dimensions, uplo and diag as a and have adequate backing data storage.

type TriangularPacked Uses

type TriangularPacked struct {
    N    int
    Data []float32
    Uplo blas.Uplo
    Diag blas.Diag
}

TriangularPacked represents a triangular matrix using the packed storage scheme.

type Vector Uses

type Vector struct {
    Inc  int
    Data []float32
}

Vector represents a vector with an associated element increment.

Package blas32 imports 2 packages (graph) and is imported by 5 packages. Updated 2019-09-06. Refresh now. Tools for package owners.