Documentation ¶
Overview ¶
Package blas32 provides a simple interface to the float32 BLAS API.
Index ¶
- func Asum(n int, x Vector) float32
- func Axpy(n int, alpha float32, x, y Vector)
- func Copy(n int, x, y Vector)
- func DDot(n int, x, y Vector) float64
- func Dot(n int, x, y Vector) float32
- func Gbmv(tA blas.Transpose, alpha float32, a Band, x Vector, beta float32, y Vector)
- func Gemm(tA, tB blas.Transpose, alpha float32, a, b General, beta float32, c General)
- func Gemv(tA blas.Transpose, alpha float32, a General, x Vector, beta float32, y Vector)
- func Ger(alpha float32, x, y Vector, a General)
- func Iamax(n int, x Vector) int
- func Implementation() blas.Float32
- func Nrm2(n int, x Vector) float32
- func Rot(n int, x, y Vector, c, s float32)
- func Rotg(a, b float32) (c, s, r, z float32)
- func Rotm(n int, x, y Vector, p blas.SrotmParams)
- func Rotmg(d1, d2, b1, b2 float32) (p blas.SrotmParams, rd1, rd2, rb1 float32)
- func SDDot(n int, alpha float32, x, y Vector) float32
- func Sbmv(alpha float32, a SymmetricBand, x Vector, beta float32, y Vector)
- func Scal(n int, alpha float32, x Vector)
- func Spmv(alpha float32, a SymmetricPacked, x Vector, beta float32, y Vector)
- func Spr(alpha float32, x Vector, a SymmetricPacked)
- func Spr2(alpha float32, x, y Vector, a SymmetricPacked)
- func Swap(n int, x, y Vector)
- func Symm(s blas.Side, alpha float32, a Symmetric, b General, beta float32, c General)
- func Symv(alpha float32, a Symmetric, x Vector, beta float32, y Vector)
- func Syr(alpha float32, x Vector, a Symmetric)
- func Syr2(alpha float32, x, y Vector, a Symmetric)
- func Syr2k(t blas.Transpose, alpha float32, a, b General, beta float32, c Symmetric)
- func Syrk(t blas.Transpose, alpha float32, a General, beta float32, c Symmetric)
- func Tbmv(tA blas.Transpose, a TriangularBand, x Vector)
- func Tbsv(tA blas.Transpose, a TriangularBand, x Vector)
- func Tpmv(tA blas.Transpose, a TriangularPacked, x Vector)
- func Tpsv(tA blas.Transpose, a TriangularPacked, x Vector)
- func Trmm(s blas.Side, tA blas.Transpose, alpha float32, a Triangular, b General)
- func Trmv(tA blas.Transpose, a Triangular, x Vector)
- func Trsm(s blas.Side, tA blas.Transpose, alpha float32, a Triangular, b General)
- func Trsv(tA blas.Transpose, a Triangular, x Vector)
- func Use(b blas.Float32)
- type Band
- type General
- type Symmetric
- type SymmetricBand
- type SymmetricPacked
- type Triangular
- type TriangularBand
- type TriangularPacked
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asum ¶
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 Gbmv ¶
Gbmv computes
y = alpha * A * x + beta * y if tA == blas.NoTrans y = alpha * A^T * x + beta * y if tA == blas.Trans or blas.ConjTrans
where a is an m×n band matrix kL subdiagonals and kU super-diagonals, and m and n refer to the size of the full dense matrix it represents. x and y are vectors, and alpha and beta are scalars.
func Gemm ¶
Gemm computes
C = beta * C + alpha * A * B.
tA and tB specify whether A or B are transposed. A, B, and C are m×n dense matrices.
func Gemv ¶
Gemv computes
y = alpha * a * x + beta * y if tA = blas.NoTrans y = alpha * A^T * x + beta * y if tA = blas.Trans or blas.ConjTrans
where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar.
func Ger ¶
Ger performs the rank-one operation
A += alpha * x * y^T
where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar.
func Iamax ¶
Iamax returns the index of the largest element of x. 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 ¶
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 ¶
Nrm2 computes the Euclidean norm of a vector,
sqrt(\sum_i x[i] * x[i]).
Nrm2 will panic if the vector increment is negative.
func Rot ¶
Rot applies a plane transformation.
x[i] = c * x[i] + s * y[i] y[i] = c * y[i] - s * x[i]
func Rotg ¶
Rotg computes the plane rotation
_ _ _ _ _ _ | c s | | a | | r | | -s c | * | b | = | 0 | ‾ ‾ ‾ ‾ ‾ ‾
where
r = ±(a^2 + b^2) c = a/r, the cosine of the plane rotation s = b/r, the sine of the plane rotation
func Rotm ¶
func Rotm(n int, x, y Vector, p blas.SrotmParams)
Rotm applies the modified Givens rotation to the 2×n matrix.
func Rotmg ¶
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 ¶
SDDot computes the dot product of the two vectors adding a constant
alpha + \sum_i x[i]*y[i]
func Sbmv ¶
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 banded matrix, x and y are vectors, and alpha and beta are scalars.
func Scal ¶
Scal scales x by alpha.
x[i] *= alpha
Scal will panic if the vector increment is negative
func Spmv ¶
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 ¶
func Spr(alpha float32, x Vector, a SymmetricPacked)
Spr computes the rank-one operation
a += alpha * x * x^T
where a is an n×n symmetric matrix in packed format, x is a vector, and alpha is a scalar.
func Spr2 ¶
func Spr2(alpha float32, x, y Vector, a SymmetricPacked)
Spr2 performs the symmetric rank-2 update
a += alpha * x * y^T + alpha * y * x^T
where a is an n×n symmetric matirx in packed format and x and y are vectors.
func Symm ¶
Symm performs one of
C = alpha * A * B + beta * C if side == blas.Left C = alpha * B * A + beta * C if side == blas.Right
where A is an n×n symmetric matrix, B and C are m×n matrices, and alpha is a scalar.
func Symv ¶
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 ¶
Syr performs the rank-one update
a += alpha * x * x^T
where a is an n×n symmetric matrix, and x is a vector.
func Syr2 ¶
Syr2 performs the symmetric rank-two update
A += alpha * x * y^T + alpha * y * x^T
where A is a symmetric n×n matrix, x and y are vectors, and alpha is a scalar.
func Syr2k ¶
Syr2k performs the symmetric rank 2k operation
C = alpha * A * B^T + alpha * B * A^T + beta * C
where C is an n×n symmetric matrix. A and B are n×k matrices if tA == NoTrans and k×n otherwise. alpha and beta are scalars.
func Syrk ¶
Syrk performs the symmetric rank-k operation
C = alpha * A * A^T + beta*C
C is an n×n symmetric matrix. A is an n×k matrix if tA == blas.NoTrans, and a k×n matrix otherwise. alpha and beta are scalars.
func Tbmv ¶
func Tbmv(tA blas.Transpose, a TriangularBand, x Vector)
Tbmv computes
x = A * x if tA == blas.NoTrans x = A^T * x if tA == blas.Trans or blas.ConjTrans
where A is an n×n triangular banded matrix with k diagonals, and x is a vector.
func Tbsv ¶
func Tbsv(tA blas.Transpose, a TriangularBand, x Vector)
Tbsv solves
A * x = b
where A is an n×n triangular banded matrix with k diagonals in packed format, and x is a vector. 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 ¶
func Tpmv(tA blas.Transpose, a TriangularPacked, x Vector)
Tpmv computes
x = A * x if tA == blas.NoTrans x = A^T * x if tA == blas.Trans or blas.ConjTrans
where A is an n×n unit triangular matrix in packed format, and x is a vector.
func Tpsv ¶
func Tpsv(tA blas.Transpose, a TriangularPacked, x Vector)
Tpsv solves
A * x = b if tA == blas.NoTrans A^T * x = b if tA == blas.Trans or blas.ConjTrans
where A is an n×n triangular matrix in packed format and x is a vector. 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 ¶
Trmm performs
B = alpha * A * B if tA == blas.NoTrans and side == blas.Left B = alpha * A^T * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left B = alpha * B * A if tA == blas.NoTrans and side == blas.Right B = alpha * B * A^T if tA == blas.Trans or blas.ConjTrans, and side == blas.Right
where A is an n×n triangular matrix, and B is an m×n matrix.
func Trmv ¶
func Trmv(tA blas.Transpose, a Triangular, x Vector)
Trmv computes
x = A * x if tA == blas.NoTrans x = A^T * x if tA == blas.Trans or blas.ConjTrans
A is an n×n Triangular matrix and x is a vector.
func Trsm ¶
Trsm solves
A * X = alpha * B if tA == blas.NoTrans side == blas.Left A^T * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left X * A = alpha * B if tA == blas.NoTrans side == blas.Right X * A^T = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right
where A is an n×n triangular matrix, x is an m×n matrix, 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 ¶
func Trsv(tA blas.Transpose, a Triangular, x Vector)
Trsv solves
A * x = b if tA == blas.NoTrans A^T * x = b if tA == blas.Trans or blas.ConjTrans
A is an n×n triangular matrix and x is a vector. 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.
Types ¶
type SymmetricBand ¶
SymmetricBand represents a symmetric matrix using the band storage scheme.
type SymmetricPacked ¶
SymmetricPacked represents a symmetric matrix using the packed storage scheme.
type Triangular ¶
Triangular represents a triangular matrix using the conventional storage scheme.
type TriangularBand ¶
TriangularBand represents a triangular matrix using the band storage scheme.
type TriangularPacked ¶
TriangularPacked represents a triangular matrix using the packed storage scheme.