From 17ea55aedbdeb2cc52c970172f60256a9870cd98 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Tue, 3 Sep 2019 13:46:38 +0930 Subject: [PATCH] blas,lapack: clean up docs and comments Apply (with manual curation after the fact): * s/^T/U+1d40/g * s/^H/U+1d34/g * s/, {2,3}if / $1/g Some additional manual editing of odd formatting. --- blas/blas32/blas32.go | 74 +++++++++---------- blas/blas64/blas64.go | 74 +++++++++---------- blas/cblas128/cblas128.go | 112 ++++++++++++++--------------- blas/cblas64/cblas64.go | 112 ++++++++++++++--------------- blas/gonum/dgemm.go | 12 ++-- blas/gonum/gemv.go | 8 +-- blas/gonum/level1cmplx128.go | 4 +- blas/gonum/level1cmplx64.go | 4 +- blas/gonum/level2cmplx128.go | 80 ++++++++++----------- blas/gonum/level2cmplx64.go | 80 ++++++++++----------- blas/gonum/level2float32.go | 38 +++++----- blas/gonum/level2float64.go | 38 +++++----- blas/gonum/level3cmplx128.go | 70 +++++++++--------- blas/gonum/level3cmplx64.go | 70 +++++++++--------- blas/gonum/level3float32.go | 24 +++---- blas/gonum/level3float64.go | 24 +++---- blas/gonum/sgemm.go | 12 ++-- blas/testblas/common.go | 2 +- blas/testblas/zher2k.go | 4 +- blas/testblas/zsyr2k.go | 4 +- internal/asm/f32/ge_amd64.go | 2 +- internal/asm/f32/ge_noasm.go | 2 +- internal/asm/f64/ge_amd64.go | 4 +- internal/asm/f64/ge_noasm.go | 4 +- lapack/gonum/dbdsqr.go | 12 ++-- lapack/gonum/dgebak.go | 4 +- lapack/gonum/dgebal.go | 8 +-- lapack/gonum/dgebd2.go | 2 +- lapack/gonum/dgebrd.go | 6 +- lapack/gonum/dgeev.go | 4 +- lapack/gonum/dgehd2.go | 4 +- lapack/gonum/dgehrd.go | 8 +-- lapack/gonum/dgels.go | 2 +- lapack/gonum/dgeql2.go | 2 +- lapack/gonum/dgeqp3.go | 2 +- lapack/gonum/dgeqr2.go | 2 +- lapack/gonum/dgeqrf.go | 2 +- lapack/gonum/dgerq2.go | 2 +- lapack/gonum/dgerqf.go | 2 +- lapack/gonum/dgesvd.go | 4 +- lapack/gonum/dgetrs.go | 10 +-- lapack/gonum/dggsvd3.go | 6 +- lapack/gonum/dggsvp3.go | 18 ++--- lapack/gonum/dhseqr.go | 8 +-- lapack/gonum/dlabrd.go | 6 +- lapack/gonum/dlacn2.go | 2 +- lapack/gonum/dlags2.go | 40 +++++------ lapack/gonum/dlahr2.go | 18 ++--- lapack/gonum/dlaln2.go | 6 +- lapack/gonum/dlaqp2.go | 2 +- lapack/gonum/dlaqps.go | 10 +-- lapack/gonum/dlaqr04.go | 10 +-- lapack/gonum/dlaqr23.go | 4 +- lapack/gonum/dlaqr5.go | 6 +- lapack/gonum/dlarf.go | 8 +-- lapack/gonum/dlarfb.go | 102 +++++++++++++------------- lapack/gonum/dlarfg.go | 4 +- lapack/gonum/dlarft.go | 4 +- lapack/gonum/dlarfx.go | 2 +- lapack/gonum/dlasr.go | 2 +- lapack/gonum/dlasy2.go | 8 +-- lapack/gonum/dlatbs.go | 8 +-- lapack/gonum/dlatrd.go | 6 +- lapack/gonum/dlatrs.go | 2 +- lapack/gonum/dlauu2.go | 8 +-- lapack/gonum/dlauum.go | 8 +-- lapack/gonum/dorgbr.go | 12 ++-- lapack/gonum/dorghr.go | 4 +- lapack/gonum/dorm2r.go | 8 +-- lapack/gonum/dormbr.go | 10 +-- lapack/gonum/dormhr.go | 16 ++--- lapack/gonum/dorml2.go | 8 +-- lapack/gonum/dormlq.go | 8 +-- lapack/gonum/dormqr.go | 8 +-- lapack/gonum/dormr2.go | 8 +-- lapack/gonum/dpbcon.go | 10 +-- lapack/gonum/dpbtf2.go | 8 +-- lapack/gonum/dpbtrf.go | 4 +- lapack/gonum/dpbtrs.go | 12 ++-- lapack/gonum/dpotf2.go | 2 +- lapack/gonum/dpotrf.go | 2 +- lapack/gonum/dpotri.go | 4 +- lapack/gonum/dpotrs.go | 12 ++-- lapack/gonum/dsytd2.go | 16 ++--- lapack/gonum/dsytrd.go | 10 +-- lapack/gonum/dtgsja.go | 8 +-- lapack/gonum/dtrevc3.go | 22 +++--- lapack/gonum/dtrexc.go | 4 +- lapack/gonum/dtrtrs.go | 2 +- lapack/lapack.go | 6 +- lapack/lapack64/lapack64.go | 48 ++++++------- lapack/testlapack/dbdsqr.go | 4 +- lapack/testlapack/dgebal.go | 2 +- lapack/testlapack/dgebd2.go | 2 +- lapack/testlapack/dgeev.go | 2 +- lapack/testlapack/dgehd2.go | 6 +- lapack/testlapack/dgehrd.go | 8 +-- lapack/testlapack/dgels.go | 4 +- lapack/testlapack/dgesvd.go | 6 +- lapack/testlapack/dggsvd3.go | 8 +-- lapack/testlapack/dggsvp3.go | 8 +-- lapack/testlapack/dhseqr.go | 2 +- lapack/testlapack/dlaexc.go | 2 +- lapack/testlapack/dlags2.go | 8 +-- lapack/testlapack/dlahqr.go | 2 +- lapack/testlapack/dlahr2.go | 4 +- lapack/testlapack/dlaln2.go | 6 +- lapack/testlapack/dlaqr04.go | 2 +- lapack/testlapack/dlaqr23.go | 6 +- lapack/testlapack/dlaqr5.go | 4 +- lapack/testlapack/dlarfg.go | 2 +- lapack/testlapack/dlarft.go | 12 ++-- lapack/testlapack/dlarfx.go | 2 +- lapack/testlapack/dlasq1.go | 2 +- lapack/testlapack/dlatbs.go | 2 +- lapack/testlapack/dlatrd.go | 8 +-- lapack/testlapack/dlauu2.go | 8 +-- lapack/testlapack/dorgbr.go | 2 +- lapack/testlapack/dorgtr.go | 2 +- lapack/testlapack/dpbtf2.go | 2 +- lapack/testlapack/dpbtrf.go | 10 +-- lapack/testlapack/dpbtrs.go | 2 +- lapack/testlapack/dpotrf.go | 6 +- lapack/testlapack/dpotri.go | 2 +- lapack/testlapack/dsytd2.go | 2 +- lapack/testlapack/dsytrd.go | 4 +- lapack/testlapack/dtgsja.go | 8 +-- lapack/testlapack/dtrexc.go | 4 +- lapack/testlapack/general.go | 16 ++--- lapack/testlapack/matgen.go | 4 +- lapack/testlapack/matgen_test.go | 4 +- lapack/testlapack/test_matrices.go | 18 ++--- mat/cholesky.go | 20 +++--- mat/cholesky_example_test.go | 14 ++-- mat/dense_arithmetic.go | 8 +-- mat/doc.go | 2 +- mat/errors.go | 2 +- mat/gsvd.go | 8 +-- mat/gsvd_example_test.go | 10 +-- mat/gsvd_test.go | 4 +- mat/hogsvd.go | 6 +- mat/hogsvd_example_test.go | 4 +- mat/hogsvd_test.go | 4 +- mat/inner.go | 2 +- mat/lq.go | 4 +- mat/lq_test.go | 8 +-- mat/lu.go | 6 +- mat/matrix.go | 4 +- mat/qr.go | 6 +- mat/qr_test.go | 8 +-- mat/solve_test.go | 4 +- mat/svd.go | 4 +- mat/symmetric.go | 4 +- optimize/bfgs.go | 6 +- optimize/convex/lp/convert.go | 16 ++--- optimize/convex/lp/simplex.go | 6 +- optimize/convex/lp/simplex_test.go | 12 ++-- stat/distmat/wishart.go | 8 +-- stat/distmv/normal.go | 4 +- stat/distmv/statdist.go | 6 +- stat/distmv/studentst.go | 8 +-- stat/pca_cca.go | 4 +- stat/pca_test.go | 2 +- stat/statmat.go | 2 +- 164 files changed, 949 insertions(+), 949 deletions(-) diff --git a/blas/blas32/blas32.go b/blas/blas32/blas32.go index 926a5ac2..77aa3ab2 100644 --- a/blas/blas32/blas32.go +++ b/blas/blas32/blas32.go @@ -221,48 +221,48 @@ func Scal(n int, alpha float32, x Vector) { // Level 2 // Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, +// 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 Gemv(t blas.Transpose, alpha float32, a General, x Vector, beta float32, y Vector) { blas32.Sgemv(t, a.Rows, a.Cols, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) } // Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, +// 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 Gbmv(t blas.Transpose, alpha float32, a Band, x Vector, beta float32, y Vector) { blas32.Sgbmv(t, a.Rows, a.Cols, a.KL, a.KU, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) } // Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// 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 Trmv(t blas.Transpose, a Triangular, x Vector) { blas32.Strmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) } // Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// 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 Tbmv(t blas.Transpose, a TriangularBand, x Vector) { blas32.Stbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) } // Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// 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 Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { blas32.Stpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) } // Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// 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 @@ -275,8 +275,8 @@ func Trsv(t blas.Transpose, a Triangular, x Vector) { } // Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// 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 @@ -289,8 +289,8 @@ func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { } // Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// 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. // @@ -304,7 +304,7 @@ func Tpsv(t blas.Transpose, a TriangularPacked, x Vector) { } // Symv computes -// y = alpha * A * x + beta * y, +// 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 Symv(alpha float32, a Symmetric, x Vector, beta float32, y Vector) { @@ -320,7 +320,7 @@ func Sbmv(alpha float32, a SymmetricBand, x Vector, beta float32, y Vector) { } // Spmv performs -// y = alpha * A * x + beta * y, +// 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 Spmv(alpha float32, a SymmetricPacked, x Vector, beta float32, y Vector) { @@ -328,21 +328,21 @@ func Spmv(alpha float32, a SymmetricPacked, x Vector, beta float32, y Vector) { } // Ger performs a rank-1 update -// A += alpha * x * y^T, +// A += alpha * x * yᵀ, // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Ger(alpha float32, x, y Vector, a General) { blas32.Sger(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Syr performs a rank-1 update -// A += alpha * x * x^T, +// A += alpha * x * xᵀ, // where A is an n×n symmetric matrix, x is a vector, and alpha is a scalar. func Syr(alpha float32, x Vector, a Symmetric) { blas32.Ssyr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) } // Spr performs the rank-1 update -// A += alpha * x * x^T, +// 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 Spr(alpha float32, x Vector, a SymmetricPacked) { @@ -350,14 +350,14 @@ func Spr(alpha float32, x Vector, a SymmetricPacked) { } // Syr2 performs a rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, +// 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 Syr2(alpha float32, x, y Vector, a Symmetric) { blas32.Ssyr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Spr2 performs a rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, +// 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 Spr2(alpha float32, x, y Vector, a SymmetricPacked) { @@ -386,8 +386,8 @@ func Gemm(tA, tB blas.Transpose, alpha float32, a, b General, beta float32, c Ge } // Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// 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 Symm(s blas.Side, alpha float32, a Symmetric, b General, beta float32, c General) { @@ -401,8 +401,8 @@ func Symm(s blas.Side, alpha float32, a Symmetric, b General, beta float32, c Ge } // Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, +// 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 Syrk(t blas.Transpose, alpha float32, a General, beta float32, c Symmetric) { @@ -416,8 +416,8 @@ func Syrk(t blas.Transpose, alpha float32, a General, beta float32, c Symmetric) } // Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, +// 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 Syr2k(t blas.Transpose, alpha float32, a, b General, beta float32, c Symmetric) { @@ -431,10 +431,10 @@ func Syr2k(t blas.Transpose, alpha float32, a, b General, beta float32, c Symmet } // Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * 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^T, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, +// 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 Trmm(s blas.Side, tA blas.Transpose, alpha float32, a Triangular, b General) { @@ -442,10 +442,10 @@ func Trmm(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^T * 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^T = alpha * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, +// 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. // diff --git a/blas/blas64/blas64.go b/blas/blas64/blas64.go index 55198383..58d3d490 100644 --- a/blas/blas64/blas64.go +++ b/blas/blas64/blas64.go @@ -232,48 +232,48 @@ func Scal(alpha float64, x Vector) { // Level 2 // Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, +// 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 Gemv(t blas.Transpose, alpha float64, a General, x Vector, beta float64, y Vector) { blas64.Dgemv(t, a.Rows, a.Cols, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) } // Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, +// 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 Gbmv(t blas.Transpose, alpha float64, a Band, x Vector, beta float64, y Vector) { blas64.Dgbmv(t, a.Rows, a.Cols, a.KL, a.KU, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) } // Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// 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 Trmv(t blas.Transpose, a Triangular, x Vector) { blas64.Dtrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) } // Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// 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 Tbmv(t blas.Transpose, a TriangularBand, x Vector) { blas64.Dtbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) } // Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, +// 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 Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { blas64.Dtpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) } // Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// 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 @@ -286,8 +286,8 @@ func Trsv(t blas.Transpose, a Triangular, x Vector) { } // Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// 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 @@ -300,8 +300,8 @@ func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { } // Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, +// 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. // @@ -315,7 +315,7 @@ func Tpsv(t blas.Transpose, a TriangularPacked, x Vector) { } // Symv computes -// y = alpha * A * x + beta * y, +// 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 Symv(alpha float64, a Symmetric, x Vector, beta float64, y Vector) { @@ -331,7 +331,7 @@ func Sbmv(alpha float64, a SymmetricBand, x Vector, beta float64, y Vector) { } // Spmv performs -// y = alpha * A * x + beta * y, +// 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 Spmv(alpha float64, a SymmetricPacked, x Vector, beta float64, y Vector) { @@ -339,21 +339,21 @@ func Spmv(alpha float64, a SymmetricPacked, x Vector, beta float64, y Vector) { } // Ger performs a rank-1 update -// A += alpha * x * y^T, +// A += alpha * x * yᵀ, // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Ger(alpha float64, x, y Vector, a General) { blas64.Dger(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Syr performs a rank-1 update -// A += alpha * x * x^T, +// A += alpha * x * xᵀ, // where A is an n×n symmetric matrix, x is a vector, and alpha is a scalar. func Syr(alpha float64, x Vector, a Symmetric) { blas64.Dsyr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) } // Spr performs the rank-1 update -// A += alpha * x * x^T, +// 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 Spr(alpha float64, x Vector, a SymmetricPacked) { @@ -361,14 +361,14 @@ func Spr(alpha float64, x Vector, a SymmetricPacked) { } // Syr2 performs a rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, +// 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 Syr2(alpha float64, x, y Vector, a Symmetric) { blas64.Dsyr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Spr2 performs a rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, +// 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 Spr2(alpha float64, x, y Vector, a SymmetricPacked) { @@ -397,8 +397,8 @@ func Gemm(tA, tB blas.Transpose, alpha float64, a, b General, beta float64, c Ge } // Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// 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 Symm(s blas.Side, alpha float64, a Symmetric, b General, beta float64, c General) { @@ -412,8 +412,8 @@ func Symm(s blas.Side, alpha float64, a Symmetric, b General, beta float64, c Ge } // Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, +// 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 Syrk(t blas.Transpose, alpha float64, a General, beta float64, c Symmetric) { @@ -427,8 +427,8 @@ func Syrk(t blas.Transpose, alpha float64, a General, beta float64, c Symmetric) } // Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, +// 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 Syr2k(t blas.Transpose, alpha float64, a, b General, beta float64, c Symmetric) { @@ -442,10 +442,10 @@ func Syr2k(t blas.Transpose, alpha float64, a, b General, beta float64, c Symmet } // Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * 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^T, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, +// 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 Trmm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General) { @@ -453,10 +453,10 @@ func Trmm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General } // Trsm solves -// A * X = alpha * B, if tA == blas.NoTrans and s == blas.Left, -// A^T * 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^T = alpha * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, +// 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. // diff --git a/blas/cblas128/cblas128.go b/blas/cblas128/cblas128.go index 1205da8a..1864372a 100644 --- a/blas/cblas128/cblas128.go +++ b/blas/cblas128/cblas128.go @@ -111,14 +111,14 @@ const negInc = "cblas128: negative vector increment" // Dotu computes the dot product of the two vectors without // complex conjugation: -// x^T * y. +// xᵀ * y. func Dotu(n int, x, y Vector) complex128 { return cblas128.Zdotu(n, x.Data, x.Inc, y.Data, y.Inc) } // Dotc computes the dot product of the two vectors with // complex conjugation: -// x^H * y. +// xᴴ * y. func Dotc(n int, x, y Vector) complex128 { return cblas128.Zdotc(n, x.Data, x.Inc, y.Data, y.Inc) } @@ -206,9 +206,9 @@ func Dscal(n int, alpha float64, x Vector) { // Level 2 // Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, +// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, // where A is an m×n dense matrix, x and y are vectors, and alpha and beta are // scalars. func Gemv(t blas.Transpose, alpha complex128, a General, x Vector, beta complex128, y Vector) { @@ -216,9 +216,9 @@ func Gemv(t blas.Transpose, alpha complex128, a General, x Vector, beta complex1 } // Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, +// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, // where A is an m×n band matrix, x and y are vectors, and alpha and beta are // scalars. func Gbmv(t blas.Transpose, alpha complex128, a Band, x Vector, beta complex128, y Vector) { @@ -226,36 +226,36 @@ func Gbmv(t blas.Transpose, alpha complex128, a Band, x Vector, beta complex128, } // Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular matrix, and x is a vector. func Trmv(t blas.Transpose, a Triangular, x Vector) { cblas128.Ztrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) } // Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular band matrix, and x is a vector. func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { cblas128.Ztbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) } // Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular matrix in packed format, and x is a vector. func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { cblas128.Ztpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) } // Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == blas.ConjTrans, // where 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 @@ -268,9 +268,9 @@ func Trsv(t blas.Transpose, a Triangular, x Vector) { } // Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == blas.ConjTrans, // where A is an n×n triangular band matrix, and x is a vector. // // At entry to the function, x contains the values of b, and the result is @@ -283,9 +283,9 @@ func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { } // Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == 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 @@ -322,28 +322,28 @@ func Hpmv(alpha complex128, a HermitianPacked, x Vector, beta complex128, y Vect } // Geru performs a rank-1 update -// A += alpha * x * y^T, +// A += alpha * x * yᵀ, // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Geru(alpha complex128, x, y Vector, a General) { cblas128.Zgeru(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Gerc performs a rank-1 update -// A += alpha * x * y^H, +// A += alpha * x * yᴴ, // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Gerc(alpha complex128, x, y Vector, a General) { cblas128.Zgerc(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Her performs a rank-1 update -// A += alpha * x * y^T, +// A += alpha * x * yᵀ, // where A is an m×n Hermitian matrix, x and y are vectors, and alpha is a scalar. func Her(alpha float64, x Vector, a Hermitian) { cblas128.Zher(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) } // Hpr performs a rank-1 update -// A += alpha * x * x^H, +// A += alpha * x * xᴴ, // where A is an n×n Hermitian matrix in packed format, x is a vector, and // alpha is a scalar. func Hpr(alpha float64, x Vector, a HermitianPacked) { @@ -351,14 +351,14 @@ func Hpr(alpha float64, x Vector, a HermitianPacked) { } // Her2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, // where A is an n×n Hermitian matrix, x and y are vectors, and alpha is a scalar. func Her2(alpha complex128, x, y Vector, a Hermitian) { cblas128.Zher2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Hpr2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, // where A is an n×n Hermitian matrix in packed format, x and y are vectors, // and alpha is a scalar. func Hpr2(alpha complex128, x, y Vector, a HermitianPacked) { @@ -387,8 +387,8 @@ func Gemm(tA, tB blas.Transpose, alpha complex128, a, b General, beta complex128 } // Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// 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 and beta are scalars. func Symm(s blas.Side, alpha complex128, a Symmetric, b General, beta complex128, c General) { @@ -402,8 +402,8 @@ func Symm(s blas.Side, alpha complex128, a Symmetric, b General, beta complex128 } // Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans, +// C = alpha * A * Aᵀ + beta * C if t == blas.NoTrans, +// C = alpha * Aᵀ * A + beta * C if t == blas.Trans, // 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 Syrk(t blas.Transpose, alpha complex128, a General, beta complex128, c Symmetric) { @@ -417,8 +417,8 @@ func Syrk(t blas.Transpose, alpha complex128, a General, beta complex128, c Symm } // Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans, +// 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, // where C is an n×n symmetric matrix, A and B are n×k matrices if // t == blas.NoTrans and k×n otherwise, and alpha and beta are scalars. func Syr2k(t blas.Transpose, alpha complex128, a, b General, beta complex128, c Symmetric) { @@ -432,12 +432,12 @@ func Syr2k(t blas.Transpose, alpha complex128, a, b General, beta complex128, c } // Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans and s == blas.Left, -// B = alpha * A^H * B, if tA == blas.ConjTrans and s == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans and s == blas.Right, -// B = alpha * B * A^H, if tA == blas.ConjTrans and s == blas.Right, +// B = alpha * A * B if tA == blas.NoTrans and s == blas.Left, +// B = alpha * Aᵀ * B if tA == blas.Trans and s == blas.Left, +// B = alpha * Aᴴ * B if tA == 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 and s == blas.Right, +// B = alpha * B * Aᴴ if tA == 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 Trmm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b General) { @@ -445,12 +445,12 @@ func Trmm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b Gene } // Trsm solves -// A * X = alpha * B, if tA == blas.NoTrans and s == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans and s == blas.Left, -// A^H * X = alpha * B, if tA == blas.ConjTrans and s == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans and s == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans and s == blas.Right, -// X * A^H = alpha * B, if tA == blas.ConjTrans and s == blas.Right, +// A * X = alpha * B if tA == blas.NoTrans and s == blas.Left, +// Aᵀ * X = alpha * B if tA == blas.Trans and s == blas.Left, +// Aᴴ * X = alpha * B if tA == 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 and s == blas.Right, +// X * Aᴴ = alpha * B if tA == 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. // @@ -463,8 +463,8 @@ func Trsm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b Gene } // Hemm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// 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 Hermitian matrix, B and C are m×n matrices, and // alpha and beta are scalars. func Hemm(s blas.Side, alpha complex128, a Hermitian, b General, beta complex128, c General) { @@ -478,8 +478,8 @@ func Hemm(s blas.Side, alpha complex128, a Hermitian, b General, beta complex128 } // Herk performs the Hermitian rank-k update -// C = alpha * A * A^H + beta*C, if t == blas.NoTrans, -// C = alpha * A^H * A + beta*C, if t == blas.ConjTrans, +// C = alpha * A * Aᴴ + beta*C if t == blas.NoTrans, +// C = alpha * Aᴴ * A + beta*C if t == blas.ConjTrans, // where C is an n×n Hermitian matrix, A is an n×k matrix if t == blas.NoTrans // and a k×n matrix otherwise, and alpha and beta are scalars. func Herk(t blas.Transpose, alpha float64, a General, beta float64, c Hermitian) { @@ -493,8 +493,8 @@ func Herk(t blas.Transpose, alpha float64, a General, beta float64, c Hermitian) } // Her2k performs the Hermitian rank-2k update -// C = alpha * A * B^H + conj(alpha) * B * A^H + beta * C, if t == blas.NoTrans, -// C = alpha * A^H * B + conj(alpha) * B^H * A + beta * C, if t == blas.ConjTrans, +// C = alpha * A * Bᴴ + conj(alpha) * B * Aᴴ + beta * C if t == blas.NoTrans, +// C = alpha * Aᴴ * B + conj(alpha) * Bᴴ * A + beta * C if t == blas.ConjTrans, // where C is an n×n Hermitian matrix, A and B are n×k matrices if t == NoTrans // and k×n matrices otherwise, and alpha and beta are scalars. func Her2k(t blas.Transpose, alpha complex128, a, b General, beta float64, c Hermitian) { diff --git a/blas/cblas64/cblas64.go b/blas/cblas64/cblas64.go index 042a7dab..7b50f52d 100644 --- a/blas/cblas64/cblas64.go +++ b/blas/cblas64/cblas64.go @@ -111,14 +111,14 @@ const negInc = "cblas64: negative vector increment" // Dotu computes the dot product of the two vectors without // complex conjugation: -// x^T * y +// xᵀ * y func Dotu(n int, x, y Vector) complex64 { return cblas64.Cdotu(n, x.Data, x.Inc, y.Data, y.Inc) } // Dotc computes the dot product of the two vectors with // complex conjugation: -// x^H * y. +// xᴴ * y. func Dotc(n int, x, y Vector) complex64 { return cblas64.Cdotc(n, x.Data, x.Inc, y.Data, y.Inc) } @@ -206,9 +206,9 @@ func Dscal(n int, alpha float32, x Vector) { // Level 2 // Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, +// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, // where A is an m×n dense matrix, x and y are vectors, and alpha and beta are // scalars. func Gemv(t blas.Transpose, alpha complex64, a General, x Vector, beta complex64, y Vector) { @@ -216,9 +216,9 @@ func Gemv(t blas.Transpose, alpha complex64, a General, x Vector, beta complex64 } // Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, +// y = alpha * A * x + beta * y if t == blas.NoTrans, +// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, +// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, // where A is an m×n band matrix, x and y are vectors, and alpha and beta are // scalars. func Gbmv(t blas.Transpose, alpha complex64, a Band, x Vector, beta complex64, y Vector) { @@ -226,36 +226,36 @@ func Gbmv(t blas.Transpose, alpha complex64, a Band, x Vector, beta complex64, y } // Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular matrix, and x is a vector. func Trmv(t blas.Transpose, a Triangular, x Vector) { cblas64.Ctrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) } // Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular band matrix, and x is a vector. func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { cblas64.Ctbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) } // Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, +// x = A * x if t == blas.NoTrans, +// x = Aᵀ * x if t == blas.Trans, +// x = Aᴴ * x if t == blas.ConjTrans, // where A is an n×n triangular matrix in packed format, and x is a vector. func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { cblas64.Ctpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) } // Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == blas.ConjTrans, // where 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 @@ -268,9 +268,9 @@ func Trsv(t blas.Transpose, a Triangular, x Vector) { } // Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == blas.ConjTrans, // where A is an n×n triangular band matrix, and x is a vector. // // At entry to the function, x contains the values of b, and the result is @@ -283,9 +283,9 @@ func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { } // Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, +// A * x = b if t == blas.NoTrans, +// Aᵀ * x = b if t == blas.Trans, +// Aᴴ * x = b if t == 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 @@ -322,28 +322,28 @@ func Hpmv(alpha complex64, a HermitianPacked, x Vector, beta complex64, y Vector } // Geru performs a rank-1 update -// A += alpha * x * y^T, +// A += alpha * x * yᵀ, // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Geru(alpha complex64, x, y Vector, a General) { cblas64.Cgeru(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Gerc performs a rank-1 update -// A += alpha * x * y^H, +// A += alpha * x * yᴴ, // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Gerc(alpha complex64, x, y Vector, a General) { cblas64.Cgerc(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Her performs a rank-1 update -// A += alpha * x * y^T, +// A += alpha * x * yᵀ, // where A is an m×n Hermitian matrix, x and y are vectors, and alpha is a scalar. func Her(alpha float32, x Vector, a Hermitian) { cblas64.Cher(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) } // Hpr performs a rank-1 update -// A += alpha * x * x^H, +// A += alpha * x * xᴴ, // where A is an n×n Hermitian matrix in packed format, x is a vector, and // alpha is a scalar. func Hpr(alpha float32, x Vector, a HermitianPacked) { @@ -351,14 +351,14 @@ func Hpr(alpha float32, x Vector, a HermitianPacked) { } // Her2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, // where A is an n×n Hermitian matrix, x and y are vectors, and alpha is a scalar. func Her2(alpha complex64, x, y Vector, a Hermitian) { cblas64.Cher2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) } // Hpr2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, // where A is an n×n Hermitian matrix in packed format, x and y are vectors, // and alpha is a scalar. func Hpr2(alpha complex64, x, y Vector, a HermitianPacked) { @@ -387,8 +387,8 @@ func Gemm(tA, tB blas.Transpose, alpha complex64, a, b General, beta complex64, } // Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// 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 and beta are scalars. func Symm(s blas.Side, alpha complex64, a Symmetric, b General, beta complex64, c General) { @@ -402,8 +402,8 @@ func Symm(s blas.Side, alpha complex64, a Symmetric, b General, beta complex64, } // Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans, +// C = alpha * A * Aᵀ + beta * C if t == blas.NoTrans, +// C = alpha * Aᵀ * A + beta * C if t == blas.Trans, // 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 Syrk(t blas.Transpose, alpha complex64, a General, beta complex64, c Symmetric) { @@ -417,8 +417,8 @@ func Syrk(t blas.Transpose, alpha complex64, a General, beta complex64, c Symmet } // Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans, +// 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, // where C is an n×n symmetric matrix, A and B are n×k matrices if // t == blas.NoTrans and k×n otherwise, and alpha and beta are scalars. func Syr2k(t blas.Transpose, alpha complex64, a, b General, beta complex64, c Symmetric) { @@ -432,12 +432,12 @@ func Syr2k(t blas.Transpose, alpha complex64, a, b General, beta complex64, c Sy } // Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans and s == blas.Left, -// B = alpha * A^H * B, if tA == blas.ConjTrans and s == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans and s == blas.Right, -// B = alpha * B * A^H, if tA == blas.ConjTrans and s == blas.Right, +// B = alpha * A * B if tA == blas.NoTrans and s == blas.Left, +// B = alpha * Aᵀ * B if tA == blas.Trans and s == blas.Left, +// B = alpha * Aᴴ * B if tA == 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 and s == blas.Right, +// B = alpha * B * Aᴴ if tA == 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 Trmm(s blas.Side, tA blas.Transpose, alpha complex64, a Triangular, b General) { @@ -445,12 +445,12 @@ func Trmm(s blas.Side, tA blas.Transpose, alpha complex64, a Triangular, b Gener } // Trsm solves -// A * X = alpha * B, if tA == blas.NoTrans and s == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans and s == blas.Left, -// A^H * X = alpha * B, if tA == blas.ConjTrans and s == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans and s == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans and s == blas.Right, -// X * A^H = alpha * B, if tA == blas.ConjTrans and s == blas.Right, +// A * X = alpha * B if tA == blas.NoTrans and s == blas.Left, +// Aᵀ * X = alpha * B if tA == blas.Trans and s == blas.Left, +// Aᴴ * X = alpha * B if tA == 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 and s == blas.Right, +// X * Aᴴ = alpha * B if tA == 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. // @@ -463,8 +463,8 @@ func Trsm(s blas.Side, tA blas.Transpose, alpha complex64, a Triangular, b Gener } // Hemm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, +// 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 Hermitian matrix, B and C are m×n matrices, and // alpha and beta are scalars. func Hemm(s blas.Side, alpha complex64, a Hermitian, b General, beta complex64, c General) { @@ -478,8 +478,8 @@ func Hemm(s blas.Side, alpha complex64, a Hermitian, b General, beta complex64, } // Herk performs the Hermitian rank-k update -// C = alpha * A * A^H + beta*C, if t == blas.NoTrans, -// C = alpha * A^H * A + beta*C, if t == blas.ConjTrans, +// C = alpha * A * Aᴴ + beta*C if t == blas.NoTrans, +// C = alpha * Aᴴ * A + beta*C if t == blas.ConjTrans, // where C is an n×n Hermitian matrix, A is an n×k matrix if t == blas.NoTrans // and a k×n matrix otherwise, and alpha and beta are scalars. func Herk(t blas.Transpose, alpha float32, a General, beta float32, c Hermitian) { @@ -493,8 +493,8 @@ func Herk(t blas.Transpose, alpha float32, a General, beta float32, c Hermitian) } // Her2k performs the Hermitian rank-2k update -// C = alpha * A * B^H + conj(alpha) * B * A^H + beta * C, if t == blas.NoTrans, -// C = alpha * A^H * B + conj(alpha) * B^H * A + beta * C, if t == blas.ConjTrans, +// C = alpha * A * Bᴴ + conj(alpha) * B * Aᴴ + beta * C if t == blas.NoTrans, +// C = alpha * Aᴴ * B + conj(alpha) * Bᴴ * A + beta * C if t == blas.ConjTrans, // where C is an n×n Hermitian matrix, A and B are n×k matrices if t == NoTrans // and k×n matrices otherwise, and alpha and beta are scalars. func Her2k(t blas.Transpose, alpha complex64, a, b General, beta float32, c Hermitian) { diff --git a/blas/gonum/dgemm.go b/blas/gonum/dgemm.go index ec3fcc61..167dd27c 100644 --- a/blas/gonum/dgemm.go +++ b/blas/gonum/dgemm.go @@ -14,9 +14,9 @@ import ( // Dgemm performs one of the matrix-matrix operations // C = alpha * A * B + beta * C -// C = alpha * A^T * B + beta * C -// C = alpha * A * B^T + beta * C -// C = alpha * A^T * B^T + 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. @@ -134,9 +134,9 @@ func dgemmParallel(aTrans, bTrans bool, m, n, k int, a []float64, lda int, b []f // In all cases, there is one dimension for each matrix along which // C must be updated sequentially. // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (A^T * B) - // Cij = \sum_k Aik Bjk, (A * B^T) - // Cij = \sum_k Aki Bjk, (A^T * B^T) + // Cij = \sum_k Aki Bkj, (Aᵀ * B) + // Cij = \sum_k Aik Bjk, (A * Bᵀ) + // Cij = \sum_k Aki Bjk, (Aᵀ * Bᵀ) // // This code computes one {i, j} block sequentially along the k dimension, // and computes all of the {i, j} blocks concurrently. This diff --git a/blas/gonum/gemv.go b/blas/gonum/gemv.go index 9b9a1beb..8bc3bf66 100644 --- a/blas/gonum/gemv.go +++ b/blas/gonum/gemv.go @@ -13,8 +13,8 @@ import ( // TODO(Kunde21): Merge these methods back into level2double/level2single when Sgemv assembly kernels are merged into f32. // Dgemv 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 +// y = alpha * A * x + beta * y if tA = blas.NoTrans +// y = alpha * Aᵀ * 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 and beta are scalars. func (Implementation) Dgemv(tA blas.Transpose, m, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { @@ -83,8 +83,8 @@ func (Implementation) Dgemv(tA blas.Transpose, m, n int, alpha float64, a []floa } // Sgemv 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 +// y = alpha * A * x + beta * y if tA = blas.NoTrans +// y = alpha * Aᵀ * 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 and beta are scalars. // // Float32 implementations are autogenerated and not directly tested. diff --git a/blas/gonum/level1cmplx128.go b/blas/gonum/level1cmplx128.go index e37bf44d..a207db4b 100644 --- a/blas/gonum/level1cmplx128.go +++ b/blas/gonum/level1cmplx128.go @@ -240,7 +240,7 @@ func (Implementation) Zcopy(n int, x []complex128, incX int, y []complex128, inc } // Zdotc computes the dot product -// x^H · y +// xᴴ · y // of two complex vectors x and y. func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) complex128 { if incX == 0 { @@ -281,7 +281,7 @@ func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, inc } // Zdotu computes the dot product -// x^T · y +// xᵀ · y // of two complex vectors x and y. func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) complex128 { if incX == 0 { diff --git a/blas/gonum/level1cmplx64.go b/blas/gonum/level1cmplx64.go index ba192ea5..018bae21 100644 --- a/blas/gonum/level1cmplx64.go +++ b/blas/gonum/level1cmplx64.go @@ -252,7 +252,7 @@ func (Implementation) Ccopy(n int, x []complex64, incX int, y []complex64, incY } // Cdotc computes the dot product -// x^H · y +// xᴴ · y // of two complex vectors x and y. // // Complex64 implementations are autogenerated and not directly tested. @@ -295,7 +295,7 @@ func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY } // Cdotu computes the dot product -// x^T · y +// xᵀ · y // of two complex vectors x and y. // // Complex64 implementations are autogenerated and not directly tested. diff --git a/blas/gonum/level2cmplx128.go b/blas/gonum/level2cmplx128.go index 03ee328f..d0ca4eb9 100644 --- a/blas/gonum/level2cmplx128.go +++ b/blas/gonum/level2cmplx128.go @@ -14,9 +14,9 @@ import ( var _ blas.Complex128Level2 = Implementation{} // Zgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans // where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix // with kL sub-diagonals and kU super-diagonals. func (Implementation) Zgbmv(trans blas.Transpose, m, n, kL, kU int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { @@ -209,9 +209,9 @@ func (Implementation) Zgbmv(trans blas.Transpose, m, n, kL, kU int, alpha comple } // Zgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans // where alpha and beta are scalars, x and y are vectors, and A is an m×n dense matrix. func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { switch trans { @@ -322,7 +322,7 @@ func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a return case blas.Trans: - // Form y = alpha*A^T*x + y. + // Form y = alpha*Aᵀ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -338,7 +338,7 @@ func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a return case blas.ConjTrans: - // Form y = alpha*A^H*x + y. + // Form y = alpha*Aᴴ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -364,7 +364,7 @@ func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a } // Zgerc performs the rank-one operation -// A += alpha * x * y^H +// A += alpha * x * yᴴ // where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, // and y is an n element vector. func (Implementation) Zgerc(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { @@ -422,7 +422,7 @@ func (Implementation) Zgerc(m, n int, alpha complex128, x []complex128, incX int } // Zgeru performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, // and y is an n element vector. func (Implementation) Zgeru(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { @@ -822,7 +822,7 @@ func (Implementation) Zhemv(uplo blas.Uplo, n int, alpha complex128, a []complex } // Zher performs the Hermitian rank-one operation -// A += alpha * x * x^H +// A += alpha * x * xᴴ // where A is an n×n Hermitian matrix, alpha is a real scalar, and x is an n // element vector. On entry, the imaginary parts of the diagonal elements of A // are ignored and assumed to be zero, on return they will be set to zero. @@ -944,7 +944,7 @@ func (Implementation) Zher(uplo blas.Uplo, n int, alpha float64, x []complex128, } // Zher2 performs the Hermitian rank-two operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ // where alpha is a scalar, x and y are n element vectors and A is an n×n // Hermitian matrix. On entry, the imaginary parts of the diagonal elements are // ignored and assumed to be zero. On return they will be set to zero. @@ -1248,7 +1248,7 @@ func (Implementation) Zhpmv(uplo blas.Uplo, n int, alpha complex128, ap []comple } // Zhpr performs the Hermitian rank-1 operation -// A += alpha * x * x^H +// A += alpha * x * xᴴ // where alpha is a real scalar, x is a vector, and A is an n×n hermitian matrix // in packed form. On entry, the imaginary parts of the diagonal elements are // assumed to be zero, and on return they are set to zero. @@ -1382,7 +1382,7 @@ func (Implementation) Zhpr(uplo blas.Uplo, n int, alpha float64, x []complex128, } // Zhpr2 performs the Hermitian rank-2 operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ // where alpha is a complex scalar, x and y are n element vectors, and A is an // n×n Hermitian matrix, supplied in packed form. On entry, the imaginary parts // of the diagonal elements are assumed to be zero, and on return they are set to zero. @@ -1529,9 +1529,9 @@ func (Implementation) Zhpr2(uplo blas.Uplo, n int, alpha complex128, x []complex } // Ztbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans // where x is an n element vector and A is an n×n triangular band matrix, with // (k+1) diagonals. func (Implementation) Ztbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { @@ -1765,9 +1765,9 @@ func (Implementation) Ztbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans // where b and x are n element vectors and A is an n×n triangular band matrix // with (k+1) diagonals. // @@ -2007,9 +2007,9 @@ func (Implementation) Ztbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans // where x is an n element vector and A is an n×n triangular matrix, supplied in // packed form. func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex128, x []complex128, incX int) { @@ -2116,7 +2116,7 @@ func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2176,7 +2176,7 @@ func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2245,9 +2245,9 @@ func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans // where b and x are n element vectors and A is an n×n triangular matrix in // packed form. // @@ -2359,7 +2359,7 @@ func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2414,7 +2414,7 @@ func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2481,9 +2481,9 @@ func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans // where x is a vector, and A is an n×n triangular matrix. func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { switch trans { @@ -2583,7 +2583,7 @@ func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2634,7 +2634,7 @@ func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2689,9 +2689,9 @@ func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ztrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans // where b and x are n element vectors and A is an n×n triangular matrix. // // On entry, x contains the values of b, and the solution is @@ -2799,7 +2799,7 @@ func (Implementation) Ztrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { @@ -2849,7 +2849,7 @@ func (Implementation) Ztrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { diff --git a/blas/gonum/level2cmplx64.go b/blas/gonum/level2cmplx64.go index 10faf8f7..3aa4c21c 100644 --- a/blas/gonum/level2cmplx64.go +++ b/blas/gonum/level2cmplx64.go @@ -16,9 +16,9 @@ import ( var _ blas.Complex64Level2 = Implementation{} // Cgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans // where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix // with kL sub-diagonals and kU super-diagonals. // @@ -213,9 +213,9 @@ func (Implementation) Cgbmv(trans blas.Transpose, m, n, kL, kU int, alpha comple } // Cgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans +// y = alpha * A * x + beta * y if trans = blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans +// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans // where alpha and beta are scalars, x and y are vectors, and A is an m×n dense matrix. // // Complex64 implementations are autogenerated and not directly tested. @@ -328,7 +328,7 @@ func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a [ return case blas.Trans: - // Form y = alpha*A^T*x + y. + // Form y = alpha*Aᵀ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -344,7 +344,7 @@ func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a [ return case blas.ConjTrans: - // Form y = alpha*A^H*x + y. + // Form y = alpha*Aᴴ*x + y. ix := kx if incY == 1 { for i := 0; i < m; i++ { @@ -370,7 +370,7 @@ func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a [ } // Cgerc performs the rank-one operation -// A += alpha * x * y^H +// A += alpha * x * yᴴ // where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, // and y is an n element vector. // @@ -430,7 +430,7 @@ func (Implementation) Cgerc(m, n int, alpha complex64, x []complex64, incX int, } // Cgeru performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, // and y is an n element vector. // @@ -836,7 +836,7 @@ func (Implementation) Chemv(uplo blas.Uplo, n int, alpha complex64, a []complex6 } // Cher performs the Hermitian rank-one operation -// A += alpha * x * x^H +// A += alpha * x * xᴴ // where A is an n×n Hermitian matrix, alpha is a real scalar, and x is an n // element vector. On entry, the imaginary parts of the diagonal elements of A // are ignored and assumed to be zero, on return they will be set to zero. @@ -960,7 +960,7 @@ func (Implementation) Cher(uplo blas.Uplo, n int, alpha float32, x []complex64, } // Cher2 performs the Hermitian rank-two operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ // where alpha is a scalar, x and y are n element vectors and A is an n×n // Hermitian matrix. On entry, the imaginary parts of the diagonal elements are // ignored and assumed to be zero. On return they will be set to zero. @@ -1268,7 +1268,7 @@ func (Implementation) Chpmv(uplo blas.Uplo, n int, alpha complex64, ap []complex } // Chpr performs the Hermitian rank-1 operation -// A += alpha * x * x^H +// A += alpha * x * xᴴ // where alpha is a real scalar, x is a vector, and A is an n×n hermitian matrix // in packed form. On entry, the imaginary parts of the diagonal elements are // assumed to be zero, and on return they are set to zero. @@ -1404,7 +1404,7 @@ func (Implementation) Chpr(uplo blas.Uplo, n int, alpha float32, x []complex64, } // Chpr2 performs the Hermitian rank-2 operation -// A += alpha * x * y^H + conj(alpha) * y * x^H +// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ // where alpha is a complex scalar, x and y are n element vectors, and A is an // n×n Hermitian matrix, supplied in packed form. On entry, the imaginary parts // of the diagonal elements are assumed to be zero, and on return they are set to zero. @@ -1553,9 +1553,9 @@ func (Implementation) Chpr2(uplo blas.Uplo, n int, alpha complex64, x []complex6 } // Ctbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans // where x is an n element vector and A is an n×n triangular band matrix, with // (k+1) diagonals. // @@ -1791,9 +1791,9 @@ func (Implementation) Ctbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans // where b and x are n element vectors and A is an n×n triangular band matrix // with (k+1) diagonals. // @@ -2035,9 +2035,9 @@ func (Implementation) Ctbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans // where x is an n element vector and A is an n×n triangular matrix, supplied in // packed form. // @@ -2146,7 +2146,7 @@ func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2206,7 +2206,7 @@ func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { // kk points to the current diagonal element in ap. kk := n*(n+1)/2 - 1 @@ -2275,9 +2275,9 @@ func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans // where b and x are n element vectors and A is an n×n triangular matrix in // packed form. // @@ -2391,7 +2391,7 @@ func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2446,7 +2446,7 @@ func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { kk := 0 if incX == 1 { @@ -2513,9 +2513,9 @@ func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans +// x = A * x if trans = blas.NoTrans +// x = Aᵀ * x if trans = blas.Trans +// x = Aᴴ * x if trans = blas.ConjTrans // where x is a vector, and A is an n×n triangular matrix. // // Complex64 implementations are autogenerated and not directly tested. @@ -2617,7 +2617,7 @@ func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = A^T*x. + // Form x = Aᵀ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2668,7 +2668,7 @@ func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = A^H*x. + // Form x = Aᴴ*x. if uplo == blas.Upper { if incX == 1 { for i := n - 1; i >= 0; i-- { @@ -2723,9 +2723,9 @@ func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } // Ctrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans +// A * x = b if trans == blas.NoTrans +// Aᵀ * x = b if trans == blas.Trans +// Aᴴ * x = b if trans == blas.ConjTrans // where b and x are n element vectors and A is an n×n triangular matrix. // // On entry, x contains the values of b, and the solution is @@ -2835,7 +2835,7 @@ func (Implementation) Ctrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag } if trans == blas.Trans { - // Form x = inv(A^T)*x. + // Form x = inv(Aᵀ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { @@ -2885,7 +2885,7 @@ func (Implementation) Ctrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag return } - // Form x = inv(A^H)*x. + // Form x = inv(Aᴴ)*x. if uplo == blas.Upper { if incX == 1 { for j := 0; j < n; j++ { diff --git a/blas/gonum/level2float32.go b/blas/gonum/level2float32.go index 08e1927f..d37a0b17 100644 --- a/blas/gonum/level2float32.go +++ b/blas/gonum/level2float32.go @@ -14,7 +14,7 @@ import ( var _ blas.Float32Level2 = Implementation{} // Sger performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. // // Float32 implementations are autogenerated and not directly tested. @@ -63,8 +63,8 @@ func (Implementation) Sger(m, n int, alpha float32, x []float32, incX int, y []f } // Sgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * A^T * x + beta * y if tA == blas.Trans or blas.ConjTrans +// y = alpha * A * x + beta * y if tA == blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if tA == blas.Trans or blas.ConjTrans // where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, // x and y are vectors, and alpha and beta are scalars. // @@ -230,8 +230,8 @@ func (Implementation) Sgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float32, } // Strmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans // where A is an n×n triangular matrix, and x is a vector. // // Float32 implementations are autogenerated and not directly tested. @@ -384,8 +384,8 @@ func (Implementation) Strmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Strsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == 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 @@ -737,8 +737,8 @@ func (Implementation) Ssymv(ul blas.Uplo, n int, alpha float32, a []float32, lda } // Stbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans // where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. // // Float32 implementations are autogenerated and not directly tested. @@ -948,8 +948,8 @@ func (Implementation) Stbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i } // Stpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans // where A is an n×n triangular matrix in packed format, and x is a vector. // // Float32 implementations are autogenerated and not directly tested. @@ -1129,8 +1129,8 @@ func (Implementation) Stpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Stbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or tA == blas.ConjTrans +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or tA == blas.ConjTrans // where A is an n×n triangular band matrix with k+1 diagonals, // and x and b are vectors. // @@ -1525,7 +1525,7 @@ func (Implementation) Ssbmv(ul blas.Uplo, n, k int, alpha float32, a []float32, } // Ssyr performs the symmetric rank-one update -// A += alpha * x * x^T +// A += alpha * x * xᵀ // where A is an n×n symmetric matrix, and x is a vector. // // Float32 implementations are autogenerated and not directly tested. @@ -1625,7 +1625,7 @@ func (Implementation) Ssyr(ul blas.Uplo, n int, alpha float32, x []float32, incX } // Ssyr2 performs the symmetric rank-two update -// A += alpha * x * y^T + alpha * y * x^T +// A += alpha * x * yᵀ + alpha * y * xᵀ // where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. // // Float32 implementations are autogenerated and not directly tested. @@ -1734,8 +1734,8 @@ func (Implementation) Ssyr2(ul blas.Uplo, n int, alpha float32, x []float32, inc } // Stpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == 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 @@ -2089,7 +2089,7 @@ func (Implementation) Sspmv(ul blas.Uplo, n int, alpha float32, ap []float32, x } // Sspr performs the symmetric rank-one operation -// A += alpha * x * x^T +// A += alpha * x * xᵀ // where A is an n×n symmetric matrix in packed format, x is a vector, and // alpha is a scalar. // @@ -2183,7 +2183,7 @@ func (Implementation) Sspr(ul blas.Uplo, n int, alpha float32, x []float32, incX } // Sspr2 performs the symmetric rank-2 update -// A += alpha * x * y^T + alpha * y * x^T +// 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. // diff --git a/blas/gonum/level2float64.go b/blas/gonum/level2float64.go index 26125788..725efca5 100644 --- a/blas/gonum/level2float64.go +++ b/blas/gonum/level2float64.go @@ -12,7 +12,7 @@ import ( var _ blas.Float64Level2 = Implementation{} // Dger performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func (Implementation) Dger(m, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { if m < 0 { @@ -59,8 +59,8 @@ func (Implementation) Dger(m, n int, alpha float64, x []float64, incX int, y []f } // Dgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * A^T * x + beta * y if tA == blas.Trans or blas.ConjTrans +// y = alpha * A * x + beta * y if tA == blas.NoTrans +// y = alpha * Aᵀ * x + beta * y if tA == blas.Trans or blas.ConjTrans // where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, // x and y are vectors, and alpha and beta are scalars. func (Implementation) Dgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { @@ -224,8 +224,8 @@ func (Implementation) Dgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float64, } // Dtrmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans // where A is an n×n triangular matrix, and x is a vector. func (Implementation) Dtrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float64, lda int, x []float64, incX int) { if ul != blas.Lower && ul != blas.Upper { @@ -376,8 +376,8 @@ func (Implementation) Dtrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Dtrsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == 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 @@ -725,8 +725,8 @@ func (Implementation) Dsymv(ul blas.Uplo, n int, alpha float64, a []float64, lda } // Dtbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans // where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. func (Implementation) Dtbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float64, lda int, x []float64, incX int) { if ul != blas.Lower && ul != blas.Upper { @@ -934,8 +934,8 @@ func (Implementation) Dtbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k i } // Dtpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans +// x = A * x if tA == blas.NoTrans +// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans // where A is an n×n triangular matrix in packed format, and x is a vector. func (Implementation) Dtpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float64, x []float64, incX int) { if ul != blas.Lower && ul != blas.Upper { @@ -1113,8 +1113,8 @@ func (Implementation) Dtpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, } // Dtbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or tA == blas.ConjTrans +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == blas.Trans or tA == blas.ConjTrans // where A is an n×n triangular band matrix with k+1 diagonals, // and x and b are vectors. // @@ -1505,7 +1505,7 @@ func (Implementation) Dsbmv(ul blas.Uplo, n, k int, alpha float64, a []float64, } // Dsyr performs the symmetric rank-one update -// A += alpha * x * x^T +// A += alpha * x * xᵀ // where A is an n×n symmetric matrix, and x is a vector. func (Implementation) Dsyr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, a []float64, lda int) { if ul != blas.Lower && ul != blas.Upper { @@ -1603,7 +1603,7 @@ func (Implementation) Dsyr(ul blas.Uplo, n int, alpha float64, x []float64, incX } // Dsyr2 performs the symmetric rank-two update -// A += alpha * x * y^T + alpha * y * x^T +// A += alpha * x * yᵀ + alpha * y * xᵀ // where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. func (Implementation) Dsyr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { if ul != blas.Lower && ul != blas.Upper { @@ -1710,8 +1710,8 @@ func (Implementation) Dsyr2(ul blas.Uplo, n int, alpha float64, x []float64, inc } // Dtpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans +// A * x = b if tA == blas.NoTrans +// Aᵀ * x = b if tA == 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 @@ -2061,7 +2061,7 @@ func (Implementation) Dspmv(ul blas.Uplo, n int, alpha float64, ap []float64, x } // Dspr performs the symmetric rank-one operation -// A += alpha * x * x^T +// 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 (Implementation) Dspr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, ap []float64) { @@ -2153,7 +2153,7 @@ func (Implementation) Dspr(ul blas.Uplo, n int, alpha float64, x []float64, incX } // Dspr2 performs the symmetric rank-2 update -// A += alpha * x * y^T + alpha * y * x^T +// 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 (Implementation) Dspr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, ap []float64) { diff --git a/blas/gonum/level3cmplx128.go b/blas/gonum/level3cmplx128.go index e4a2bb5e..f2a2b2f5 100644 --- a/blas/gonum/level3cmplx128.go +++ b/blas/gonum/level3cmplx128.go @@ -16,7 +16,7 @@ var _ blas.Complex128Level3 = Implementation{} // Zgemm performs one of the matrix-matrix operations // C = alpha * op(A) * op(B) + beta * C // where op(X) is one of -// op(X) = X or op(X) = X^T or op(X) = X^H, +// op(X) = X or op(X) = Xᵀ or op(X) = Xᴴ, // alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, // op(B) a k×n matrix and C an m×n matrix. func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { @@ -118,7 +118,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.Trans: - // Form C = alpha * A * B^T + beta * C. + // Form C = alpha * A * Bᵀ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -138,7 +138,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.ConjTrans: - // Form C = alpha * A * B^H + beta * C. + // Form C = alpha * A * Bᴴ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -161,7 +161,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 case blas.Trans: switch tB { case blas.NoTrans: - // Form C = alpha * A^T * B + beta * C. + // Form C = alpha * Aᵀ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -176,7 +176,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.Trans: - // Form C = alpha * A^T * B^T + beta * C. + // Form C = alpha * Aᵀ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -191,7 +191,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.ConjTrans: - // Form C = alpha * A^T * B^H + beta * C. + // Form C = alpha * Aᵀ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -209,7 +209,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 case blas.ConjTrans: switch tB { case blas.NoTrans: - // Form C = alpha * A^H * B + beta * C. + // Form C = alpha * Aᴴ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -224,7 +224,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.Trans: - // Form C = alpha * A^H * B^T + beta * C. + // Form C = alpha * Aᴴ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -239,7 +239,7 @@ func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128 } } case blas.ConjTrans: - // Form C = alpha * A^H * B^H + beta * C. + // Form C = alpha * Aᴴ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex128 @@ -405,8 +405,8 @@ func (Implementation) Zhemm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Zherk performs one of the hermitian rank-k operations -// C = alpha*A*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*A + beta*C if trans == blas.ConjTrans +// C = alpha*A*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*A + beta*C if trans == blas.ConjTrans // where alpha and beta are real scalars, C is an n×n hermitian matrix and A is // an n×k matrix in the first case and a k×n matrix in the second case. // @@ -494,7 +494,7 @@ func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph calpha := complex(alpha, 0) if trans == blas.NoTrans { - // Form C = alpha*A*A^H + beta*C. + // Form C = alpha*A*Aᴴ + beta*C. cbeta := complex(beta, 0) if uplo == blas.Upper { for i := 0; i < n; i++ { @@ -553,7 +553,7 @@ func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^H*A + beta*C. + // Form C = alpha*Aᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -603,8 +603,8 @@ func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Zher2k performs one of the hermitian rank-2k operations -// C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C if trans == blas.ConjTrans +// C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C if trans == blas.ConjTrans // where alpha and beta are scalars with beta real, C is an n×n hermitian matrix // and A and B are n×k matrices in the first case and k×n matrices in the second case. // @@ -698,7 +698,7 @@ func (Implementation) Zher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp conjalpha := cmplx.Conj(alpha) cbeta := complex(beta, 0) if trans == blas.NoTrans { - // Form C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C. + // Form C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i+1 : i*ldc+n] @@ -741,7 +741,7 @@ func (Implementation) Zher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C. + // Form C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -943,8 +943,8 @@ func (Implementation) Zsymm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Zsyrk performs one of the symmetric rank-k operations -// C = alpha*A*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*A + beta*C if trans == blas.Trans +// C = alpha*A*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*A + beta*C if trans == blas.Trans // where alpha and beta are scalars, C is an n×n symmetric matrix and A is // an n×k matrix in the first case and a k×n matrix in the second case. func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, beta complex128, c []complex128, ldc int) { @@ -1022,7 +1022,7 @@ func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } if trans == blas.NoTrans { - // Form C = alpha*A*A^T + beta*C. + // Form C = alpha*A*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1042,7 +1042,7 @@ func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^T*A + beta*C. + // Form C = alpha*Aᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1088,8 +1088,8 @@ func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Zsyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*B^T + alpha*B*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*B + alpha*B^T*A + beta*C if trans == blas.Trans +// C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C if trans == blas.Trans // where alpha and beta are scalars, C is an n×n symmetric matrix and A and B // are n×k matrices in the first case and k×n matrices in the second case. func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { @@ -1172,7 +1172,7 @@ func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } if trans == blas.NoTrans { - // Form C = alpha*A*B^T + alpha*B*A^T + beta*C. + // Form C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1207,7 +1207,7 @@ func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^T*B + alpha*B^T*A + beta*C. + // Form C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1265,9 +1265,9 @@ func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp // B = alpha * B * op(A) if side == blas.Right, // where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, // upper or lower triangular matrix and op(A) is one of -// op(A) = A if trans == blas.NoTrans, -// op(A) = A^T if trans == blas.Trans, -// op(A) = A^H if trans == blas.ConjTrans. +// op(A) = A if trans == blas.NoTrans, +// op(A) = Aᵀ if trans == blas.Trans, +// op(A) = Aᴴ if trans == blas.ConjTrans. func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { na := m if side == blas.Right { @@ -1356,7 +1356,7 @@ func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*A^T*B or B = alpha*A^H*B. + // Form B = alpha*Aᵀ*B or B = alpha*Aᴴ*B. if uplo == blas.Upper { for k := m - 1; k >= 0; k-- { bk := b[k*ldb : k*ldb+n] @@ -1445,7 +1445,7 @@ func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*B*A^T or B = alpha*B*A^H. + // Form B = alpha*B*Aᵀ or B = alpha*B*Aᴴ. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1493,9 +1493,9 @@ func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose // X * op(A) = alpha * B if side == blas.Right, // where alpha is a scalar, X and B are m×n matrices, A is a unit or // non-unit, upper or lower triangular matrix and op(A) is one of -// op(A) = A if transA == blas.NoTrans, -// op(A) = A^T if transA == blas.Trans, -// op(A) = A^H if transA == blas.ConjTrans. +// op(A) = A if transA == blas.NoTrans, +// op(A) = Aᵀ if transA == blas.Trans, +// op(A) = Aᴴ if transA == blas.ConjTrans. // On return the matrix X is overwritten on B. func (Implementation) Ztrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { na := m @@ -1581,7 +1581,7 @@ func (Implementation) Ztrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*inv(A^T)*B or B = alpha*inv(A^H)*B. + // Form B = alpha*inv(Aᵀ)*B or B = alpha*inv(Aᴴ)*B. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1670,7 +1670,7 @@ func (Implementation) Ztrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*B*inv(A^T) or B = alpha*B*inv(A^H). + // Form B = alpha*B*inv(Aᵀ) or B = alpha*B*inv(Aᴴ). if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] diff --git a/blas/gonum/level3cmplx64.go b/blas/gonum/level3cmplx64.go index 436c5450..570b2af1 100644 --- a/blas/gonum/level3cmplx64.go +++ b/blas/gonum/level3cmplx64.go @@ -18,7 +18,7 @@ var _ blas.Complex64Level3 = Implementation{} // Cgemm performs one of the matrix-matrix operations // C = alpha * op(A) * op(B) + beta * C // where op(X) is one of -// op(X) = X or op(X) = X^T or op(X) = X^H, +// op(X) = X or op(X) = Xᵀ or op(X) = Xᴴ, // alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, // op(B) a k×n matrix and C an m×n matrix. // @@ -122,7 +122,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.Trans: - // Form C = alpha * A * B^T + beta * C. + // Form C = alpha * A * Bᵀ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -142,7 +142,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.ConjTrans: - // Form C = alpha * A * B^H + beta * C. + // Form C = alpha * A * Bᴴ + beta * C. for i := 0; i < m; i++ { switch { case beta == 0: @@ -165,7 +165,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, case blas.Trans: switch tB { case blas.NoTrans: - // Form C = alpha * A^T * B + beta * C. + // Form C = alpha * Aᵀ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -180,7 +180,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.Trans: - // Form C = alpha * A^T * B^T + beta * C. + // Form C = alpha * Aᵀ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -195,7 +195,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.ConjTrans: - // Form C = alpha * A^T * B^H + beta * C. + // Form C = alpha * Aᵀ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -213,7 +213,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, case blas.ConjTrans: switch tB { case blas.NoTrans: - // Form C = alpha * A^H * B + beta * C. + // Form C = alpha * Aᴴ * B + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -228,7 +228,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.Trans: - // Form C = alpha * A^H * B^T + beta * C. + // Form C = alpha * Aᴴ * Bᵀ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -243,7 +243,7 @@ func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, } } case blas.ConjTrans: - // Form C = alpha * A^H * B^H + beta * C. + // Form C = alpha * Aᴴ * Bᴴ + beta * C. for i := 0; i < m; i++ { for j := 0; j < n; j++ { var tmp complex64 @@ -411,8 +411,8 @@ func (Implementation) Chemm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Cherk performs one of the hermitian rank-k operations -// C = alpha*A*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*A + beta*C if trans == blas.ConjTrans +// C = alpha*A*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*A + beta*C if trans == blas.ConjTrans // where alpha and beta are real scalars, C is an n×n hermitian matrix and A is // an n×k matrix in the first case and a k×n matrix in the second case. // @@ -502,7 +502,7 @@ func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph calpha := complex(alpha, 0) if trans == blas.NoTrans { - // Form C = alpha*A*A^H + beta*C. + // Form C = alpha*A*Aᴴ + beta*C. cbeta := complex(beta, 0) if uplo == blas.Upper { for i := 0; i < n; i++ { @@ -561,7 +561,7 @@ func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^H*A + beta*C. + // Form C = alpha*Aᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -611,8 +611,8 @@ func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Cher2k performs one of the hermitian rank-2k operations -// C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C if trans == blas.ConjTrans +// C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C if trans == blas.NoTrans +// C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C if trans == blas.ConjTrans // where alpha and beta are scalars with beta real, C is an n×n hermitian matrix // and A and B are n×k matrices in the first case and k×n matrices in the second case. // @@ -708,7 +708,7 @@ func (Implementation) Cher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp conjalpha := cmplx.Conj(alpha) cbeta := complex(beta, 0) if trans == blas.NoTrans { - // Form C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C. + // Form C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i+1 : i*ldc+n] @@ -751,7 +751,7 @@ func (Implementation) Cher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C. + // Form C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -955,8 +955,8 @@ func (Implementation) Csymm(side blas.Side, uplo blas.Uplo, m, n int, alpha comp } // Csyrk performs one of the symmetric rank-k operations -// C = alpha*A*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*A + beta*C if trans == blas.Trans +// C = alpha*A*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*A + beta*C if trans == blas.Trans // where alpha and beta are scalars, C is an n×n symmetric matrix and A is // an n×k matrix in the first case and a k×n matrix in the second case. // @@ -1036,7 +1036,7 @@ func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } if trans == blas.NoTrans { - // Form C = alpha*A*A^T + beta*C. + // Form C = alpha*A*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1056,7 +1056,7 @@ func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } } } else { - // Form C = alpha*A^T*A + beta*C. + // Form C = alpha*Aᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1102,8 +1102,8 @@ func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alph } // Csyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*B^T + alpha*B*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*B + alpha*B^T*A + beta*C if trans == blas.Trans +// C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C if trans == blas.NoTrans +// C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C if trans == blas.Trans // where alpha and beta are scalars, C is an n×n symmetric matrix and A and B // are n×k matrices in the first case and k×n matrices in the second case. // @@ -1188,7 +1188,7 @@ func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } if trans == blas.NoTrans { - // Form C = alpha*A*B^T + alpha*B*A^T + beta*C. + // Form C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1223,7 +1223,7 @@ func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp } } } else { - // Form C = alpha*A^T*B + alpha*B^T*A + beta*C. + // Form C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C. if uplo == blas.Upper { for i := 0; i < n; i++ { ci := c[i*ldc+i : i*ldc+n] @@ -1281,9 +1281,9 @@ func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alp // B = alpha * B * op(A) if side == blas.Right, // where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, // upper or lower triangular matrix and op(A) is one of -// op(A) = A if trans == blas.NoTrans, -// op(A) = A^T if trans == blas.Trans, -// op(A) = A^H if trans == blas.ConjTrans. +// op(A) = A if trans == blas.NoTrans, +// op(A) = Aᵀ if trans == blas.Trans, +// op(A) = Aᴴ if trans == blas.ConjTrans. // // Complex64 implementations are autogenerated and not directly tested. func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { @@ -1374,7 +1374,7 @@ func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*A^T*B or B = alpha*A^H*B. + // Form B = alpha*Aᵀ*B or B = alpha*Aᴴ*B. if uplo == blas.Upper { for k := m - 1; k >= 0; k-- { bk := b[k*ldb : k*ldb+n] @@ -1463,7 +1463,7 @@ func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose } } } else { - // Form B = alpha*B*A^T or B = alpha*B*A^H. + // Form B = alpha*B*Aᵀ or B = alpha*B*Aᴴ. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1511,9 +1511,9 @@ func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose // X * op(A) = alpha * B if side == blas.Right, // where alpha is a scalar, X and B are m×n matrices, A is a unit or // non-unit, upper or lower triangular matrix and op(A) is one of -// op(A) = A if transA == blas.NoTrans, -// op(A) = A^T if transA == blas.Trans, -// op(A) = A^H if transA == blas.ConjTrans. +// op(A) = A if transA == blas.NoTrans, +// op(A) = Aᵀ if transA == blas.Trans, +// op(A) = Aᴴ if transA == blas.ConjTrans. // On return the matrix X is overwritten on B. // // Complex64 implementations are autogenerated and not directly tested. @@ -1601,7 +1601,7 @@ func (Implementation) Ctrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*inv(A^T)*B or B = alpha*inv(A^H)*B. + // Form B = alpha*inv(Aᵀ)*B or B = alpha*inv(Aᴴ)*B. if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] @@ -1690,7 +1690,7 @@ func (Implementation) Ctrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpos } } } else { - // Form B = alpha*B*inv(A^T) or B = alpha*B*inv(A^H). + // Form B = alpha*B*inv(Aᵀ) or B = alpha*B*inv(Aᴴ). if uplo == blas.Upper { for i := 0; i < m; i++ { bi := b[i*ldb : i*ldb+n] diff --git a/blas/gonum/level3float32.go b/blas/gonum/level3float32.go index 13c4a792..a565b9e8 100644 --- a/blas/gonum/level3float32.go +++ b/blas/gonum/level3float32.go @@ -14,10 +14,10 @@ import ( var _ blas.Float32Level3 = Implementation{} // Strsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and 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 and side == blas.Right -// X * A^T = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left +// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left +// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right +// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == 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. // @@ -362,8 +362,8 @@ func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32, } // Ssyrk performs one of the symmetric rank-k operations -// C = alpha * A * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// C = alpha * A * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans // where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and // beta are scalars. // @@ -514,8 +514,8 @@ func (Implementation) Ssyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha flo } // Ssyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * B^T + alpha * B * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * B + alpha * B^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans // where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and // alpha and beta are scalars. // @@ -678,10 +678,10 @@ func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl } // Strmm performs one of the matrix-matrix operations -// 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 +// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left +// B = alpha * Aᵀ * 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ᵀ if tA == blas.Trans or blas.ConjTrans, and side == blas.Right // where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar. // // Float32 implementations are autogenerated and not directly tested. diff --git a/blas/gonum/level3float64.go b/blas/gonum/level3float64.go index 9eebd906..bf91d14f 100644 --- a/blas/gonum/level3float64.go +++ b/blas/gonum/level3float64.go @@ -12,10 +12,10 @@ import ( var _ blas.Float64Level3 = Implementation{} // Dtrsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and 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 and side == blas.Right -// X * A^T = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right +// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left +// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left +// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right +// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == 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. // @@ -356,8 +356,8 @@ func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64, } // Dsyrk performs one of the symmetric rank-k operations -// C = alpha * A * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// C = alpha * A * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans // where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and // beta are scalars. func (Implementation) Dsyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) { @@ -506,8 +506,8 @@ func (Implementation) Dsyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha flo } // Dsyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * B^T + alpha * B * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * B + alpha * B^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans +// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if tA == blas.NoTrans +// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans // where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and // alpha and beta are scalars. func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { @@ -668,10 +668,10 @@ func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl } // Dtrmm performs one of the matrix-matrix operations -// 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 +// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left +// B = alpha * Aᵀ * 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ᵀ if tA == blas.Trans or blas.ConjTrans, and side == 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 (Implementation) Dtrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) { if s != blas.Left && s != blas.Right { diff --git a/blas/gonum/sgemm.go b/blas/gonum/sgemm.go index e868a105..079b94ce 100644 --- a/blas/gonum/sgemm.go +++ b/blas/gonum/sgemm.go @@ -16,9 +16,9 @@ import ( // Sgemm performs one of the matrix-matrix operations // C = alpha * A * B + beta * C -// C = alpha * A^T * B + beta * C -// C = alpha * A * B^T + beta * C -// C = alpha * A^T * B^T + 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. @@ -138,9 +138,9 @@ func sgemmParallel(aTrans, bTrans bool, m, n, k int, a []float32, lda int, b []f // In all cases, there is one dimension for each matrix along which // C must be updated sequentially. // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (A^T * B) - // Cij = \sum_k Aik Bjk, (A * B^T) - // Cij = \sum_k Aki Bjk, (A^T * B^T) + // Cij = \sum_k Aki Bkj, (Aᵀ * B) + // Cij = \sum_k Aik Bjk, (A * Bᵀ) + // Cij = \sum_k Aki Bjk, (Aᵀ * Bᵀ) // // This code computes one {i, j} block sequentially along the k dimension, // and computes all of the {i, j} blocks concurrently. This diff --git a/blas/testblas/common.go b/blas/testblas/common.go index 508893ac..55c3eac6 100644 --- a/blas/testblas/common.go +++ b/blas/testblas/common.go @@ -547,7 +547,7 @@ func rndComplex128(rnd *rand.Rand) complex128 { // zmm returns the result of one of the matrix-matrix operations // alpha * op(A) * op(B) + beta * C // where op(X) is one of -// op(X) = X or op(X) = X^T or op(X) = X^H, +// op(X) = X or op(X) = Xᵀ or op(X) = Xᴴ, // alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, // op(B) a k×n matrix and C an m×n matrix. // diff --git a/blas/testblas/zher2k.go b/blas/testblas/zher2k.go index 1af98146..d219018c 100644 --- a/blas/testblas/zher2k.go +++ b/blas/testblas/zher2k.go @@ -107,11 +107,11 @@ func zher2kTest(t *testing.T, impl Zher2ker, uplo blas.Uplo, trans blas.Transpos // Compute the expected result using an internal Zgemm implementation. var want []complex128 if trans == blas.NoTrans { - // C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C + // C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C tmp := zmm(blas.NoTrans, blas.ConjTrans, n, n, k, alpha, a, lda, b, ldb, complex(beta, 0), cHer, ldc) want = zmm(blas.NoTrans, blas.ConjTrans, n, n, k, cmplx.Conj(alpha), b, ldb, a, lda, 1, tmp, ldc) } else { - // C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C + // C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C tmp := zmm(blas.ConjTrans, blas.NoTrans, n, n, k, alpha, a, lda, b, ldb, complex(beta, 0), cHer, ldc) want = zmm(blas.ConjTrans, blas.NoTrans, n, n, k, cmplx.Conj(alpha), b, ldb, a, lda, 1, tmp, ldc) } diff --git a/blas/testblas/zsyr2k.go b/blas/testblas/zsyr2k.go index ea40ec2a..45d3d822 100644 --- a/blas/testblas/zsyr2k.go +++ b/blas/testblas/zsyr2k.go @@ -98,11 +98,11 @@ func zsyr2kTest(t *testing.T, impl Zsyr2ker, uplo blas.Uplo, trans blas.Transpos // Compute the expected result using an internal Zgemm implementation. var want []complex128 if trans == blas.NoTrans { - // C = alpha*A*B^T + alpha*B*A^T + beta*C + // C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C tmp := zmm(blas.NoTrans, blas.Trans, n, n, k, alpha, a, lda, b, ldb, beta, cSym, ldc) want = zmm(blas.NoTrans, blas.Trans, n, n, k, alpha, b, ldb, a, lda, 1, tmp, ldc) } else { - // C = alpha*A^T*B + alpha*B^T*A + beta*C + // C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C tmp := zmm(blas.Trans, blas.NoTrans, n, n, k, alpha, a, lda, b, ldb, beta, cSym, ldc) want = zmm(blas.Trans, blas.NoTrans, n, n, k, alpha, b, ldb, a, lda, 1, tmp, ldc) } diff --git a/internal/asm/f32/ge_amd64.go b/internal/asm/f32/ge_amd64.go index 2b336a2a..a27fcaad 100644 --- a/internal/asm/f32/ge_amd64.go +++ b/internal/asm/f32/ge_amd64.go @@ -7,7 +7,7 @@ package f32 // Ger performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, diff --git a/internal/asm/f32/ge_noasm.go b/internal/asm/f32/ge_noasm.go index d92f9968..562302d8 100644 --- a/internal/asm/f32/ge_noasm.go +++ b/internal/asm/f32/ge_noasm.go @@ -7,7 +7,7 @@ package f32 // Ger performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, y []float32, incY uintptr, a []float32, lda uintptr) { diff --git a/internal/asm/f64/ge_amd64.go b/internal/asm/f64/ge_amd64.go index 00c99e93..506fdbbd 100644 --- a/internal/asm/f64/ge_amd64.go +++ b/internal/asm/f64/ge_amd64.go @@ -7,7 +7,7 @@ package f64 // Ger performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) @@ -17,6 +17,6 @@ func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, in func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) // GemvT computes -// y = alpha * A^T * x + beta * y +// 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 GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) diff --git a/internal/asm/f64/ge_noasm.go b/internal/asm/f64/ge_noasm.go index 2a1cfd5c..4b949d01 100644 --- a/internal/asm/f64/ge_noasm.go +++ b/internal/asm/f64/ge_noasm.go @@ -7,7 +7,7 @@ package f64 // Ger performs the rank-one operation -// A += alpha * x * y^T +// A += alpha * x * yᵀ // where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) { if incX == 1 && incY == 1 { @@ -73,7 +73,7 @@ func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, i } // GemvT computes -// y = alpha * A^T * x + beta * y +// 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 GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) { var kx, ky, i uintptr diff --git a/lapack/gonum/dbdsqr.go b/lapack/gonum/dbdsqr.go index 5f3833fd..acbf4534 100644 --- a/lapack/gonum/dbdsqr.go +++ b/lapack/gonum/dbdsqr.go @@ -15,19 +15,19 @@ import ( // Dbdsqr performs a singular value decomposition of a real n×n bidiagonal matrix. // // The SVD of the bidiagonal matrix B is -// B = Q * S * P^T +// B = Q * S * Pᵀ // where S is a diagonal matrix of singular values, Q is an orthogonal matrix of // left singular vectors, and P is an orthogonal matrix of right singular vectors. // // Q and P are only computed if requested. If left singular vectors are requested, // this routine returns U * Q instead of Q, and if right singular vectors are -// requested P^T * VT is returned instead of P^T. +// requested Pᵀ * VT is returned instead of Pᵀ. // // Frequently Dbdsqr is used in conjunction with Dgebrd which reduces a general // matrix A into bidiagonal form. In this case, the SVD of A is -// A = (U * Q) * S * (P^T * VT) +// A = (U * Q) * S * (Pᵀ * VT) // -// This routine may also compute Q^T * C. +// This routine may also compute Qᵀ * C. // // d and e contain the elements of the bidiagonal matrix b. d must have length at // least n, and e must have length at least n-1. Dbdsqr will panic if there is @@ -35,13 +35,13 @@ import ( // order. // // VT is a matrix of size n×ncvt whose elements are stored in vt. The elements -// of vt are modified to contain P^T * VT on exit. VT is not used if ncvt == 0. +// of vt are modified to contain Pᵀ * VT on exit. VT is not used if ncvt == 0. // // U is a matrix of size nru×n whose elements are stored in u. The elements // of u are modified to contain U * Q on exit. U is not used if nru == 0. // // C is a matrix of size n×ncc whose elements are stored in c. The elements -// of c are modified to contain Q^T * C on exit. C is not used if ncc == 0. +// of c are modified to contain Qᵀ * C on exit. C is not used if ncc == 0. // // work contains temporary storage and must have length at least 4*(n-1). Dbdsqr // will panic if there is insufficient working memory. diff --git a/lapack/gonum/dgebak.go b/lapack/gonum/dgebak.go index 7caa0b17..b8c61203 100644 --- a/lapack/gonum/dgebak.go +++ b/lapack/gonum/dgebak.go @@ -10,8 +10,8 @@ import ( ) // Dgebak updates an n×m matrix V as -// V = P D V, if side == lapack.EVRight, -// V = P D^{-1} V, if side == lapack.EVLeft, +// V = P D V if side == lapack.EVRight, +// V = P D^{-1} V if side == lapack.EVLeft, // where P and D are n×n permutation and scaling matrices, respectively, // implicitly represented by job, scale, ilo and ihi as returned by Dgebal. // diff --git a/lapack/gonum/dgebal.go b/lapack/gonum/dgebal.go index 6fb5170c..f4690b50 100644 --- a/lapack/gonum/dgebal.go +++ b/lapack/gonum/dgebal.go @@ -15,10 +15,10 @@ import ( // and scaling. Both steps are optional and depend on the value of job. // // Permuting consists of applying a permutation matrix P such that the matrix -// that results from P^T*A*P takes the upper block triangular form -// [ T1 X Y ] -// P^T A P = [ 0 B Z ], -// [ 0 0 T2 ] +// that results from Pᵀ*A*P takes the upper block triangular form +// [ T1 X Y ] +// Pᵀ A P = [ 0 B Z ], +// [ 0 0 T2 ] // where T1 and T2 are upper triangular matrices and B contains at least one // nonzero off-diagonal element in each row and column. The indices ilo and ihi // mark the starting and ending columns of the submatrix B. The eigenvalues of A diff --git a/lapack/gonum/dgebd2.go b/lapack/gonum/dgebd2.go index cf951a12..6dc97ce5 100644 --- a/lapack/gonum/dgebd2.go +++ b/lapack/gonum/dgebd2.go @@ -8,7 +8,7 @@ import "gonum.org/v1/gonum/blas" // Dgebd2 reduces an m×n matrix A to upper or lower bidiagonal form by an orthogonal // transformation. -// Q^T * A * P = B +// Qᵀ * A * P = B // if m >= n, B is upper diagonal, otherwise B is lower bidiagonal. // d is the diagonal, len = min(m,n) // e is the off-diagonal len = min(m,n)-1 diff --git a/lapack/gonum/dgebrd.go b/lapack/gonum/dgebrd.go index f03bf8d9..8faef130 100644 --- a/lapack/gonum/dgebrd.go +++ b/lapack/gonum/dgebrd.go @@ -11,7 +11,7 @@ import ( // Dgebrd reduces a general m×n matrix A to upper or lower bidiagonal form B by // an orthogonal transformation: -// Q^T * A * P = B. +// Qᵀ * A * P = B. // The diagonal elements of B are stored in d and the off-diagonal elements are stored // in e. These are additionally stored along the diagonal of A and the off-diagonal // of A. If m >= n B is an upper-bidiagonal matrix, and if m < n B is a @@ -24,8 +24,8 @@ import ( // if m < n, Q = H_0 * H_1 * ... * H_{m-2}, // P = G_0 * G_1 * ... * G_{m-1}, // where -// H_i = I - tauQ[i] * v_i * v_i^T, -// G_i = I - tauP[i] * u_i * u_i^T. +// H_i = I - tauQ[i] * v_i * v_iᵀ, +// G_i = I - tauP[i] * u_i * u_iᵀ. // // As an example, on exit the entries of A when m = 6, and n = 5 // [ d e u1 u1 u1] diff --git a/lapack/gonum/dgeev.go b/lapack/gonum/dgeev.go index 0da4e609..9d3aa724 100644 --- a/lapack/gonum/dgeev.go +++ b/lapack/gonum/dgeev.go @@ -19,8 +19,8 @@ import ( // is defined by // A v_j = λ_j v_j, // and the left eigenvector u_j corresponding to an eigenvalue λ_j is defined by -// u_j^H A = λ_j u_j^H, -// where u_j^H is the conjugate transpose of u_j. +// u_jᴴ A = λ_j u_jᴴ, +// where u_jᴴ is the conjugate transpose of u_j. // // On return, A will be overwritten and the left and right eigenvectors will be // stored, respectively, in the columns of the n×n matrices VL and VR in the diff --git a/lapack/gonum/dgehd2.go b/lapack/gonum/dgehd2.go index 261f21b9..15f45b5e 100644 --- a/lapack/gonum/dgehd2.go +++ b/lapack/gonum/dgehd2.go @@ -7,13 +7,13 @@ package gonum import "gonum.org/v1/gonum/blas" // Dgehd2 reduces a block of a general n×n matrix A to upper Hessenberg form H -// by an orthogonal similarity transformation Q^T * A * Q = H. +// by an orthogonal similarity transformation Qᵀ * A * Q = H. // // The matrix Q is represented as a product of (ihi-ilo) elementary // reflectors // Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. // Each H_i has the form -// H_i = I - tau[i] * v * v^T +// H_i = I - tau[i] * v * vᵀ // where v is a real vector with v[0:i+1] = 0, v[i+1] = 1 and v[ihi+1:n] = 0. // v[i+2:ihi+1] is stored on exit in A[i+2:ihi+1,i]. // diff --git a/lapack/gonum/dgehrd.go b/lapack/gonum/dgehrd.go index 89b73cef..2fc75987 100644 --- a/lapack/gonum/dgehrd.go +++ b/lapack/gonum/dgehrd.go @@ -11,13 +11,13 @@ import ( ) // Dgehrd reduces a block of a real n×n general matrix A to upper Hessenberg -// form H by an orthogonal similarity transformation Q^T * A * Q = H. +// form H by an orthogonal similarity transformation Qᵀ * A * Q = H. // // The matrix Q is represented as a product of (ihi-ilo) elementary // reflectors // Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. // Each H_i has the form -// H_i = I - tau[i] * v * v^T +// H_i = I - tau[i] * v * vᵀ // where v is a real vector with v[0:i+1] = 0, v[i+1] = 1 and v[ihi+1:n] = 0. // v[i+2:ihi+1] is stored on exit in A[i+2:ihi+1,i]. // @@ -158,12 +158,12 @@ func (impl Implementation) Dgehrd(n, ilo, ihi int, a []float64, lda int, tau, wo ib := min(nb, ihi-i) // Reduce columns [i:i+ib] to Hessenberg form, returning the - // matrices V and T of the block reflector H = I - V*T*V^T + // matrices V and T of the block reflector H = I - V*T*Vᵀ // which performs the reduction, and also the matrix Y = A*V*T. impl.Dlahr2(ihi+1, i+1, ib, a[i:], lda, tau[i:], work[iwt:], ldt, work, ldwork) // Apply the block reflector H to A[:ihi+1,i+ib:ihi+1] from the - // right, computing A := A - Y * V^T. V[i+ib,i+ib-1] must be set + // right, computing A := A - Y * Vᵀ. V[i+ib,i+ib-1] must be set // to 1. ei := a[(i+ib)*lda+i+ib-1] a[(i+ib)*lda+i+ib-1] = 1 diff --git a/lapack/gonum/dgels.go b/lapack/gonum/dgels.go index a3894b6a..cb0dbe86 100644 --- a/lapack/gonum/dgels.go +++ b/lapack/gonum/dgels.go @@ -20,7 +20,7 @@ import ( // 2. If m < n and trans == blas.NoTrans, Dgels finds the minimum norm solution of // A * X = B. // 3. If m >= n and trans == blas.Trans, Dgels finds the minimum norm solution of -// A^T * X = B. +// Aᵀ * X = B. // 4. If m < n and trans == blas.Trans, Dgels finds X such that || A*X - B||_2 // is minimized. // Note that the least-squares solutions (cases 1 and 3) perform the minimization diff --git a/lapack/gonum/dgeql2.go b/lapack/gonum/dgeql2.go index 3f3ddb16..73e42d1a 100644 --- a/lapack/gonum/dgeql2.go +++ b/lapack/gonum/dgeql2.go @@ -14,7 +14,7 @@ import "gonum.org/v1/gonum/blas" // Q is represented as a product of elementary reflectors, // Q = H_{k-1} * ... * H_1 * H_0 // where k = min(m,n) and each H_i has the form -// H_i = I - tau[i] * v_i * v_i^T +// H_i = I - tau[i] * v_i * v_iᵀ // Vector v_i has v[m-k+i+1:m] = 0, v[m-k+i] = 1, and v[:m-k+i+1] is stored on // exit in A[0:m-k+i-1, n-k+i]. // diff --git a/lapack/gonum/dgeqp3.go b/lapack/gonum/dgeqp3.go index 6949da96..d072d288 100644 --- a/lapack/gonum/dgeqp3.go +++ b/lapack/gonum/dgeqp3.go @@ -15,7 +15,7 @@ import ( // The matrix Q is represented as a product of elementary reflectors // Q = H_0 H_1 . . . H_{k-1}, where k = min(m,n). // Each H_i has the form -// H_i = I - tau * v * v^T +// H_i = I - tau * v * vᵀ // where tau and v are real vectors with v[0:i-1] = 0 and v[i] = 1; // v[i:m] is stored on exit in A[i:m, i], and tau in tau[i]. // diff --git a/lapack/gonum/dgeqr2.go b/lapack/gonum/dgeqr2.go index 3e35d7e2..57bf3772 100644 --- a/lapack/gonum/dgeqr2.go +++ b/lapack/gonum/dgeqr2.go @@ -22,7 +22,7 @@ import "gonum.org/v1/gonum/blas" // v[j] = 0 j < i // v[j] = 1 j == i // v[j] = a[j*lda+i] j > i -// and computing H_i = I - tau[i] * v * v^T. +// and computing H_i = I - tau[i] * v * vᵀ. // // The orthonormal matrix Q can be constructed from a product of these elementary // reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). diff --git a/lapack/gonum/dgeqrf.go b/lapack/gonum/dgeqrf.go index 300f8eea..d14088a1 100644 --- a/lapack/gonum/dgeqrf.go +++ b/lapack/gonum/dgeqrf.go @@ -85,7 +85,7 @@ func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []fl // Compute the QR factorization of the current block. impl.Dgeqr2(m-i, ib, a[i*lda+i:], lda, tau[i:], work) if i+ib < n { - // Form the triangular factor of the block reflector and apply H^T + // Form the triangular factor of the block reflector and apply Hᵀ // In Dlarft, work becomes the T matrix. impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, a[i*lda+i:], lda, diff --git a/lapack/gonum/dgerq2.go b/lapack/gonum/dgerq2.go index 60dac973..a06dec5a 100644 --- a/lapack/gonum/dgerq2.go +++ b/lapack/gonum/dgerq2.go @@ -19,7 +19,7 @@ import "gonum.org/v1/gonum/blas" // The matrix Q is represented as a product of elementary reflectors // Q = H_0 H_1 . . . H_{min(m,n)-1}. // Each H(i) has the form -// H_i = I - tau_i * v * v^T +// H_i = I - tau_i * v * vᵀ // where v is a vector with v[0:n-k+i-1] stored in A[m-k+i, 0:n-k+i-1], // v[n-k+i:n] = 0 and v[n-k+i] = 1. // diff --git a/lapack/gonum/dgerqf.go b/lapack/gonum/dgerqf.go index 9b4aa050..86115548 100644 --- a/lapack/gonum/dgerqf.go +++ b/lapack/gonum/dgerqf.go @@ -22,7 +22,7 @@ import ( // The matrix Q is represented as a product of elementary reflectors // Q = H_0 H_1 . . . H_{min(m,n)-1}. // Each H(i) has the form -// H_i = I - tau_i * v * v^T +// H_i = I - tau_i * v * vᵀ // where v is a vector with v[0:n-k+i-1] stored in A[m-k+i, 0:n-k+i-1], // v[n-k+i:n] = 0 and v[n-k+i] = 1. // diff --git a/lapack/gonum/dgesvd.go b/lapack/gonum/dgesvd.go index 136f683e..f2e98547 100644 --- a/lapack/gonum/dgesvd.go +++ b/lapack/gonum/dgesvd.go @@ -17,7 +17,7 @@ const noSVDO = "dgesvd: not coded for overwrite" // Dgesvd computes the singular value decomposition of the input matrix A. // // The singular value decomposition is -// A = U * Sigma * V^T +// A = U * Sigma * Vᵀ // where Sigma is an m×n diagonal matrix containing the singular values of A, // U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first // min(m,n) columns of U and V are the left and right singular vectors of A @@ -29,7 +29,7 @@ const noSVDO = "dgesvd: not coded for overwrite" // jobU == lapack.SVDStore The first min(m,n) columns are returned in u // jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a // jobU == lapack.SVDNone The columns of U are not computed. -// The behavior is the same for jobVT and the rows of V^T. At most one of jobU +// The behavior is the same for jobVT and the rows of Vᵀ. At most one of jobU // and jobVT can equal lapack.SVDOverwrite, and Dgesvd will panic otherwise. // // On entry, a contains the data for the m×n matrix A. During the call to Dgesvd diff --git a/lapack/gonum/dgetrs.go b/lapack/gonum/dgetrs.go index ecc20d7c..55319345 100644 --- a/lapack/gonum/dgetrs.go +++ b/lapack/gonum/dgetrs.go @@ -11,8 +11,8 @@ import ( // Dgetrs solves a system of equations using an LU factorization. // The system of equations solved is -// A * X = B if trans == blas.Trans -// A^T * X = B if trans == blas.NoTrans +// A * X = B if trans == blas.Trans +// Aᵀ * X = B if trans == blas.NoTrans // A is a general n×n matrix with stride lda. B is a general matrix of size n×nrhs. // // On entry b contains the elements of the matrix B. On exit, b contains the @@ -61,11 +61,11 @@ func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64 n, nrhs, 1, a, lda, b, ldb) return } - // Solve A^T * X = B. - // Solve U^T * X = B, updating b. + // Solve Aᵀ * X = B. + // Solve Uᵀ * X = B, updating b. bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve L^T * X = B, updating b. + // Solve Lᵀ * X = B, updating b. bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.Unit, n, nrhs, 1, a, lda, b, ldb) impl.Dlaswp(nrhs, b, ldb, 0, n-1, ipiv, -1) diff --git a/lapack/gonum/dggsvd3.go b/lapack/gonum/dggsvd3.go index ac234dce..d5c8be9e 100644 --- a/lapack/gonum/dggsvd3.go +++ b/lapack/gonum/dggsvd3.go @@ -13,13 +13,13 @@ import ( // Dggsvd3 computes the generalized singular value decomposition (GSVD) // of an m×n matrix A and p×n matrix B: -// U^T*A*Q = D1*[ 0 R ] +// Uᵀ*A*Q = D1*[ 0 R ] // -// V^T*B*Q = D2*[ 0 R ] +// Vᵀ*B*Q = D2*[ 0 R ] // where U, V and Q are orthogonal matrices. // // Dggsvd3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. +// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. // R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and // D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following // structures, respectively: diff --git a/lapack/gonum/dggsvp3.go b/lapack/gonum/dggsvp3.go index 7a9ad9fb..902260c1 100644 --- a/lapack/gonum/dggsvp3.go +++ b/lapack/gonum/dggsvp3.go @@ -14,16 +14,16 @@ import ( // Dggsvp3 computes orthogonal matrices U, V and Q such that // // n-k-l k l -// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l >= 0; +// Uᵀ*A*Q = k [ 0 A12 A13 ] if m-k-l >= 0; // l [ 0 0 A23 ] // m-k-l [ 0 0 0 ] // // n-k-l k l -// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l < 0; +// Uᵀ*A*Q = k [ 0 A12 A13 ] if m-k-l < 0; // m-k [ 0 0 A23 ] // // n-k-l k l -// V^T*B*Q = l [ 0 0 B13 ] +// Vᵀ*B*Q = l [ 0 0 B13 ] // p-l [ 0 0 0 ] // // where the k×k matrix A12 and l×l matrix B13 are non-singular @@ -31,7 +31,7 @@ import ( // otherwise A23 is (m-k)×l upper trapezoidal. // // Dggsvp3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. +// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. // // jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior // is as follows @@ -174,11 +174,11 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, // RQ factorization of [ S11 S12 ]: [ S11 S12 ] = [ 0 S12 ]*Z. impl.Dgerq2(l, n, b, ldb, tau, work) - // Update A := A*Z^T. + // Update A := A*Zᵀ. impl.Dormr2(blas.Right, blas.Trans, m, n, l, b, ldb, tau, a, lda, work) if wantq { - // Update Q := Q*Z^T. + // Update Q := Q*Zᵀ. impl.Dormr2(blas.Right, blas.Trans, n, n, l, b, ldb, tau, q, ldq, work) } @@ -197,7 +197,7 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, // // then the following does the complete QR decomposition of A11: // - // A11 = U*[ 0 T12 ]*P1^T. + // A11 = U*[ 0 T12 ]*P1ᵀ. // [ 0 0 ] for i := range iwork[:n-l] { iwork[i] = 0 @@ -211,7 +211,7 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, } } - // Update A12 := U^T*A12, where A12 = A[0:m, n-l:n]. + // Update A12 := Uᵀ*A12, where A12 = A[0:m, n-l:n]. impl.Dorm2r(blas.Left, blas.Trans, m, l, min(m, n-l), a, lda, tau, a[n-l:], lda, work) if wantu { @@ -245,7 +245,7 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, impl.Dgerq2(k, n-l, a, lda, tau, work) if wantq { - // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*Z1^T. + // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*Z1ᵀ. impl.Dorm2r(blas.Right, blas.Trans, n, n-l, k, a, lda, tau, q, ldq, work) } diff --git a/lapack/gonum/dhseqr.go b/lapack/gonum/dhseqr.go index ed3fbca8..61390fbd 100644 --- a/lapack/gonum/dhseqr.go +++ b/lapack/gonum/dhseqr.go @@ -13,14 +13,14 @@ import ( // Dhseqr computes the eigenvalues of an n×n Hessenberg matrix H and, // optionally, the matrices T and Z from the Schur decomposition -// H = Z T Z^T, +// H = Z T Zᵀ, // where T is an n×n upper quasi-triangular matrix (the Schur form), and Z is // the n×n orthogonal matrix of Schur vectors. // // Optionally Z may be postmultiplied into an input orthogonal matrix Q so that // this routine can give the Schur factorization of a matrix A which has been // reduced to the Hessenberg form H by the orthogonal matrix Q: -// A = Q H Q^T = (QZ) T (QZ)^T. +// A = Q H Qᵀ = (QZ) T (QZ)ᵀ. // // If job == lapack.EigenvaluesOnly, only the eigenvalues will be computed. // If job == lapack.EigenvaluesAndSchur, the eigenvalues and the Schur form T will @@ -43,8 +43,8 @@ import ( // and Dhseqr will panic otherwise. ilo and ihi are typically set by a previous // call to Dgebal, otherwise they should be set to 0 and n-1, respectively. It // must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo == 0 and ihi == -1, if n == 0. +// 0 <= ilo <= ihi < n if n > 0, +// ilo == 0 and ihi == -1 if n == 0. // // wr and wi must have length n. // diff --git a/lapack/gonum/dlabrd.go b/lapack/gonum/dlabrd.go index babc0b7c..8f7d2949 100644 --- a/lapack/gonum/dlabrd.go +++ b/lapack/gonum/dlabrd.go @@ -25,8 +25,8 @@ import ( // Q = H_0 * H_1 * ... * H_{nb-1} // P = G_0 * G_1 * ... * G_{nb-1} // where -// H_i = I - tauQ[i] * v_i * v_i^T -// G_i = I - tauP[i] * u_i * u_i^T +// H_i = I - tauQ[i] * v_i * v_iᵀ +// G_i = I - tauP[i] * u_i * u_iᵀ // // As an example, on exit the entries of A when m = 6, n = 5, and nb = 2 // [ 1 1 u1 u1 u1] @@ -44,7 +44,7 @@ import ( // // Dlabrd also returns the matrices X and Y which are used with U and V to // apply the transformation to the unreduced part of the matrix -// A := A - V*Y^T - X*U^T +// A := A - V*Yᵀ - X*Uᵀ // and returns the matrices X and Y which are needed to apply the // transformation to the unreduced part of A. // diff --git a/lapack/gonum/dlacn2.go b/lapack/gonum/dlacn2.go index e8ac1e43..d97e5edf 100644 --- a/lapack/gonum/dlacn2.go +++ b/lapack/gonum/dlacn2.go @@ -18,7 +18,7 @@ import ( // On the initial call, kase must be 0. // In between calls, x must be overwritten by // A * X if kase was returned as 1, -// A^T * X if kase was returned as 2, +// Aᵀ * X if kase was returned as 2, // and all other parameters must not be changed. // On the final return, kase is returned as 0, v contains A*W where W is a // vector, and est = norm(V)/norm(W) is a lower bound for 1-norm of A. diff --git a/lapack/gonum/dlags2.go b/lapack/gonum/dlags2.go index 6954deb4..1622275d 100644 --- a/lapack/gonum/dlags2.go +++ b/lapack/gonum/dlags2.go @@ -11,19 +11,19 @@ import "math" // // If upper is true // -// U^T*A*Q = U^T*[ a1 a2 ]*Q = [ x 0 ] -// [ 0 a3 ] [ x x ] +// Uᵀ*A*Q = Uᵀ*[ a1 a2 ]*Q = [ x 0 ] +// [ 0 a3 ] [ x x ] // and -// V^T*B*Q = V^T*[ b1 b2 ]*Q = [ x 0 ] -// [ 0 b3 ] [ x x ] +// Vᵀ*B*Q = Vᵀ*[ b1 b2 ]*Q = [ x 0 ] +// [ 0 b3 ] [ x x ] // // otherwise // -// U^T*A*Q = U^T*[ a1 0 ]*Q = [ x x ] -// [ a2 a3 ] [ 0 x ] +// Uᵀ*A*Q = Uᵀ*[ a1 0 ]*Q = [ x x ] +// [ a2 a3 ] [ 0 x ] // and -// V^T*B*Q = V^T*[ b1 0 ]*Q = [ x x ] -// [ b2 b3 ] [ 0 x ]. +// Vᵀ*B*Q = Vᵀ*[ b1 0 ]*Q = [ x x ] +// [ b2 b3 ] [ 0 x ]. // // The rows of the transformed A and B are parallel, where // @@ -48,8 +48,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c _, _, snr, csr, snl, csl := impl.Dlasv2(a, b, d) if math.Abs(csl) >= math.Abs(snl) || math.Abs(csr) >= math.Abs(snr) { - // Compute the [0, 0] and [0, 1] elements of U^T*A and V^T*B, - // and [0, 1] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [0, 0] and [0, 1] elements of Uᵀ*A and Vᵀ*B, + // and [0, 1] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua11r := csl * a1 ua12 := csl*a2 + snl*a3 @@ -60,7 +60,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua12 := math.Abs(csl)*math.Abs(a2) + math.Abs(snl)*math.Abs(a3) avb12 := math.Abs(csr)*math.Abs(b2) + math.Abs(snr)*math.Abs(b3) - // Zero [0, 1] elements of U^T*A and V^T*B. + // Zero [0, 1] elements of Uᵀ*A and Vᵀ*B. if math.Abs(ua11r)+math.Abs(ua12) != 0 { if aua12/(math.Abs(ua11r)+math.Abs(ua12)) <= avb12/(math.Abs(vb11r)+math.Abs(vb12)) { csq, snq, _ = impl.Dlartg(-ua11r, ua12) @@ -76,8 +76,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c csv = csr snv = -snr } else { - // Compute the [1, 0] and [1, 1] elements of U^T*A and V^T*B, - // and [1, 1] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [1, 0] and [1, 1] elements of Uᵀ*A and Vᵀ*B, + // and [1, 1] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua21 := -snl * a1 ua22 := -snl*a2 + csl*a3 @@ -88,7 +88,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua22 := math.Abs(snl)*math.Abs(a2) + math.Abs(csl)*math.Abs(a3) avb22 := math.Abs(snr)*math.Abs(b2) + math.Abs(csr)*math.Abs(b3) - // Zero [1, 1] elements of U^T*A and V^T*B, and then swap. + // Zero [1, 1] elements of Uᵀ*A and Vᵀ*B, and then swap. if math.Abs(ua21)+math.Abs(ua22) != 0 { if aua22/(math.Abs(ua21)+math.Abs(ua22)) <= avb22/(math.Abs(vb21)+math.Abs(vb22)) { csq, snq, _ = impl.Dlartg(-ua21, ua22) @@ -120,8 +120,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c _, _, snr, csr, snl, csl := impl.Dlasv2(a, c, d) if math.Abs(csr) >= math.Abs(snr) || math.Abs(csl) >= math.Abs(snl) { - // Compute the [1, 0] and [1, 1] elements of U^T*A and V^T*B, - // and [1, 0] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [1, 0] and [1, 1] elements of Uᵀ*A and Vᵀ*B, + // and [1, 0] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua21 := -snr*a1 + csr*a2 ua22r := csr * a3 @@ -132,7 +132,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua21 := math.Abs(snr)*math.Abs(a1) + math.Abs(csr)*math.Abs(a2) avb21 := math.Abs(snl)*math.Abs(b1) + math.Abs(csl)*math.Abs(b2) - // Zero [1, 0] elements of U^T*A and V^T*B. + // Zero [1, 0] elements of Uᵀ*A and Vᵀ*B. if (math.Abs(ua21) + math.Abs(ua22r)) != 0 { if aua21/(math.Abs(ua21)+math.Abs(ua22r)) <= avb21/(math.Abs(vb21)+math.Abs(vb22r)) { csq, snq, _ = impl.Dlartg(ua22r, ua21) @@ -148,8 +148,8 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c csv = csl snv = -snl } else { - // Compute the [0, 0] and [0, 1] elements of U^T *A and V^T *B, - // and [0, 0] element of |U|^T*|A| and |V|^T*|B|. + // Compute the [0, 0] and [0, 1] elements of Uᵀ *A and Vᵀ *B, + // and [0, 0] element of |U|ᵀ*|A| and |V|ᵀ*|B|. ua11 := csr*a1 + snr*a2 ua12 := snr * a3 @@ -160,7 +160,7 @@ func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (c aua11 := math.Abs(csr)*math.Abs(a1) + math.Abs(snr)*math.Abs(a2) avb11 := math.Abs(csl)*math.Abs(b1) + math.Abs(snl)*math.Abs(b2) - // Zero [0, 0] elements of U^T*A and V^T*B, and then swap. + // Zero [0, 0] elements of Uᵀ*A and Vᵀ*B, and then swap. if (math.Abs(ua11) + math.Abs(ua12)) != 0 { if aua11/(math.Abs(ua11)+math.Abs(ua12)) <= avb11/(math.Abs(vb11)+math.Abs(vb12)) { csq, snq, _ = impl.Dlartg(ua12, ua11) diff --git a/lapack/gonum/dlahr2.go b/lapack/gonum/dlahr2.go index a47dc8fe..43b7308f 100644 --- a/lapack/gonum/dlahr2.go +++ b/lapack/gonum/dlahr2.go @@ -11,21 +11,21 @@ import ( // Dlahr2 reduces the first nb columns of a real general n×(n-k+1) matrix A so // that elements below the k-th subdiagonal are zero. The reduction is performed -// by an orthogonal similarity transformation Q^T * A * Q. Dlahr2 returns the -// matrices V and T which determine Q as a block reflector I - V*T*V^T, and +// by an orthogonal similarity transformation Qᵀ * A * Q. Dlahr2 returns the +// matrices V and T which determine Q as a block reflector I - V*T*Vᵀ, and // also the matrix Y = A * V * T. // // The matrix Q is represented as a product of nb elementary reflectors // Q = H_0 * H_1 * ... * H_{nb-1}. // Each H_i has the form -// H_i = I - tau[i] * v * v^T, +// H_i = I - tau[i] * v * vᵀ, // where v is a real vector with v[0:i+k-1] = 0 and v[i+k-1] = 1. v[i+k:n] is // stored on exit in A[i+k+1:n,i]. // // The elements of the vectors v together form the (n-k+1)×nb matrix // V which is needed, with T and Y, to apply the transformation to the // unreduced part of the matrix, using an update of the form -// A = (I - V*T*V^T) * (A - Y*V^T). +// A = (I - V*T*Vᵀ) * (A - Y*Vᵀ). // // On entry, a contains the n×(n-k+1) general matrix A. On return, the elements // on and above the k-th subdiagonal in the first nb columns are overwritten @@ -109,31 +109,31 @@ func (impl Implementation) Dlahr2(n, k, nb int, a []float64, lda int, tau, t []f if i > 0 { // Update A[k:n,i]. - // Update i-th column of A - Y * V^T. + // Update i-th column of A - Y * Vᵀ. bi.Dgemv(blas.NoTrans, n-k, i, -1, y[k*ldy:], ldy, a[(k+i-1)*lda:], 1, 1, a[k*lda+i:], lda) - // Apply I - V * T^T * V^T to this column (call it b) + // Apply I - V * Tᵀ * Vᵀ to this column (call it b) // from the left, using the last column of T as // workspace. // Let V = [ V1 ] and b = [ b1 ] (first i rows) // [ V2 ] [ b2 ] // where V1 is unit lower triangular. // - // w := V1^T * b1. + // w := V1ᵀ * b1. bi.Dcopy(i, a[k*lda+i:], lda, t[nb-1:], ldt) bi.Dtrmv(blas.Lower, blas.Trans, blas.Unit, i, a[k*lda:], lda, t[nb-1:], ldt) - // w := w + V2^T * b2. + // w := w + V2ᵀ * b2. bi.Dgemv(blas.Trans, n-k-i, i, 1, a[(k+i)*lda:], lda, a[(k+i)*lda+i:], lda, 1, t[nb-1:], ldt) - // w := T^T * w. + // w := Tᵀ * w. bi.Dtrmv(blas.Upper, blas.Trans, blas.NonUnit, i, t, ldt, t[nb-1:], ldt) diff --git a/lapack/gonum/dlaln2.go b/lapack/gonum/dlaln2.go index ca0b2f78..df8164a7 100644 --- a/lapack/gonum/dlaln2.go +++ b/lapack/gonum/dlaln2.go @@ -7,8 +7,8 @@ package gonum import "math" // Dlaln2 solves a linear equation or a system of 2 linear equations of the form -// (ca A - w D) X = scale B, if trans == false, -// (ca A^T - w D) X = scale B, if trans == true, +// (ca A - w D) X = scale B if trans == false, +// (ca Aᵀ - w D) X = scale B if trans == true, // where A is a na×na real matrix, ca is a real scalar, D is a na×na diagonal // real matrix, w is a scalar, real if nw == 1, complex if nw == 2, and X and B // are na×1 matrices, real if w is real, complex if w is complex. @@ -147,7 +147,7 @@ func (impl Implementation) Dlaln2(trans bool, na, nw int, smin, ca float64, a [] // Compute the real part of // C = ca A - w D // or - // C = ca A^T - w D. + // C = ca Aᵀ - w D. crv := [4]float64{ ca*a[0] - wr*d1, ca * a[1], diff --git a/lapack/gonum/dlaqp2.go b/lapack/gonum/dlaqp2.go index d3a0def6..cc3bc06d 100644 --- a/lapack/gonum/dlaqp2.go +++ b/lapack/gonum/dlaqp2.go @@ -93,7 +93,7 @@ func (impl Implementation) Dlaqp2(m, n, offset int, a []float64, lda int, jpvt [ } if i < n-1 { - // Apply H_i^T to A[offset+i:m, i:n] from the left. + // Apply H_iᵀ to A[offset+i:m, i:n] from the left. aii := a[offpi*lda+i] a[offpi*lda+i] = 1 impl.Dlarf(blas.Left, m-offpi, n-i-1, a[offpi*lda+i:], lda, tau[i], a[offpi*lda+i+1:], lda, work) diff --git a/lapack/gonum/dlaqps.go b/lapack/gonum/dlaqps.go index dd683b62..da1a60e5 100644 --- a/lapack/gonum/dlaqps.go +++ b/lapack/gonum/dlaqps.go @@ -122,7 +122,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Apply previous Householder reflectors to column K: // - // A[rk:m, k] = A[rk:m, k] - A[rk:m, 0:k-1]*F[k, 0:k-1]^T. + // A[rk:m, k] = A[rk:m, k] - A[rk:m, 0:k-1]*F[k, 0:k-1]ᵀ. if k > 0 { bi.Dgemv(blas.NoTrans, m-rk, k, -1, a[rk*lda:], lda, @@ -143,7 +143,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Compute kth column of F: // - // Compute F[k+1:n, k] = tau[k]*A[rk:m, k+1:n]^T*A[rk:m, k]. + // Compute F[k+1:n, k] = tau[k]*A[rk:m, k+1:n]ᵀ*A[rk:m, k]. if k < n-1 { bi.Dgemv(blas.Trans, m-rk, n-k-1, tau[k], a[rk*lda+k+1:], lda, @@ -159,7 +159,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Incremental updating of F: // - // F[0:n, k] := F[0:n, k] - tau[k]*F[0:n, 0:k-1]*A[rk:m, 0:k-1]^T*A[rk:m,k]. + // F[0:n, k] := F[0:n, k] - tau[k]*F[0:n, 0:k-1]*A[rk:m, 0:k-1]ᵀ*A[rk:m,k]. if k > 0 { bi.Dgemv(blas.Trans, m-rk, k, -tau[k], a[rk*lda:], lda, @@ -175,7 +175,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Update the current row of A: // - // A[rk, k+1:n] = A[rk, k+1:n] - A[rk, 0:k]*F[k+1:n, 0:k]^T. + // A[rk, k+1:n] = A[rk, k+1:n] - A[rk, 0:k]*F[k+1:n, 0:k]ᵀ. if k < n-1 { bi.Dgemv(blas.NoTrans, n-k-1, k+1, -1, f[(k+1)*ldf:], ldf, @@ -216,7 +216,7 @@ func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jp // Apply the block reflector to the rest of the matrix: // - // A[offset+kb+1:m, kb+1:n] := A[offset+kb+1:m, kb+1:n] - A[offset+kb+1:m, 1:kb]*F[kb+1:n, 1:kb]^T. + // A[offset+kb+1:m, kb+1:n] := A[offset+kb+1:m, kb+1:n] - A[offset+kb+1:m, 1:kb]*F[kb+1:n, 1:kb]ᵀ. if kb < min(n, m-offset) { bi.Dgemm(blas.NoTrans, blas.Trans, m-rk, n-kb, kb, -1, diff --git a/lapack/gonum/dlaqr04.go b/lapack/gonum/dlaqr04.go index e9fbb600..9a6da409 100644 --- a/lapack/gonum/dlaqr04.go +++ b/lapack/gonum/dlaqr04.go @@ -12,7 +12,7 @@ import ( // Dlaqr04 computes the eigenvalues of a block of an n×n upper Hessenberg matrix // H, and optionally the matrices T and Z from the Schur decomposition -// H = Z T Z^T +// H = Z T Zᵀ // where T is an upper quasi-triangular matrix (the Schur form), and Z is the // orthogonal matrix of Schur vectors. // @@ -24,8 +24,8 @@ import ( // Z[iloz:ihiz+1,ilo:ihi+1], otherwise Z will not be referenced. // // ilo and ihi determine the block of H on which Dlaqr04 operates. It must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo == 0 and ihi == -1, if n == 0, +// 0 <= ilo <= ihi < n if n > 0, +// ilo == 0 and ihi == -1 if n == 0, // and the block must be isolated, that is, // ilo == 0 or H[ilo,ilo-1] == 0, // ihi == n-1 or H[ihi+1,ihi] == 0, @@ -39,8 +39,8 @@ import ( // otherwise Dlaqr04 will panic. // // work must have length at least lwork and lwork must be -// lwork >= 1, if n <= 11, -// lwork >= n, if n > 11, +// lwork >= 1 if n <= 11, +// lwork >= n if n > 11, // otherwise Dlaqr04 will panic. lwork as large as 6*n may be required for // optimal performance. On return, work[0] will contain the optimal value of // lwork. diff --git a/lapack/gonum/dlaqr23.go b/lapack/gonum/dlaqr23.go index ff299a73..58af1e6d 100644 --- a/lapack/gonum/dlaqr23.go +++ b/lapack/gonum/dlaqr23.go @@ -29,8 +29,8 @@ import ( // // ktop and kbot determine a block [ktop:kbot+1,ktop:kbot+1] along the diagonal // of H. It must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo == 0 and ihi == -1, if n == 0, +// 0 <= ilo <= ihi < n if n > 0, +// ilo == 0 and ihi == -1 if n == 0, // and the block must be isolated, that is, it must hold that // ktop == 0 or H[ktop,ktop-1] == 0, // kbot == n-1 or H[kbot+1,kbot] == 0, diff --git a/lapack/gonum/dlaqr5.go b/lapack/gonum/dlaqr5.go index c198f229..0b0640ee 100644 --- a/lapack/gonum/dlaqr5.go +++ b/lapack/gonum/dlaqr5.go @@ -544,12 +544,12 @@ func (impl Implementation) Dlaqr5(wantt, wantz bool, kacc22 int, n, ktop, kbot, // rows get multiplied by zero). impl.Dlacpy(blas.All, knz, jlen, h[(incol+1+j2)*ldh+jcol:], ldh, wh[kzs*ldwh:], ldwh) - // Multiply by U21^T. + // Multiply by U21ᵀ. impl.Dlaset(blas.All, kzs, jlen, 0, 0, wh, ldwh) bi.Dtrmm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, knz, jlen, 1, u[j2*ldu+kzs:], ldu, wh[kzs*ldwh:], ldwh) - // Multiply top of H by U11^T. + // Multiply top of H by U11ᵀ. bi.Dgemm(blas.Trans, blas.NoTrans, i2, jlen, j2, 1, u, ldu, h[(incol+1)*ldh+jcol:], ldh, 1, wh, ldwh) @@ -557,7 +557,7 @@ func (impl Implementation) Dlaqr5(wantt, wantz bool, kacc22 int, n, ktop, kbot, // Copy top of H to bottom of WH. impl.Dlacpy(blas.All, j2, jlen, h[(incol+1)*ldh+jcol:], ldh, wh[i2*ldwh:], ldwh) - // Multiply by U21^T. + // Multiply by U21ᵀ. bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, j2, jlen, 1, u[i2:], ldu, wh[i2*ldwh:], ldwh) diff --git a/lapack/gonum/dlarf.go b/lapack/gonum/dlarf.go index 9fc97a32..539b774c 100644 --- a/lapack/gonum/dlarf.go +++ b/lapack/gonum/dlarf.go @@ -14,7 +14,7 @@ import ( // c = h * c if side == Left // c = c * h if side == right // where -// h = 1 - tau * v * v^T +// h = 1 - tau * v * vᵀ // and c is an m * n matrix. // // work is temporary storage of length at least m if side == Left and at least @@ -87,15 +87,15 @@ func (impl Implementation) Dlarf(side blas.Side, m, n int, v []float64, incv int bi := blas64.Implementation() if applyleft { // Form H * C - // w[0:lastc+1] = c[1:lastv+1, 1:lastc+1]^T * v[1:lastv+1,1] + // w[0:lastc+1] = c[1:lastv+1, 1:lastc+1]ᵀ * v[1:lastv+1,1] bi.Dgemv(blas.Trans, lastv+1, lastc+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0: lastv, 0: lastc] = c[...] - w[0:lastv, 1] * v[1:lastc, 1]^T + // c[0: lastv, 0: lastc] = c[...] - w[0:lastv, 1] * v[1:lastc, 1]ᵀ bi.Dger(lastv+1, lastc+1, -tau, v, incv, work, 1, c, ldc) return } // Form C*H // w[0:lastc+1,1] := c[0:lastc+1,0:lastv+1] * v[0:lastv+1,1] bi.Dgemv(blas.NoTrans, lastc+1, lastv+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0:lastc+1,0:lastv+1] = c[...] - w[0:lastc+1,0] * v[0:lastv+1,0]^T + // c[0:lastc+1,0:lastv+1] = c[...] - w[0:lastc+1,0] * v[0:lastv+1,0]ᵀ bi.Dger(lastc+1, lastv+1, -tau, work, 1, v, incv, c, ldc) } diff --git a/lapack/gonum/dlarfb.go b/lapack/gonum/dlarfb.go index 4dd8e063..d3ddc8e4 100644 --- a/lapack/gonum/dlarfb.go +++ b/lapack/gonum/dlarfb.go @@ -13,13 +13,13 @@ import ( // Dlarfb applies a block reflector to a matrix. // // In the call to Dlarfb, the mxn c is multiplied by the implicitly defined matrix h as follows: -// c = h * c if side == Left and trans == NoTrans -// c = c * h if side == Right and trans == NoTrans -// c = h^T * c if side == Left and trans == Trans -// c = c * h^T if side == Right and trans == Trans +// c = h * c if side == Left and trans == NoTrans +// c = c * h if side == Right and trans == NoTrans +// c = hᵀ * c if side == Left and trans == Trans +// c = c * hᵀ if side == Right and trans == Trans // h is a product of elementary reflectors. direct sets the direction of multiplication -// h = h_1 * h_2 * ... * h_k if direct == Forward -// h = h_k * h_k-1 * ... * h_1 if direct == Backward +// h = h_1 * h_2 * ... * h_k if direct == Forward +// h = h_k * h_k-1 * ... * h_1 if direct == Backward // The combination of direct and store defines the orientation of the elementary // reflectors. In all cases the ones on the diagonal are implicitly represented. // @@ -118,13 +118,13 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack // elements are copied into the columns of the working array. The // loops should go in the other direction so the data is written // into the rows of work so the copy is not strided. A bigger change - // would be to replace work with work^T, but benchmarks would be + // would be to replace work with workᵀ, but benchmarks would be // needed to see if the change is merited. if store == lapack.ColumnWise { if direct == lapack.Forward { // V1 is the first k rows of C. V2 is the remaining rows. if side == blas.Left { - // W = C^T V = C1^T V1 + C2^T V2 (stored in work). + // W = Cᵀ V = C1ᵀ V1 + C2ᵀ V2 (stored in work). // W = C1. for j := 0; j < k; j++ { @@ -136,27 +136,27 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack v, ldv, work, ldwork) if m > k { - // W = W + C2^T V2. + // W = W + C2ᵀ V2. bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, 1, c[k*ldc:], ldc, v[k*ldv:], ldv, 1, work, ldwork) } - // W = W * T^T or W * T. + // W = W * Tᵀ or W * T. bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V * W^T. + // C -= V * Wᵀ. if m > k { - // C2 -= V2 * W^T. + // C2 -= V2 * Wᵀ. bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, -1, v[k*ldv:], ldv, work, ldwork, 1, c[k*ldc:], ldc) } - // W *= V1^T. + // W *= V1ᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, 1, v, ldv, work, ldwork) - // C1 -= W^T. + // C1 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -165,7 +165,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C = C * H or C * H^T, where C = (C1 C2). + // Form C = C * H or C * Hᵀ, where C = (C1 C2). // W = C1. for i := 0; i < k; i++ { @@ -180,7 +180,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c[k:], ldc, v[k*ldv:], ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) @@ -189,7 +189,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack -1, work, ldwork, v[k*ldv:], ldv, 1, c[k:], ldc) } - // C -= W * V^T. + // C -= W * Vᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, 1, v, ldv, work, ldwork) @@ -207,9 +207,9 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack // Where V2 is unit upper triangular. if side == blas.Left { // Form H * C or - // W = C^T V. + // W = Cᵀ V. - // W = C2^T. + // W = C2ᵀ. for j := 0; j < k; j++ { bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) } @@ -218,26 +218,26 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, v[(m-k)*ldv:], ldv, work, ldwork) if m > k { - // W += C1^T * V1. + // W += C1ᵀ * V1. bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V * W^T. + // C -= V * Wᵀ. if m > k { bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, -1, v, ldv, work, ldwork, 1, c, ldc) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, 1, v[(m-k)*ldv:], ldv, work, ldwork) - // C2 -= W^T. + // C2 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -246,7 +246,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C * H or C * H^T where C = (C1 C2). + // Form C * H or C * Hᵀ where C = (C1 C2). // W = C * V. // W = C2. @@ -263,18 +263,18 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) - // C -= W * V^T. + // C -= W * Vᵀ. if n > k { - // C1 -= W * V1^T. + // C1 -= W * V1ᵀ. bi.Dgemm(blas.NoTrans, blas.Trans, m, n-k, k, -1, work, ldwork, v, ldv, 1, c, ldc) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, 1, v[(n-k)*ldv:], ldv, work, ldwork) @@ -291,14 +291,14 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack if direct == lapack.Forward { // V = (V1 V2) where v1 is unit upper triangular. if side == blas.Left { - // Form H * C or H^T * C where C = (C1; C2). - // W = C^T * V^T. + // Form H * C or Hᵀ * C where C = (C1; C2). + // W = Cᵀ * Vᵀ. - // W = C1^T. + // W = C1ᵀ. for j := 0; j < k; j++ { bi.Dcopy(n, c[j*ldc:], 1, work[j:], ldwork) } - // W *= V1^T. + // W *= V1ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, 1, v, ldv, work, ldwork) @@ -307,11 +307,11 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c[k*ldc:], ldc, v[k:], ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V^T * W^T. + // C -= Vᵀ * Wᵀ. if m > k { bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, -1, v[k:], ldv, work, ldwork, @@ -321,7 +321,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, n, k, 1, v, ldv, work, ldwork) - // C1 -= W^T. + // C1 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -330,14 +330,14 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C * H or C * H^T where C = (C1 C2). - // W = C * V^T. + // Form C * H or C * Hᵀ where C = (C1 C2). + // W = C * Vᵀ. // W = C1. for j := 0; j < k; j++ { bi.Dcopy(m, c[j:], ldc, work[j:], ldwork) } - // W *= V1^T. + // W *= V1ᵀ. bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, 1, v, ldv, work, ldwork) @@ -346,7 +346,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c[k:], ldc, v[k:], ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) @@ -371,14 +371,14 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } // V = (V1 V2) where V2 is the last k columns and is lower unit triangular. if side == blas.Left { - // Form H * C or H^T C where C = (C1 ; C2). - // W = C^T * V^T. + // Form H * C or Hᵀ C where C = (C1 ; C2). + // W = Cᵀ * Vᵀ. - // W = C2^T. + // W = C2ᵀ. for j := 0; j < k; j++ { bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, 1, v[m-k:], ldv, work, ldwork) @@ -387,11 +387,11 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, 1, t, ldt, work, ldwork) - // C -= V^T * W^T. + // C -= Vᵀ * Wᵀ. if m > k { bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, -1, v, ldv, work, ldwork, @@ -401,7 +401,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, n, k, 1, v[m-k:], ldv, work, ldwork) - // C2 -= W^T. + // C2 -= Wᵀ. // TODO(btracey): This should use blas.Axpy. for i := 0; i < n; i++ { for j := 0; j < k; j++ { @@ -410,13 +410,13 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack } return } - // Form C * H or C * H^T where C = (C1 C2). - // W = C * V^T. + // Form C * H or C * Hᵀ where C = (C1 C2). + // W = C * Vᵀ. // W = C2. for j := 0; j < k; j++ { bi.Dcopy(m, c[n-k+j:], ldc, work[j:], ldwork) } - // W *= V2^T. + // W *= V2ᵀ. bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, 1, v[n-k:], ldv, work, ldwork) @@ -425,7 +425,7 @@ func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack 1, c, ldc, v, ldv, 1, work, ldwork) } - // W *= T or T^T. + // W *= T or Tᵀ. bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, 1, t, ldt, work, ldwork) diff --git a/lapack/gonum/dlarfg.go b/lapack/gonum/dlarfg.go index e037fdd6..3f614b04 100644 --- a/lapack/gonum/dlarfg.go +++ b/lapack/gonum/dlarfg.go @@ -14,9 +14,9 @@ import ( // a real elementary reflector of order n such that // H * (alpha) = (beta) // ( x) ( 0) -// H^T * H = I +// Hᵀ * H = I // H is represented in the form -// H = 1 - tau * (1; v) * (1 v^T) +// H = 1 - tau * (1; v) * (1 vᵀ) // where tau is a real scalar. // // On entry, x contains the vector x, on exit it contains v. diff --git a/lapack/gonum/dlarft.go b/lapack/gonum/dlarft.go index 8f03eb8b..1d84fb5d 100644 --- a/lapack/gonum/dlarft.go +++ b/lapack/gonum/dlarft.go @@ -12,8 +12,8 @@ import ( // Dlarft forms the triangular factor T of a block reflector H, storing the answer // in t. -// H = I - V * T * V^T if store == lapack.ColumnWise -// H = I - V^T * T * V if store == lapack.RowWise +// H = I - V * T * Vᵀ if store == lapack.ColumnWise +// H = I - Vᵀ * T * V if store == lapack.RowWise // H is defined by a product of the elementary reflectors where // H = H_0 * H_1 * ... * H_{k-1} if direct == lapack.Forward // H = H_{k-1} * ... * H_1 * H_0 if direct == lapack.Backward diff --git a/lapack/gonum/dlarfx.go b/lapack/gonum/dlarfx.go index d7928c8c..a018593f 100644 --- a/lapack/gonum/dlarfx.go +++ b/lapack/gonum/dlarfx.go @@ -11,7 +11,7 @@ import "gonum.org/v1/gonum/blas" // than 11. // // H is represented in the form -// H = I - tau * v * v^T, +// H = I - tau * v * vᵀ, // where tau is a real scalar and v is a real vector. If tau = 0, then H is // taken to be the identity matrix. // diff --git a/lapack/gonum/dlasr.go b/lapack/gonum/dlasr.go index a7dbe002..6bacca5e 100644 --- a/lapack/gonum/dlasr.go +++ b/lapack/gonum/dlasr.go @@ -12,7 +12,7 @@ import ( // Dlasr applies a sequence of plane rotations to the m×n matrix A. This series // of plane rotations is implicitly represented by a matrix P. P is multiplied // by a depending on the value of side -- A = P * A if side == lapack.Left, -// A = A * P^T if side == lapack.Right. +// A = A * Pᵀ if side == lapack.Right. // // The exact value of P depends on the value of pivot, but in all cases P is // implicitly represented by a series of 2×2 rotation matrices. The entries of diff --git a/lapack/gonum/dlasy2.go b/lapack/gonum/dlasy2.go index abfe60e5..d670f40d 100644 --- a/lapack/gonum/dlasy2.go +++ b/lapack/gonum/dlasy2.go @@ -12,10 +12,10 @@ import ( // Dlasy2 solves the Sylvester matrix equation where the matrices are of order 1 // or 2. It computes the unknown n1×n2 matrix X so that -// TL*X + sgn*X*TR = scale*B, if tranl == false and tranr == false, -// TL^T*X + sgn*X*TR = scale*B, if tranl == true and tranr == false, -// TL*X + sgn*X*TR^T = scale*B, if tranl == false and tranr == true, -// TL^T*X + sgn*X*TR^T = scale*B, if tranl == true and tranr == true, +// TL*X + sgn*X*TR = scale*B if tranl == false and tranr == false, +// TLᵀ*X + sgn*X*TR = scale*B if tranl == true and tranr == false, +// TL*X + sgn*X*TRᵀ = scale*B if tranl == false and tranr == true, +// TLᵀ*X + sgn*X*TRᵀ = scale*B if tranl == true and tranr == true, // where TL is n1×n1, TR is n2×n2, B is n1×n2, and 1 <= n1,n2 <= 2. // // isgn must be 1 or -1, and n1 and n2 must be 0, 1, or 2, but these conditions diff --git a/lapack/gonum/dlatbs.go b/lapack/gonum/dlatbs.go index 34a793ca..0d3cf9f0 100644 --- a/lapack/gonum/dlatbs.go +++ b/lapack/gonum/dlatbs.go @@ -13,7 +13,7 @@ import ( // Dlatbs solves a triangular banded system of equations // A * x = s*b if trans == blas.NoTrans -// A^T * x = s*b if trans == blas.Trans or blas.ConjTrans +// Aᵀ * x = s*b if trans == blas.Trans or blas.ConjTrans // where A is an upper or lower triangular band matrix, x and b are n-element // vectors, and s is a scaling factor chosen so that the components of x will be // less than the overflow threshold. @@ -183,7 +183,7 @@ func (Implementation) Dlatbs(uplo blas.Uplo, trans blas.Transpose, diag blas.Dia } } } else { - // Compute the growth in A^T * x = b. + // Compute the growth in Aᵀ * x = b. if diag == blas.NonUnit { // A is non-unit triangular. // @@ -336,7 +336,7 @@ skipComputeGrow: } } } else { - // Solve A^T * x = b. + // Solve Aᵀ * x = b. for j := jFirst; j != jLast; j += jInc { // Compute x[j] = b[j] - sum A[k,j]*x[k]. // k!=j @@ -426,7 +426,7 @@ skipComputeGrow: x[j] /= tjjs default: // A[j,j] == 0: Set x[0:n] = 0, x[j] = 1, and scale = 0, and - // compute a solution A^T * x = 0. + // compute a solution Aᵀ * x = 0. for i := range x[:n] { x[i] = 0 } diff --git a/lapack/gonum/dlatrd.go b/lapack/gonum/dlatrd.go index 018efc98..1e057aa3 100644 --- a/lapack/gonum/dlatrd.go +++ b/lapack/gonum/dlatrd.go @@ -11,7 +11,7 @@ import ( // Dlatrd reduces nb rows and columns of a real n×n symmetric matrix A to symmetric // tridiagonal form. It computes the orthonormal similarity transformation -// Q^T * A * Q +// Qᵀ * A * Q // and returns the matrices V and W to apply to the unreduced part of A. If // uplo == blas.Upper, the upper triangle is supplied and the last nb rows are // reduced. If uplo == blas.Lower, the lower triangle is supplied and the first @@ -51,7 +51,7 @@ import ( // // The matrix Q is represented as a product of elementary reflectors. Each reflector // H has the form -// I - tau * v * v^T +// I - tau * v * vᵀ // If uplo == blas.Upper, // Q = H_{n-1} * H_{n-2} * ... * H_{n-nb} // where v[:i-1] is stored in A[:i-1,i], v[i-1] = 1, and v[i:n] = 0. @@ -62,7 +62,7 @@ import ( // // The vectors v form the n×nb matrix V which is used with W to apply a // symmetric rank-2 update to the unreduced part of A -// A = A - V * W^T - W * V^T +// A = A - V * Wᵀ - W * Vᵀ // // Dlatrd is an internal routine. It is exported for testing purposes. func (impl Implementation) Dlatrd(uplo blas.Uplo, n, nb int, a []float64, lda int, e, tau, w []float64, ldw int) { diff --git a/lapack/gonum/dlatrs.go b/lapack/gonum/dlatrs.go index dc445c6f..73970bcf 100644 --- a/lapack/gonum/dlatrs.go +++ b/lapack/gonum/dlatrs.go @@ -14,7 +14,7 @@ import ( // Dlatrs solves a triangular system of equations scaled to prevent overflow. It // solves // A * x = scale * b if trans == blas.NoTrans -// A^T * x = scale * b if trans == blas.Trans +// Aᵀ * x = scale * b if trans == blas.Trans // where the scale s is set for numeric stability. // // A is an n×n triangular matrix. On entry, the slice x contains the values of diff --git a/lapack/gonum/dlauu2.go b/lapack/gonum/dlauu2.go index ecce22cc..24e98ddd 100644 --- a/lapack/gonum/dlauu2.go +++ b/lapack/gonum/dlauu2.go @@ -10,8 +10,8 @@ import ( ) // Dlauu2 computes the product -// U * U^T if uplo is blas.Upper -// L^T * L if uplo is blas.Lower +// U * Uᵀ if uplo is blas.Upper +// Lᵀ * L if uplo is blas.Lower // where U or L is stored in the upper or lower triangular part of A. // Only the upper or lower triangle of the result is stored, overwriting // the corresponding factor in A. @@ -37,7 +37,7 @@ func (impl Implementation) Dlauu2(uplo blas.Uplo, n int, a []float64, lda int) { bi := blas64.Implementation() if uplo == blas.Upper { - // Compute the product U*U^T. + // Compute the product U*Uᵀ. for i := 0; i < n; i++ { aii := a[i*lda+i] if i < n-1 { @@ -49,7 +49,7 @@ func (impl Implementation) Dlauu2(uplo blas.Uplo, n int, a []float64, lda int) { } } } else { - // Compute the product L^T*L. + // Compute the product Lᵀ*L. for i := 0; i < n; i++ { aii := a[i*lda+i] if i < n-1 { diff --git a/lapack/gonum/dlauum.go b/lapack/gonum/dlauum.go index 67ecaddf..995fdc05 100644 --- a/lapack/gonum/dlauum.go +++ b/lapack/gonum/dlauum.go @@ -10,8 +10,8 @@ import ( ) // Dlauum computes the product -// U * U^T if uplo is blas.Upper -// L^T * L if uplo is blas.Lower +// U * Uᵀ if uplo is blas.Upper +// Lᵀ * L if uplo is blas.Lower // where U or L is stored in the upper or lower triangular part of A. // Only the upper or lower triangle of the result is stored, overwriting // the corresponding factor in A. @@ -50,7 +50,7 @@ func (impl Implementation) Dlauum(uplo blas.Uplo, n int, a []float64, lda int) { // Use blocked code. bi := blas64.Implementation() if uplo == blas.Upper { - // Compute the product U*U^T. + // Compute the product U*Uᵀ. for i := 0; i < n; i += nb { ib := min(nb, n-i) bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.NonUnit, @@ -64,7 +64,7 @@ func (impl Implementation) Dlauum(uplo blas.Uplo, n int, a []float64, lda int) { } } } else { - // Compute the product L^T*L. + // Compute the product Lᵀ*L. for i := 0; i < n; i += nb { ib := min(nb, n-i) bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, diff --git a/lapack/gonum/dorgbr.go b/lapack/gonum/dorgbr.go index 626cad5f..8a4fe2b5 100644 --- a/lapack/gonum/dorgbr.go +++ b/lapack/gonum/dorgbr.go @@ -6,17 +6,17 @@ package gonum import "gonum.org/v1/gonum/lapack" -// Dorgbr generates one of the matrices Q or P^T computed by Dgebrd +// Dorgbr generates one of the matrices Q or Pᵀ computed by Dgebrd // computed from the decomposition Dgebrd. See Dgebd2 for the description of -// Q and P^T. +// Q and Pᵀ. // // If vect == lapack.GenerateQ, then a is assumed to have been an m×k matrix and // Q is of order m. If m >= k, then Dorgbr returns the first n columns of Q // where m >= n >= k. If m < k, then Dorgbr returns Q as an m×m matrix. // // If vect == lapack.GeneratePT, then A is assumed to have been a k×n matrix, and -// P^T is of order n. If k < n, then Dorgbr returns the first m rows of P^T, -// where n >= m >= k. If k >= n, then Dorgbr returns P^T as an n×n matrix. +// Pᵀ is of order n. If k < n, then Dorgbr returns the first m rows of Pᵀ, +// where n >= m >= k. If k >= n, then Dorgbr returns Pᵀ as an n×n matrix. // // Dorgbr is an internal routine. It is exported for testing purposes. func (impl Implementation) Dorgbr(vect lapack.GenOrtho, m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { @@ -112,12 +112,12 @@ func (impl Implementation) Dorgbr(vect lapack.GenOrtho, m, n, k int, a []float64 } } } else { - // Form P^T, determined by a call to Dgebrd to reduce a k×n matrix. + // Form Pᵀ, determined by a call to Dgebrd to reduce a k×n matrix. if k < n { impl.Dorglq(m, n, k, a, lda, tau, work, lwork) } else { // Shift the vectors which define the elementary reflectors one - // row downward, and set the first row and column of P^T to + // row downward, and set the first row and column of Pᵀ to // those of the unit matrix. a[0] = 1 for i := 1; i < n; i++ { diff --git a/lapack/gonum/dorghr.go b/lapack/gonum/dorghr.go index 6e799d10..fd65531b 100644 --- a/lapack/gonum/dorghr.go +++ b/lapack/gonum/dorghr.go @@ -15,8 +15,8 @@ package gonum // // ilo and ihi must have the same values as in the previous call of Dgehrd. It // must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo = 0, ihi = -1, if n == 0. +// 0 <= ilo <= ihi < n if n > 0, +// ilo = 0, ihi = -1 if n == 0. // // tau contains the scalar factors of the elementary reflectors, as returned by // Dgehrd. tau must have length n-1. diff --git a/lapack/gonum/dorm2r.go b/lapack/gonum/dorm2r.go index 4b0bd83c..8311f742 100644 --- a/lapack/gonum/dorm2r.go +++ b/lapack/gonum/dorm2r.go @@ -8,10 +8,10 @@ import "gonum.org/v1/gonum/blas" // Dorm2r multiplies a general matrix C by an orthogonal matrix from a QR factorization // determined by Dgeqrf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans +// C = Q * C if side == blas.Left and trans == blas.NoTrans +// C = Qᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans // If side == blas.Left, a is a matrix of size m×k, and if side == blas.Right // a is of size n×k. // diff --git a/lapack/gonum/dormbr.go b/lapack/gonum/dormbr.go index 026dc041..e1b37373 100644 --- a/lapack/gonum/dormbr.go +++ b/lapack/gonum/dormbr.go @@ -15,15 +15,15 @@ import ( // Dormbr overwrites the m×n matrix C with // Q * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.NoTrans // C * Q if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.NoTrans -// Q^T * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.Trans -// C * Q^T if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.Trans +// Qᵀ * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.Trans +// C * Qᵀ if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.Trans // // P * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.NoTrans // C * P if vect == lapack.ApplyP, side == blas.Right, and trans == blas.NoTrans -// P^T * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.Trans -// C * P^T if vect == lapack.ApplyP, side == blas.Right, and trans == blas.Trans +// Pᵀ * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.Trans +// C * Pᵀ if vect == lapack.ApplyP, side == blas.Right, and trans == blas.Trans // where P and Q are the orthogonal matrices determined by Dgebrd when reducing -// a matrix A to bidiagonal form: A = Q * B * P^T. See Dgebrd for the +// a matrix A to bidiagonal form: A = Q * B * Pᵀ. See Dgebrd for the // definitions of Q and P. // // If vect == lapack.ApplyQ, A is assumed to have been an nq×k matrix, while if diff --git a/lapack/gonum/dormhr.go b/lapack/gonum/dormhr.go index c00f4405..ac4d3ae6 100644 --- a/lapack/gonum/dormhr.go +++ b/lapack/gonum/dormhr.go @@ -7,10 +7,10 @@ package gonum import "gonum.org/v1/gonum/blas" // Dormhr multiplies an m×n general matrix C with an nq×nq orthogonal matrix Q -// Q * C, if side == blas.Left and trans == blas.NoTrans, -// Q^T * C, if side == blas.Left and trans == blas.Trans, -// C * Q, if side == blas.Right and trans == blas.NoTrans, -// C * Q^T, if side == blas.Right and trans == blas.Trans, +// Q * C if side == blas.Left and trans == blas.NoTrans, +// Qᵀ * C if side == blas.Left and trans == blas.Trans, +// C * Q if side == blas.Right and trans == blas.NoTrans, +// C * Qᵀ if side == blas.Right and trans == blas.Trans, // where nq == m if side == blas.Left and nq == n if side == blas.Right. // // Q is defined implicitly as the product of ihi-ilo elementary reflectors, as @@ -21,10 +21,10 @@ import "gonum.org/v1/gonum/blas" // // ilo and ihi must have the same values as in the previous call of Dgehrd. It // must hold that -// 0 <= ilo <= ihi < m, if m > 0 and side == blas.Left, -// ilo = 0 and ihi = -1, if m = 0 and side == blas.Left, -// 0 <= ilo <= ihi < n, if n > 0 and side == blas.Right, -// ilo = 0 and ihi = -1, if n = 0 and side == blas.Right. +// 0 <= ilo <= ihi < m if m > 0 and side == blas.Left, +// ilo = 0 and ihi = -1 if m = 0 and side == blas.Left, +// 0 <= ilo <= ihi < n if n > 0 and side == blas.Right, +// ilo = 0 and ihi = -1 if n = 0 and side == blas.Right. // // a and lda represent an m×m matrix if side == blas.Left and an n×n matrix if // side == blas.Right. The matrix contains vectors which define the elementary diff --git a/lapack/gonum/dorml2.go b/lapack/gonum/dorml2.go index 25aa83ac..df474ca4 100644 --- a/lapack/gonum/dorml2.go +++ b/lapack/gonum/dorml2.go @@ -8,10 +8,10 @@ import "gonum.org/v1/gonum/blas" // Dorml2 multiplies a general matrix C by an orthogonal matrix from an LQ factorization // determined by Dgelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans +// C = Q * C if side == blas.Left and trans == blas.NoTrans +// C = Qᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans // If side == blas.Left, a is a matrix of side k×m, and if side == blas.Right // a is of size k×n. // diff --git a/lapack/gonum/dormlq.go b/lapack/gonum/dormlq.go index 6fcfc2fb..a86a8a56 100644 --- a/lapack/gonum/dormlq.go +++ b/lapack/gonum/dormlq.go @@ -11,10 +11,10 @@ import ( // Dormlq multiplies the matrix C by the orthogonal matrix Q defined by the // slices a and tau. A and tau are as returned from Dgelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans +// C = Q * C if side == blas.Left and trans == blas.NoTrans +// C = Qᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans // If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right // A is of size k×n. This uses a blocked algorithm. // diff --git a/lapack/gonum/dormqr.go b/lapack/gonum/dormqr.go index 8ae45086..ae67de5f 100644 --- a/lapack/gonum/dormqr.go +++ b/lapack/gonum/dormqr.go @@ -10,10 +10,10 @@ import ( ) // Dormqr multiplies an m×n matrix C by an orthogonal matrix Q as -// C = Q * C, if side == blas.Left and trans == blas.NoTrans, -// C = Q^T * C, if side == blas.Left and trans == blas.Trans, -// C = C * Q, if side == blas.Right and trans == blas.NoTrans, -// C = C * Q^T, if side == blas.Right and trans == blas.Trans, +// C = Q * C if side == blas.Left and trans == blas.NoTrans, +// C = Qᵀ * C if side == blas.Left and trans == blas.Trans, +// C = C * Q if side == blas.Right and trans == blas.NoTrans, +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans, // where Q is defined as the product of k elementary reflectors // Q = H_0 * H_1 * ... * H_{k-1}. // diff --git a/lapack/gonum/dormr2.go b/lapack/gonum/dormr2.go index bb03f32c..4bf0d879 100644 --- a/lapack/gonum/dormr2.go +++ b/lapack/gonum/dormr2.go @@ -8,10 +8,10 @@ import "gonum.org/v1/gonum/blas" // Dormr2 multiplies a general matrix C by an orthogonal matrix from a RQ factorization // determined by Dgerqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans +// C = Q * C if side == blas.Left and trans == blas.NoTrans +// C = Qᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans // If side == blas.Left, a is a matrix of size k×m, and if side == blas.Right // a is of size k×n. // diff --git a/lapack/gonum/dpbcon.go b/lapack/gonum/dpbcon.go index 5fedad8e..f55a596c 100644 --- a/lapack/gonum/dpbcon.go +++ b/lapack/gonum/dpbcon.go @@ -14,8 +14,8 @@ import ( // Dpbcon returns an estimate of the reciprocal of the condition number (in the // 1-norm) of an n×n symmetric positive definite band matrix using the Cholesky // factorization -// A = U^T*U if uplo == blas.Upper -// A = L*L^T if uplo == blas.Lower +// A = Uᵀ*U if uplo == blas.Upper +// A = L*Lᵀ if uplo == blas.Lower // computed by Dpbtrf. The estimate is obtained for norm(inv(A)), and the // reciprocal of the condition number is computed as // rcond = 1 / (anorm * norm(inv(A))). @@ -77,14 +77,14 @@ func (impl Implementation) Dpbcon(uplo blas.Uplo, n, kd int, ab []float64, ldab } var op1, op2 blas.Transpose if uplo == blas.Upper { - // Multiply x by inv(U^T), + // Multiply x by inv(Uᵀ), op1 = blas.Trans - // then by inv(U^T). + // then by inv(Uᵀ). op2 = blas.NoTrans } else { // Multiply x by inv(L), op1 = blas.NoTrans - // then by inv(L^T). + // then by inv(Lᵀ). op2 = blas.Trans } scaleL := impl.Dlatbs(uplo, op1, blas.NonUnit, normin, n, kd, ab, ldab, x, cnorm) diff --git a/lapack/gonum/dpbtf2.go b/lapack/gonum/dpbtf2.go index ba93803c..e54bc46f 100644 --- a/lapack/gonum/dpbtf2.go +++ b/lapack/gonum/dpbtf2.go @@ -14,8 +14,8 @@ import ( // Dpbtf2 computes the Cholesky factorization of a symmetric positive banded // matrix ab. The matrix ab is n×n with kd diagonal bands. The Cholesky // factorization computed is -// A = U^T * U if ul == blas.Upper -// A = L * L^T if ul == blas.Lower +// A = Uᵀ * U if ul == blas.Upper +// A = L * Lᵀ if ul == blas.Lower // ul also specifies the storage of ab. If ul == blas.Upper, then // ab is stored as an upper-triangular banded matrix with kd super-diagonals, // and if ul == blas.Lower, ab is stored as a lower-triangular banded matrix @@ -72,7 +72,7 @@ func (Implementation) Dpbtf2(uplo blas.Uplo, n, kd int, ab []float64, ldab int) kld := max(1, ldab-1) if uplo == blas.Upper { - // Compute the Cholesky factorization A = U^T * U. + // Compute the Cholesky factorization A = Uᵀ * U. for j := 0; j < n; j++ { // Compute U(j,j) and test for non-positive-definiteness. ajj := ab[j*ldab] @@ -91,7 +91,7 @@ func (Implementation) Dpbtf2(uplo blas.Uplo, n, kd int, ab []float64, ldab int) } return true } - // Compute the Cholesky factorization A = L * L^T. + // Compute the Cholesky factorization A = L * Lᵀ. for j := 0; j < n; j++ { // Compute L(j,j) and test for non-positive-definiteness. ajj := ab[j*ldab+kd] diff --git a/lapack/gonum/dpbtrf.go b/lapack/gonum/dpbtrf.go index 39800a54..d8814cdb 100644 --- a/lapack/gonum/dpbtrf.go +++ b/lapack/gonum/dpbtrf.go @@ -11,8 +11,8 @@ import ( // Dpbtrf computes the Cholesky factorization of an n×n symmetric positive // definite band matrix -// A = U^T * U if uplo == blas.Upper -// A = L * L^T if uplo == blas.Lower +// A = Uᵀ * U if uplo == blas.Upper +// A = L * Lᵀ if uplo == blas.Lower // where U is an upper triangular band matrix and L is lower triangular. kd is // the number of super- or sub-diagonals of A. // diff --git a/lapack/gonum/dpbtrs.go b/lapack/gonum/dpbtrs.go index b401ea7f..ce6eb7ff 100644 --- a/lapack/gonum/dpbtrs.go +++ b/lapack/gonum/dpbtrs.go @@ -11,8 +11,8 @@ import ( // Dpbtrs solves a system of linear equations A*X = B with an n×n symmetric // positive definite band matrix A using the Cholesky factorization -// A = U^T * U if uplo == blas.Upper -// A = L * L^T if uplo == blas.Lower +// A = Uᵀ * U if uplo == blas.Upper +// A = L * Lᵀ if uplo == blas.Lower // computed by Dpbtrf. kd is the number of super- or sub-diagonals of A. See the // documentation for Dpbtrf for a description of the band storage format of A. // @@ -48,19 +48,19 @@ func (Implementation) Dpbtrs(uplo blas.Uplo, n, kd, nrhs int, ab []float64, ldab bi := blas64.Implementation() if uplo == blas.Upper { - // Solve A*X = B where A = U^T*U. + // Solve A*X = B where A = Uᵀ*U. for j := 0; j < nrhs; j++ { - // Solve U^T*Y = B, overwriting B with Y. + // Solve Uᵀ*Y = B, overwriting B with Y. bi.Dtbsv(blas.Upper, blas.Trans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) // Solve U*X = Y, overwriting Y with X. bi.Dtbsv(blas.Upper, blas.NoTrans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) } } else { - // Solve A*X = B where A = L*L^T. + // Solve A*X = B where A = L*Lᵀ. for j := 0; j < nrhs; j++ { // Solve L*Y = B, overwriting B with Y. bi.Dtbsv(blas.Lower, blas.NoTrans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) - // Solve L^T*X = Y, overwriting Y with X. + // Solve Lᵀ*X = Y, overwriting Y with X. bi.Dtbsv(blas.Lower, blas.Trans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) } } diff --git a/lapack/gonum/dpotf2.go b/lapack/gonum/dpotf2.go index 5d3327c2..83411f1c 100644 --- a/lapack/gonum/dpotf2.go +++ b/lapack/gonum/dpotf2.go @@ -13,7 +13,7 @@ import ( // Dpotf2 computes the Cholesky decomposition of the symmetric positive definite // matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, -// and a = U^T U is stored in place into a. If ul == blas.Lower, then a = L L^T +// and a = Uᵀ U is stored in place into a. If ul == blas.Lower, then a = L Lᵀ // is computed and stored in-place into a. If a is not positive definite, false // is returned. This is the unblocked version of the algorithm. // diff --git a/lapack/gonum/dpotrf.go b/lapack/gonum/dpotrf.go index 21241687..7c816801 100644 --- a/lapack/gonum/dpotrf.go +++ b/lapack/gonum/dpotrf.go @@ -11,7 +11,7 @@ import ( // Dpotrf computes the Cholesky decomposition of the symmetric positive definite // matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, -// and a = U^T U is stored in place into a. If ul == blas.Lower, then a = L L^T +// and a = Uᵀ U is stored in place into a. If ul == blas.Lower, then a = L Lᵀ // is computed and stored in-place into a. If a is not positive definite, false // is returned. This is the blocked version of the algorithm. func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) { diff --git a/lapack/gonum/dpotri.go b/lapack/gonum/dpotri.go index 2394775c..6fa981c1 100644 --- a/lapack/gonum/dpotri.go +++ b/lapack/gonum/dpotri.go @@ -10,7 +10,7 @@ import "gonum.org/v1/gonum/blas" // using its Cholesky factorization. // // On entry, a contains the triangular factor U or L from the Cholesky -// factorization A = U^T*U or A = L*L^T, as computed by Dpotrf. +// factorization A = Uᵀ*U or A = L*Lᵀ, as computed by Dpotrf. // On return, a contains the upper or lower triangle of the (symmetric) // inverse of A, overwriting the input factor U or L. func (impl Implementation) Dpotri(uplo blas.Uplo, n int, a []float64, lda int) (ok bool) { @@ -38,7 +38,7 @@ func (impl Implementation) Dpotri(uplo blas.Uplo, n int, a []float64, lda int) ( return false } - // Form inv(U)*inv(U)^T or inv(L)^T*inv(L). + // Form inv(U)*inv(U)ᵀ or inv(L)ᵀ*inv(L). impl.Dlauum(uplo, n, a, lda) return true } diff --git a/lapack/gonum/dpotrs.go b/lapack/gonum/dpotrs.go index 689e0439..8977013d 100644 --- a/lapack/gonum/dpotrs.go +++ b/lapack/gonum/dpotrs.go @@ -12,8 +12,8 @@ import ( // Dpotrs solves a system of n linear equations A*X = B where A is an n×n // symmetric positive definite matrix and B is an n×nrhs matrix. The matrix A is // represented by its Cholesky factorization -// A = U^T*U if uplo == blas.Upper -// A = L*L^T if uplo == blas.Lower +// A = Uᵀ*U if uplo == blas.Upper +// A = L*Lᵀ if uplo == blas.Lower // as computed by Dpotrf. On entry, B contains the right-hand side matrix B, on // return it contains the solution matrix X. func (Implementation) Dpotrs(uplo blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) { @@ -45,18 +45,18 @@ func (Implementation) Dpotrs(uplo blas.Uplo, n, nrhs int, a []float64, lda int, bi := blas64.Implementation() if uplo == blas.Upper { - // Solve U^T * U * X = B where U is stored in the upper triangle of A. + // Solve Uᵀ * U * X = B where U is stored in the upper triangle of A. - // Solve U^T * X = B, overwriting B with X. + // Solve Uᵀ * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) // Solve U * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Upper, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) } else { - // Solve L * L^T * X = B where L is stored in the lower triangle of A. + // Solve L * Lᵀ * X = B where L is stored in the lower triangle of A. // Solve L * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve L^T * X = B, overwriting B with X. + // Solve Lᵀ * X = B, overwriting B with X. bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) } } diff --git a/lapack/gonum/dsytd2.go b/lapack/gonum/dsytd2.go index 23cfd057..8658f4e5 100644 --- a/lapack/gonum/dsytd2.go +++ b/lapack/gonum/dsytd2.go @@ -11,7 +11,7 @@ import ( // Dsytd2 reduces a symmetric n×n matrix A to symmetric tridiagonal form T by // an orthogonal similarity transformation -// Q^T * A * Q = T +// Qᵀ * A * Q = T // On entry, the matrix is contained in the specified triangle of a. On exit, // if uplo == blas.Upper, the diagonal and first super-diagonal of a are // overwritten with the elements of T. The elements above the first super-diagonal @@ -28,7 +28,7 @@ import ( // and if uplo == blas.Lower // Q = H_0 * H_1 * ... * H_{n-2} // where -// H_i = I - tau * v * v^T +// H_i = I - tau * v * vᵀ // where tau is stored in tau[i], and v is stored in a. // // If uplo == blas.Upper, v[0:i-1] is stored in A[0:i-1,i+1], v[i] = 1, and @@ -79,7 +79,7 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d if uplo == blas.Upper { // Reduce the upper triangle of A. for i := n - 2; i >= 0; i-- { - // Generate elementary reflector H_i = I - tau * v * v^T to + // Generate elementary reflector H_i = I - tau * v * vᵀ to // annihilate A[i:i-1, i+1]. var taui float64 a[i*lda+i+1], taui = impl.Dlarfg(i+1, a[i*lda+i+1], a[i+1:], lda) @@ -91,12 +91,12 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d // Compute x := tau * A * v storing x in tau[0:i]. bi.Dsymv(uplo, i+1, taui, a, lda, a[i+1:], lda, 0, tau, 1) - // Compute w := x - 1/2 * tau * (x^T * v) * v. + // Compute w := x - 1/2 * tau * (xᵀ * v) * v. alpha := -0.5 * taui * bi.Ddot(i+1, tau, 1, a[i+1:], lda) bi.Daxpy(i+1, alpha, a[i+1:], lda, tau, 1) // Apply the transformation as a rank-2 update - // A = A - v * w^T - w * v^T. + // A = A - v * wᵀ - w * vᵀ. bi.Dsyr2(uplo, i+1, -1, a[i+1:], lda, tau, 1, a, lda) a[i*lda+i+1] = e[i] } @@ -108,7 +108,7 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d } // Reduce the lower triangle of A. for i := 0; i < n-1; i++ { - // Generate elementary reflector H_i = I - tau * v * v^T to + // Generate elementary reflector H_i = I - tau * v * vᵀ to // annihilate A[i+2:n, i]. var taui float64 a[(i+1)*lda+i], taui = impl.Dlarfg(n-i-1, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) @@ -120,12 +120,12 @@ func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d // Compute x := tau * A * v, storing y in tau[i:n-1]. bi.Dsymv(uplo, n-i-1, taui, a[(i+1)*lda+i+1:], lda, a[(i+1)*lda+i:], lda, 0, tau[i:], 1) - // Compute w := x - 1/2 * tau * (x^T * v) * v. + // Compute w := x - 1/2 * tau * (xᵀ * v) * v. alpha := -0.5 * taui * bi.Ddot(n-i-1, tau[i:], 1, a[(i+1)*lda+i:], lda) bi.Daxpy(n-i-1, alpha, a[(i+1)*lda+i:], lda, tau[i:], 1) // Apply the transformation as a rank-2 update - // A = A - v * w^T - w * v^T. + // A = A - v * wᵀ - w * vᵀ. bi.Dsyr2(uplo, n-i-1, -1, a[(i+1)*lda+i:], lda, tau[i:], 1, a[(i+1)*lda+i+1:], lda) a[(i+1)*lda+i] = e[i] } diff --git a/lapack/gonum/dsytrd.go b/lapack/gonum/dsytrd.go index df47568e..262a56c9 100644 --- a/lapack/gonum/dsytrd.go +++ b/lapack/gonum/dsytrd.go @@ -11,7 +11,7 @@ import ( // Dsytrd reduces a symmetric n×n matrix A to symmetric tridiagonal form by an // orthogonal similarity transformation -// Q^T * A * Q = T +// Qᵀ * A * Q = T // where Q is an orthonormal matrix and T is symmetric and tridiagonal. // // On entry, a contains the elements of the input matrix in the triangle specified @@ -23,7 +23,7 @@ import ( // If uplo == blas.Upper, Q is constructed with // Q = H_{n-2} * ... * H_1 * H_0 // where -// H_i = I - tau_i * v * v^T +// H_i = I - tau_i * v * vᵀ // v is constructed as v[i+1:n] = 0, v[i] = 1, v[0:i-1] is stored in A[0:i-1, i+1]. // The elements of A are // [ d e v1 v2 v3] @@ -35,7 +35,7 @@ import ( // If uplo == blas.Lower, Q is constructed with // Q = H_0 * H_1 * ... * H_{n-2} // where -// H_i = I - tau_i * v * v^T +// H_i = I - tau_i * v * vᵀ // v is constructed as v[0:i+1] = 0, v[i+1] = 1, v[i+2:n] is stored in A[i+2:n, i]. // The elements of A are // [ d ] @@ -134,7 +134,7 @@ func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d impl.Dlatrd(uplo, i+nb, nb, a, lda, e, tau, work, ldwork) // Update the unreduced submatrix A[0:i-1,0:i-1], using an update - // of the form A = A - V*W^T - W*V^T. + // of the form A = A - V*Wᵀ - W*Vᵀ. bi.Dsyr2k(uplo, blas.NoTrans, i, nb, -1, a[i:], lda, work, ldwork, 1, a, lda) // Copy superdiagonal elements back into A, and diagonal elements into D. @@ -155,7 +155,7 @@ func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d impl.Dlatrd(uplo, n-i, nb, a[i*lda+i:], lda, e[i:], tau[i:], work, ldwork) // Update the unreduced submatrix A[i+ib:n, i+ib:n], using an update - // of the form A = A + V*W^T - W*V^T. + // of the form A = A + V*Wᵀ - W*Vᵀ. bi.Dsyr2k(uplo, blas.NoTrans, n-i-nb, nb, -1, a[(i+nb)*lda+i:], lda, work[nb*ldwork:], ldwork, 1, a[(i+nb)*lda+i+nb:], lda) diff --git a/lapack/gonum/dtgsja.go b/lapack/gonum/dtgsja.go index d70d1962..3628ca62 100644 --- a/lapack/gonum/dtgsja.go +++ b/lapack/gonum/dtgsja.go @@ -38,7 +38,7 @@ import ( // // On exit, // -// U^T*A*Q = D1*[ 0 R ], V^T*B*Q = D2*[ 0 R ], +// Uᵀ*A*Q = D1*[ 0 R ], Vᵀ*B*Q = D2*[ 0 R ], // // where U, V and Q are orthogonal matrices. // R is a non-singular upper triangular matrix, and D1 and D2 are @@ -103,7 +103,7 @@ import ( // min(l,m-k)×l triangular or trapezoidal matrix A23 and l×l // matrix B13 to the form: // -// U1^T*A13*Q1 = C1*R1; V1^T*B13*Q1 = S1*R1, +// U1ᵀ*A13*Q1 = C1*R1; V1ᵀ*B13*Q1 = S1*R1, // // where U1, V1 and Q1 are orthogonal matrices. C1 and S1 are diagonal // matrices satisfying @@ -263,12 +263,12 @@ func (impl Implementation) Dtgsja(jobU, jobV, jobQ lapack.GSVDJob, m, p, n, k, l csu, snu, csv, snv, csq, snq := impl.Dlags2(upper, a1, a2, a3, b1, b2, b3) - // Update (k+i)-th and (k+j)-th rows of matrix A: U^T*A. + // Update (k+i)-th and (k+j)-th rows of matrix A: Uᵀ*A. if k+j < m { bi.Drot(l, a[(k+j)*lda+n-l:], 1, a[(k+i)*lda+n-l:], 1, csu, snu) } - // Update i-th and j-th rows of matrix B: V^T*B. + // Update i-th and j-th rows of matrix B: Vᵀ*B. bi.Drot(l, b[j*ldb+n-l:], 1, b[i*ldb+n-l:], 1, csv, snv) // Update (n-l+i)-th and (n-l+j)-th columns of matrices diff --git a/lapack/gonum/dtrevc3.go b/lapack/gonum/dtrevc3.go index 17121b8d..0b0ee9b8 100644 --- a/lapack/gonum/dtrevc3.go +++ b/lapack/gonum/dtrevc3.go @@ -15,14 +15,14 @@ import ( // Dtrevc3 computes some or all of the right and/or left eigenvectors of an n×n // upper quasi-triangular matrix T in Schur canonical form. Matrices of this // type are produced by the Schur factorization of a real general matrix A -// A = Q T Q^T, +// A = Q T Qᵀ, // as computed by Dhseqr. // // The right eigenvector x of T corresponding to an // eigenvalue λ is defined by // T x = λ x, // and the left eigenvector y is defined by -// y^T T = λ y^T. +// yᵀ T = λ yᵀ. // // The eigenvalues are read directly from the diagonal blocks of T. // @@ -614,7 +614,7 @@ leftev: b[k*ldb+iv] = -t[ki*ldt+k] } // Solve transposed quasi-triangular system: - // [ T[ki+1:n,ki+1:n] - wr ]^T * X = scale*b + // [ T[ki+1:n,ki+1:n] - wr ]ᵀ * X = scale*b vmax := 1.0 vcrit := bignum for j := ki + 1; j < n; { @@ -629,7 +629,7 @@ leftev: vmax = 1 } b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) - // Solve [ T[j,j] - wr ]^T * X = b. + // Solve [ T[j,j] - wr ]ᵀ * X = b. scale, _, _ := impl.Dlaln2(false, 1, 1, smin, 1, t[j*ldt+j:], ldt, 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:1], 2) // Scale if necessary. @@ -653,8 +653,8 @@ leftev: b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j+1:], ldt, b[(ki+1)*ldb+iv:], ldb) // Solve - // [ T[j,j]-wr T[j,j+1] ]^T * X = scale*[ b1 ] - // [ T[j+1,j] T[j+1,j+1]-wr ] [ b2 ] + // [ T[j,j]-wr T[j,j+1] ]ᵀ * X = scale*[ b1 ] + // [ T[j+1,j] T[j+1,j+1]-wr ] [ b2 ] scale, _, _ := impl.Dlaln2(true, 2, 1, smin, 1, t[j*ldt+j:], ldt, 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:3], 2) // Scale if necessary. @@ -702,8 +702,8 @@ leftev: // Complex left eigenvector. // Initial solve: - // [ [ T[ki,ki] T[ki,ki+1] ]^T - (wr - i* wi) ]*X = 0. - // [ [ T[ki+1,ki] T[ki+1,ki+1] ] ] + // [ [ T[ki,ki] T[ki,ki+1] ]ᵀ - (wr - i* wi) ]*X = 0. + // [ [ T[ki+1,ki] T[ki+1,ki+1] ] ] if math.Abs(t[ki*ldt+ki+1]) >= math.Abs(t[(ki+1)*ldt+ki]) { b[ki*ldb+iv] = wi / t[ki*ldt+ki+1] b[(ki+1)*ldb+iv+1] = 1 @@ -719,7 +719,7 @@ leftev: b[k*ldb+iv+1] = -b[(ki+1)*ldb+iv+1] * t[(ki+1)*ldt+k] } // Solve transposed quasi-triangular system: - // [ T[ki+2:n,ki+2:n]^T - (wr-i*wi) ]*X = b1+i*b2 + // [ T[ki+2:n,ki+2:n]ᵀ - (wr-i*wi) ]*X = b1+i*b2 vmax := 1.0 vcrit := bignum for j := ki + 2; j < n; { @@ -765,8 +765,8 @@ leftev: b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv:], ldb) b[(j+1)*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv+1:], ldb) // Solve 2×2 complex linear equation - // [ [T[j,j] T[j,j+1] ]^T - (wr-i*wi)*I ]*X = scale*b - // [ [T[j+1,j] T[j+1,j+1]] ] + // [ [T[j,j] T[j,j+1] ]ᵀ - (wr-i*wi)*I ]*X = scale*b + // [ [T[j+1,j] T[j+1,j+1]] ] scale, _, _ := impl.Dlaln2(true, 2, 2, smin, 1, t[j*ldt+j:], ldt, 1, 1, b[j*ldb+iv:], ldb, wr, -wi, x[:], 2) // Scale if necessary. diff --git a/lapack/gonum/dtrexc.go b/lapack/gonum/dtrexc.go index 9f3f90ba..d063872a 100644 --- a/lapack/gonum/dtrexc.go +++ b/lapack/gonum/dtrexc.go @@ -7,7 +7,7 @@ package gonum import "gonum.org/v1/gonum/lapack" // Dtrexc reorders the real Schur factorization of a n×n real matrix -// A = Q*T*Q^T +// A = Q*T*Qᵀ // so that the diagonal block of T with row index ifst is moved to row ilst. // // On entry, T must be in Schur canonical form, that is, block upper triangular @@ -15,7 +15,7 @@ import "gonum.org/v1/gonum/lapack" // elements equal and its off-diagonal elements of opposite sign. // // On return, T will be reordered by an orthogonal similarity transformation Z -// as Z^T*T*Z, and will be again in Schur canonical form. +// as Zᵀ*T*Z, and will be again in Schur canonical form. // // If compq is lapack.UpdateSchur, on return the matrix Q of Schur vectors will be // updated by post-multiplying it with Z. diff --git a/lapack/gonum/dtrtrs.go b/lapack/gonum/dtrtrs.go index 1752dc5c..2145fbd5 100644 --- a/lapack/gonum/dtrtrs.go +++ b/lapack/gonum/dtrtrs.go @@ -9,7 +9,7 @@ import ( "gonum.org/v1/gonum/blas/blas64" ) -// Dtrtrs solves a triangular system of the form A * X = B or A^T * X = B. Dtrtrs +// Dtrtrs solves a triangular system of the form A * X = B or Aᵀ * X = B. Dtrtrs // returns whether the solve completed successfully. If A is singular, no solve is performed. func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) { switch { diff --git a/lapack/lapack.go b/lapack/lapack.go index eef14c17..da55fd9d 100644 --- a/lapack/lapack.go +++ b/lapack/lapack.go @@ -93,15 +93,15 @@ const ( type ApplyOrtho byte const ( - ApplyP ApplyOrtho = 'P' // Apply P or P^T. - ApplyQ ApplyOrtho = 'Q' // Apply Q or Q^T. + ApplyP ApplyOrtho = 'P' // Apply P or Pᵀ. + ApplyQ ApplyOrtho = 'Q' // Apply Q or Qᵀ. ) // GenOrtho specifies which orthogonal matrix is generated in Dorgbr. type GenOrtho byte const ( - GeneratePT GenOrtho = 'P' // Generate P^T. + GeneratePT GenOrtho = 'P' // Generate Pᵀ. GenerateQ GenOrtho = 'Q' // Generate Q. ) diff --git a/lapack/lapack64/lapack64.go b/lapack/lapack64/lapack64.go index 208ee1f4..0aa76b6a 100644 --- a/lapack/lapack64/lapack64.go +++ b/lapack/lapack64/lapack64.go @@ -28,8 +28,8 @@ func max(a, b int) int { // Potrf computes the Cholesky factorization of a. // The factorization has the form -// A = U^T * U if a.Uplo == blas.Upper, or -// A = L * L^T if a.Uplo == blas.Lower, +// A = Uᵀ * U if a.Uplo == blas.Upper, or +// A = L * Lᵀ if a.Uplo == blas.Lower, // where U is an upper triangular matrix and L is lower triangular. // The triangular matrix is returned in t, and the underlying data between // a and t is shared. The returned bool indicates whether a is positive @@ -48,7 +48,7 @@ func Potrf(a blas64.Symmetric) (t blas64.Triangular, ok bool) { // using its Cholesky factorization. // // On entry, t contains the triangular factor U or L from the Cholesky -// factorization A = U^T*U or A = L*L^T, as computed by Potrf. +// factorization A = Uᵀ*U or A = L*Lᵀ, as computed by Potrf. // // On return, the upper or lower triangle of the (symmetric) inverse of A is // stored in t, overwriting the input factor U or L, and also returned in a. The @@ -66,7 +66,7 @@ func Potri(t blas64.Triangular) (a blas64.Symmetric, ok bool) { // Potrs solves a system of n linear equations A*X = B where A is an n×n // symmetric positive definite matrix and B is an n×nrhs matrix, using the -// Cholesky factorization A = U^T*U or A = L*L^T. t contains the corresponding +// Cholesky factorization A = Uᵀ*U or A = L*Lᵀ. t contains the corresponding // triangular factor as returned by Potrf. On entry, B contains the right-hand // side matrix B, on return it contains the solution matrix X. func Potrs(t blas64.Triangular, b blas64.General) { @@ -99,7 +99,7 @@ func Gecon(norm lapack.MatrixNorm, a blas64.General, anorm float64, work []float // 2. If m < n and trans == blas.NoTrans, Gels finds the minimum norm solution of // A * X = B. // 3. If m >= n and trans == blas.Trans, Gels finds the minimum norm solution of -// A^T * X = B. +// Aᵀ * X = B. // 4. If m < n and trans == blas.Trans, Gels finds X such that || A*X - B||_2 // is minimized. // Note that the least-squares solutions (cases 1 and 3) perform the minimization @@ -133,7 +133,7 @@ func Gels(trans blas.Transpose, a blas64.General, b blas64.General, work []float // v[j] = 0 j < i // v[j] = 1 j == i // v[j] = a[j*lda+i] j > i -// and computing H_i = I - tau[i] * v * v^T. +// and computing H_i = I - tau[i] * v * vᵀ. // // The orthonormal matrix Q can be constucted from a product of these elementary // reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). @@ -170,7 +170,7 @@ func Gelqf(a blas64.General, tau, work []float64, lwork int) { // Gesvd computes the singular value decomposition of the input matrix A. // // The singular value decomposition is -// A = U * Sigma * V^T +// A = U * Sigma * Vᵀ // where Sigma is an m×n diagonal matrix containing the singular values of A, // U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first // min(m,n) columns of U and V are the left and right singular vectors of A @@ -182,7 +182,7 @@ func Gelqf(a blas64.General, tau, work []float64, lwork int) { // jobU == lapack.SVDStore The first min(m,n) columns are returned in u // jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a // jobU == lapack.SVDNone The columns of U are not computed. -// The behavior is the same for jobVT and the rows of V^T. At most one of jobU +// The behavior is the same for jobVT and the rows of Vᵀ. At most one of jobU // and jobVT can equal lapack.SVDOverwrite, and Gesvd will panic otherwise. // // On entry, a contains the data for the m×n matrix A. During the call to Gesvd @@ -252,8 +252,8 @@ func Getri(a blas64.General, ipiv []int, work []float64, lwork int) (ok bool) { // Getrs solves a system of equations using an LU factorization. // The system of equations solved is -// A * X = B if trans == blas.Trans -// A^T * X = B if trans == blas.NoTrans +// A * X = B if trans == blas.Trans +// Aᵀ * X = B if trans == blas.NoTrans // A is a general n×n matrix with stride lda. B is a general matrix of size n×nrhs. // // On entry b contains the elements of the matrix B. On exit, b contains the @@ -267,13 +267,13 @@ func Getrs(trans blas.Transpose, a blas64.General, b blas64.General, ipiv []int) // Ggsvd3 computes the generalized singular value decomposition (GSVD) // of an m×n matrix A and p×n matrix B: -// U^T*A*Q = D1*[ 0 R ] +// Uᵀ*A*Q = D1*[ 0 R ] // -// V^T*B*Q = D2*[ 0 R ] +// Vᵀ*B*Q = D2*[ 0 R ] // where U, V and Q are orthogonal matrices. // // Ggsvd3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. +// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. // R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and // D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following // structures, respectively: @@ -410,10 +410,10 @@ func Lapmt(forward bool, x blas64.General, k []int) { // Ormlq multiplies the matrix C by the othogonal matrix Q defined by // A and tau. A and tau are as returned from Gelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans +// C = Q * C if side == blas.Left and trans == blas.NoTrans +// C = Qᵀ * C if side == blas.Left and trans == blas.Trans +// C = C * Q if side == blas.Right and trans == blas.NoTrans +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans // If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right // A is of size k×n. This uses a blocked algorithm. // @@ -431,10 +431,10 @@ func Ormlq(side blas.Side, trans blas.Transpose, a blas64.General, tau []float64 } // Ormqr multiplies an m×n matrix C by an orthogonal matrix Q as -// C = Q * C, if side == blas.Left and trans == blas.NoTrans, -// C = Q^T * C, if side == blas.Left and trans == blas.Trans, -// C = C * Q, if side == blas.Right and trans == blas.NoTrans, -// C = C * Q^T, if side == blas.Right and trans == blas.Trans, +// C = Q * C if side == blas.Left and trans == blas.NoTrans, +// C = Qᵀ * C if side == blas.Left and trans == blas.Trans, +// C = C * Q if side == blas.Right and trans == blas.NoTrans, +// C = C * Qᵀ if side == blas.Right and trans == blas.Trans, // where Q is defined as the product of k elementary reflectors // Q = H_0 * H_1 * ... * H_{k-1}. // @@ -512,7 +512,7 @@ func Trtri(a blas64.Triangular) (ok bool) { return lapack64.Dtrtri(a.Uplo, a.Diag, a.N, a.Data, max(1, a.Stride)) } -// Trtrs solves a triangular system of the form A * X = B or A^T * X = B. Trtrs +// Trtrs solves a triangular system of the form A * X = B or Aᵀ * X = B. Trtrs // returns whether the solve completed successfully. If A is singular, no solve is performed. func Trtrs(trans blas.Transpose, a blas64.Triangular, b blas64.General) (ok bool) { return lapack64.Dtrtrs(a.Uplo, trans, a.Diag, a.N, b.Cols, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride)) @@ -525,8 +525,8 @@ func Trtrs(trans blas.Transpose, a blas64.Triangular, b blas64.General) (ok bool // is defined by // A v_j = λ_j v_j, // and the left eigenvector u_j corresponding to an eigenvalue λ_j is defined by -// u_j^H A = λ_j u_j^H, -// where u_j^H is the conjugate transpose of u_j. +// u_jᴴ A = λ_j u_jᴴ, +// where u_jᴴ is the conjugate transpose of u_j. // // On return, A will be overwritten and the left and right eigenvectors will be // stored, respectively, in the columns of the n×n matrices VL and VR in the diff --git a/lapack/testlapack/dbdsqr.go b/lapack/testlapack/dbdsqr.go index 71bbc879..96db930b 100644 --- a/lapack/testlapack/dbdsqr.go +++ b/lapack/testlapack/dbdsqr.go @@ -76,7 +76,7 @@ func DbdsqrTest(t *testing.T, impl Dbdsqrer) { // First test the decomposition of the bidiagonal matrix. Set // pt and u equal to I with the correct size. At the result - // of Dbdsqr, p and u will contain the data of P^T and Q, which + // of Dbdsqr, p and u will contain the data of Pᵀ and Q, which // will be used in the next step to test the multiplication // with Q and VT. @@ -133,7 +133,7 @@ func DbdsqrTest(t *testing.T, impl Dbdsqrer) { t.Errorf("D is not sorted. %s", errStr) } - // The above computed the real P and Q. Now input data for V^T, + // The above computed the real P and Q. Now input data for Vᵀ, // U, and C to check that the multiplications happen properly. dAns := make([]float64, len(d)) copy(dAns, d) diff --git a/lapack/testlapack/dgebal.go b/lapack/testlapack/dgebal.go index d41bd0c7..2818270d 100644 --- a/lapack/testlapack/dgebal.go +++ b/lapack/testlapack/dgebal.go @@ -151,7 +151,7 @@ func testDgebal(t *testing.T, impl Dgebaler, job lapack.BalanceJob, a blas64.Gen blas64.Swap(blas64.Vector{N: n, Data: p.Data[j:], Inc: p.Stride}, blas64.Vector{N: n, Data: p.Data[int(scale[j]):], Inc: p.Stride}) } - // Compute P^T*A*P and store into want. + // Compute Pᵀ*A*P and store into want. ap := zeros(n, n, n) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, want, p, 0, ap) blas64.Gemm(blas.Trans, blas.NoTrans, 1, p, ap, 0, want) diff --git a/lapack/testlapack/dgebd2.go b/lapack/testlapack/dgebd2.go index 6a23d142..5b8b5c42 100644 --- a/lapack/testlapack/dgebd2.go +++ b/lapack/testlapack/dgebd2.go @@ -53,7 +53,7 @@ func Dgebd2Test(t *testing.T, impl Dgebd2er) { // transformation. impl.Dgebd2(m, n, a, lda, d, e, tauQ, tauP, work) - // Check that it holds Q^T * A * P = B where B is represented by + // Check that it holds Qᵀ * A * P = B where B is represented by // d and e. checkBidiagonal(t, m, n, nb, a, lda, d, e, tauP, tauQ, aCopy) } diff --git a/lapack/testlapack/dgeev.go b/lapack/testlapack/dgeev.go index bc67f9a3..15314e4b 100644 --- a/lapack/testlapack/dgeev.go +++ b/lapack/testlapack/dgeev.go @@ -521,7 +521,7 @@ func DgeevTest(t *testing.T, impl Dgeever) { } } - // Compute A = Q T Q^T where Q is an + // Compute A = Q T Qᵀ where Q is an // orthogonal matrix. q := randomOrthogonal(n, rnd) tq := zeros(n, n, n) diff --git a/lapack/testlapack/dgehd2.go b/lapack/testlapack/dgehd2.go index fe8d5f78..c14bd48a 100644 --- a/lapack/testlapack/dgehd2.go +++ b/lapack/testlapack/dgehd2.go @@ -163,7 +163,7 @@ func testDgehd2(t *testing.T, impl Dgehd2er, n, extra int, rnd *rand.Rand) { } } - // Construct Q^T * AOrig * Q and check that it is + // Construct Qᵀ * AOrig * Q and check that it is // equal to A from Dgehd2. aq := blas64.General{ Rows: n, @@ -184,13 +184,13 @@ func testDgehd2(t *testing.T, impl Dgehd2er, n, extra int, rnd *rand.Rand) { qaqij := qaq.Data[i*qaq.Stride+j] if j < i-1 { if math.Abs(qaqij) > 1e-14 { - t.Errorf("%v: Q^T*A*Q is not upper Hessenberg, [%v,%v]=%v", prefix, i, j, qaqij) + t.Errorf("%v: Qᵀ*A*Q is not upper Hessenberg, [%v,%v]=%v", prefix, i, j, qaqij) } continue } diff := qaqij - a.Data[i*a.Stride+j] if math.Abs(diff) > 1e-14 { - t.Errorf("%v: Q^T*AOrig*Q and A are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) + t.Errorf("%v: Qᵀ*AOrig*Q and A are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) } } } diff --git a/lapack/testlapack/dgehrd.go b/lapack/testlapack/dgehrd.go index 9613482d..de9db65c 100644 --- a/lapack/testlapack/dgehrd.go +++ b/lapack/testlapack/dgehrd.go @@ -168,7 +168,7 @@ func testDgehrd(t *testing.T, impl Dgehrder, n, ilo, ihi, extra int, optwork boo t.Errorf("%v: Q is not orthogonal\nQ=%v", prefix, q) } - // Construct Q^T * AOrig * Q and check that it is upper Hessenberg. + // Construct Qᵀ * AOrig * Q and check that it is upper Hessenberg. aq := blas64.General{ Rows: n, Cols: n, @@ -188,7 +188,7 @@ func testDgehrd(t *testing.T, impl Dgehrder, n, ilo, ihi, extra int, optwork boo qaqij := qaq.Data[i*qaq.Stride+j] diff := qaqij - a.Data[i*a.Stride+j] if math.Abs(diff) > 1e-13 { - t.Errorf("%v: Q^T*AOrig*Q and A are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) + t.Errorf("%v: Qᵀ*AOrig*Q and A are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) } } } @@ -197,13 +197,13 @@ func testDgehrd(t *testing.T, impl Dgehrder, n, ilo, ihi, extra int, optwork boo qaqij := qaq.Data[i*qaq.Stride+j] if j < i-1 { if math.Abs(qaqij) > 1e-13 { - t.Errorf("%v: Q^T*AOrig*Q is not upper Hessenberg, [%v,%v]=%v", prefix, i, j, qaqij) + t.Errorf("%v: Qᵀ*AOrig*Q is not upper Hessenberg, [%v,%v]=%v", prefix, i, j, qaqij) } continue } diff := qaqij - a.Data[i*a.Stride+j] if math.Abs(diff) > 1e-13 { - t.Errorf("%v: Q^T*AOrig*Q and A are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) + t.Errorf("%v: Qᵀ*AOrig*Q and A are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) } } } diff --git a/lapack/testlapack/dgels.go b/lapack/testlapack/dgels.go index 26131fb2..4e520d1a 100644 --- a/lapack/testlapack/dgels.go +++ b/lapack/testlapack/dgels.go @@ -122,7 +122,7 @@ func DgelsTest(t *testing.T, impl Dgelser) { Data: make([]float64, szAta*szAta), } - // Compute A^T * A if notrans and A * A^T otherwise. + // Compute Aᵀ * A if notrans and A * Aᵀ otherwise. if trans == blas.NoTrans { blas64.Gemm(blas.Trans, blas.NoTrans, 1, aMat, aMat, 0, aTA) } else { @@ -169,7 +169,7 @@ func DgelsTest(t *testing.T, impl Dgelser) { } } - // Compute A^T B if Trans or A * B otherwise + // Compute Aᵀ B if Trans or A * B otherwise if trans == blas.NoTrans { blas64.Gemm(blas.Trans, blas.NoTrans, 1, aMat, B, 0, ans2) } else { diff --git a/lapack/testlapack/dgesvd.go b/lapack/testlapack/dgesvd.go index e9a52a0e..0555faa3 100644 --- a/lapack/testlapack/dgesvd.go +++ b/lapack/testlapack/dgesvd.go @@ -37,9 +37,9 @@ func DgesvdTest(t *testing.T, impl Dgesvder, tol float64) { // - the zero matrix if mtype == 1, // - the identity matrix if mtype == 2, // - a random matrix with a given condition number and singular values if mtype == 3, 4, or 5. -// It first computes the full SVD A = U*Sigma*V^T and checks that -// - U has orthonormal columns, and V^T has orthonormal rows, -// - U*Sigma*V^T multiply back to A, +// It first computes the full SVD A = U*Sigma*Vᵀ and checks that +// - U has orthonormal columns, and Vᵀ has orthonormal rows, +// - U*Sigma*Vᵀ multiply back to A, // - the singular values are non-negative and sorted in decreasing order. // Then all combinations of partial SVD results are computed and checked whether // they match the full SVD result. diff --git a/lapack/testlapack/dggsvd3.go b/lapack/testlapack/dggsvd3.go index cd8ecb0f..1d20824e 100644 --- a/lapack/testlapack/dggsvd3.go +++ b/lapack/testlapack/dggsvd3.go @@ -143,7 +143,7 @@ func Dggsvd3Test(t *testing.T, impl Dggsvd3er) { zeroR, d1, d2 := constructGSVDresults(n, p, m, k, l, a, b, alpha, beta) - // Check U^T*A*Q = D1*[ 0 R ]. + // Check Uᵀ*A*Q = D1*[ 0 R ]. uTmp := nanGeneral(m, n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, u, aCopy, 0, uTmp) uAns := nanGeneral(m, n, n) @@ -153,11 +153,11 @@ func Dggsvd3Test(t *testing.T, impl Dggsvd3er) { blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, d1, zeroR, 0, d10r) if !equalApproxGeneral(uAns, d10r, 1e-14) { - t.Errorf("test %d: U^T*A*Q != D1*[ 0 R ]\nU^T*A*Q:\n%+v\nD1*[ 0 R ]:\n%+v", + t.Errorf("test %d: Uᵀ*A*Q != D1*[ 0 R ]\nUᵀ*A*Q:\n%+v\nD1*[ 0 R ]:\n%+v", cas, uAns, d10r) } - // Check V^T*B*Q = D2*[ 0 R ]. + // Check Vᵀ*B*Q = D2*[ 0 R ]. vTmp := nanGeneral(p, n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, v, bCopy, 0, vTmp) vAns := nanGeneral(p, n, n) @@ -167,7 +167,7 @@ func Dggsvd3Test(t *testing.T, impl Dggsvd3er) { blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, d2, zeroR, 0, d20r) if !equalApproxGeneral(vAns, d20r, 1e-13) { - t.Errorf("test %d: V^T*B*Q != D2*[ 0 R ]\nV^T*B*Q:\n%+v\nD2*[ 0 R ]:\n%+v", + t.Errorf("test %d: Vᵀ*B*Q != D2*[ 0 R ]\nVᵀ*B*Q:\n%+v\nD2*[ 0 R ]:\n%+v", cas, vAns, d20r) } } diff --git a/lapack/testlapack/dggsvp3.go b/lapack/testlapack/dggsvp3.go index a1af60b8..c31e82bf 100644 --- a/lapack/testlapack/dggsvp3.go +++ b/lapack/testlapack/dggsvp3.go @@ -122,25 +122,25 @@ func Dggsvp3Test(t *testing.T, impl Dggsvp3er) { zeroA, zeroB := constructGSVPresults(n, p, m, k, l, a, b) - // Check U^T*A*Q = [ 0 RA ]. + // Check Uᵀ*A*Q = [ 0 RA ]. uTmp := nanGeneral(m, n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, u, aCopy, 0, uTmp) uAns := nanGeneral(m, n, n) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, uTmp, q, 0, uAns) if !equalApproxGeneral(uAns, zeroA, 1e-14) { - t.Errorf("test %d: U^T*A*Q != [ 0 RA ]\nU^T*A*Q:\n%+v\n[ 0 RA ]:\n%+v", + t.Errorf("test %d: Uᵀ*A*Q != [ 0 RA ]\nUᵀ*A*Q:\n%+v\n[ 0 RA ]:\n%+v", cas, uAns, zeroA) } - // Check V^T*B*Q = [ 0 RB ]. + // Check Vᵀ*B*Q = [ 0 RB ]. vTmp := nanGeneral(p, n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, v, bCopy, 0, vTmp) vAns := nanGeneral(p, n, n) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, vTmp, q, 0, vAns) if !equalApproxGeneral(vAns, zeroB, 1e-14) { - t.Errorf("test %d: V^T*B*Q != [ 0 RB ]\nV^T*B*Q:\n%+v\n[ 0 RB ]:\n%+v", + t.Errorf("test %d: Vᵀ*B*Q != [ 0 RB ]\nVᵀ*B*Q:\n%+v\n[ 0 RB ]:\n%+v", cas, vAns, zeroB) } } diff --git a/lapack/testlapack/dhseqr.go b/lapack/testlapack/dhseqr.go index 376724a6..1db46677 100644 --- a/lapack/testlapack/dhseqr.go +++ b/lapack/testlapack/dhseqr.go @@ -188,7 +188,7 @@ func testDhseqr(t *testing.T, impl Dhseqrer, i int, test dhseqrTest, job lapack. ztz := zeros(n, n, n) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, z, tz, 0, ztz) if !equalApproxGeneral(ztz, hCopy, evTol) { - t.Errorf("%v: H != Z T Z^T", prefix) + t.Errorf("%v: H != Z T Zᵀ", prefix) } } diff --git a/lapack/testlapack/dlaexc.go b/lapack/testlapack/dlaexc.go index 6a843816..ef11f502 100644 --- a/lapack/testlapack/dlaexc.go +++ b/lapack/testlapack/dlaexc.go @@ -212,7 +212,7 @@ func testDlaexc(t *testing.T, impl Dlaexcer, wantq bool, n, j1, n1, n2, extra in } } } - // Check that Q^T TOrig Q == T. + // Check that Qᵀ TOrig Q == T. tq := eye(n, n) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, tmatCopy, q, 0, tq) qtq := eye(n, n) diff --git a/lapack/testlapack/dlags2.go b/lapack/testlapack/dlags2.go index a1c959e3..bed1849e 100644 --- a/lapack/testlapack/dlags2.go +++ b/lapack/testlapack/dlags2.go @@ -89,10 +89,10 @@ func Dlags2Test(t *testing.T, impl Dlags2er) { } tmp := blas64.General{Rows: 2, Cols: 2, Stride: 2, Data: make([]float64, 4)} - // Transform A as U^T*A*Q. + // Transform A as Uᵀ*A*Q. blas64.Gemm(blas.Trans, blas.NoTrans, 1, u, a, 0, tmp) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, tmp, q, 0, a) - // Transform B as V^T*A*Q. + // Transform B as Vᵀ*A*Q. blas64.Gemm(blas.Trans, blas.NoTrans, 1, v, b, 0, tmp) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, tmp, q, 0, b) @@ -107,10 +107,10 @@ func Dlags2Test(t *testing.T, impl Dlags2er) { } // Check that they are indeed zero. if !floats.EqualWithinAbsOrRel(gotA, 0, 1e-14, 1e-14) { - t.Errorf("unexpected non-zero value for zero triangle of U^T*A*Q: %v", gotA) + t.Errorf("unexpected non-zero value for zero triangle of Uᵀ*A*Q: %v", gotA) } if !floats.EqualWithinAbsOrRel(gotB, 0, 1e-14, 1e-14) { - t.Errorf("unexpected non-zero value for zero triangle of V^T*B*Q: %v", gotB) + t.Errorf("unexpected non-zero value for zero triangle of Vᵀ*B*Q: %v", gotB) } } } diff --git a/lapack/testlapack/dlahqr.go b/lapack/testlapack/dlahqr.go index 07378d83..d4c84b6f 100644 --- a/lapack/testlapack/dlahqr.go +++ b/lapack/testlapack/dlahqr.go @@ -436,7 +436,7 @@ func testDlahqr(t *testing.T, impl Dlahqrer, test dlahqrTest) { uhu := eye(n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, z, hu, 0, uhu) if !equalApproxGeneral(uhu, h, 10*tol) { - t.Errorf("%v: Z^T*(initial H)*Z and (final H) are not equal", prefix) + t.Errorf("%v: Zᵀ*(initial H)*Z and (final H) are not equal", prefix) } } } diff --git a/lapack/testlapack/dlahr2.go b/lapack/testlapack/dlahr2.go index 390872f6..8a33afa1 100644 --- a/lapack/testlapack/dlahr2.go +++ b/lapack/testlapack/dlahr2.go @@ -159,7 +159,7 @@ func Dlahr2Test(t *testing.T, impl Dlahr2er) { if !isOrthogonal(q) { t.Errorf("%v: Q is not orthogonal", prefix) } - // Construct Q as the product Q = I - V*T*V^T. + // Construct Q as the product Q = I - V*T*Vᵀ. qwant := blas64.General{ Rows: n - k + 1, Cols: n - k + 1, @@ -171,7 +171,7 @@ func Dlahr2Test(t *testing.T, impl Dlahr2er) { } blas64.Gemm(blas.NoTrans, blas.Trans, -1, vt, v, 1, qwant) if !isOrthogonal(qwant) { - t.Errorf("%v: Q = I - V*T*V^T is not orthogonal", prefix) + t.Errorf("%v: Q = I - V*T*Vᵀ is not orthogonal", prefix) } // Compare Q and QWant. Note that since Q is diff --git a/lapack/testlapack/dlaln2.go b/lapack/testlapack/dlaln2.go index aa35f3d0..a89781d0 100644 --- a/lapack/testlapack/dlaln2.go +++ b/lapack/testlapack/dlaln2.go @@ -97,17 +97,17 @@ func testDlaln2(t *testing.T, impl Dlaln2er, trans bool, na, nw, extra int, rnd // Compute a complex matrix // M := ca * A - w * D // or - // M := ca * A^T - w * D. + // M := ca * Aᵀ - w * D. m := make([]complex128, na*na) if trans { - // M = ca * A^T + // M = ca * Aᵀ for i := 0; i < na; i++ { for j := 0; j < na; j++ { m[i*na+j] = complex(ca*a.Data[j*a.Stride+i], 0) } } } else { - // M = ca * A^T + // M = ca * Aᵀ for i := 0; i < na; i++ { for j := 0; j < na; j++ { m[i*na+j] = complex(ca*a.Data[i*a.Stride+j], 0) diff --git a/lapack/testlapack/dlaqr04.go b/lapack/testlapack/dlaqr04.go index c9fbdc89..8b0ac88f 100644 --- a/lapack/testlapack/dlaqr04.go +++ b/lapack/testlapack/dlaqr04.go @@ -444,7 +444,7 @@ func testDlaqr04(t *testing.T, impl Dlaqr04er, test dlaqr04Test, optwork bool, r zhz := eye(n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, z, hz, 0, zhz) if !equalApproxGeneral(zhz, h, 10*tol) { - t.Errorf("%v: Z^T*(initial H)*Z and (final H) are not equal", prefix) + t.Errorf("%v: Zᵀ*(initial H)*Z and (final H) are not equal", prefix) } } } diff --git a/lapack/testlapack/dlaqr23.go b/lapack/testlapack/dlaqr23.go index d2f838ee..5b3612cb 100644 --- a/lapack/testlapack/dlaqr23.go +++ b/lapack/testlapack/dlaqr23.go @@ -359,11 +359,11 @@ func testDlaqr23(t *testing.T, impl Dlaqr23er, test dlaqr23Test, opt bool, recur // Compute H_in*Z. blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, test.h, z, 0, hu) uhu := eye(n, n) - // Compute Z^T*H_in*Z. + // Compute Zᵀ*H_in*Z. blas64.Gemm(blas.Trans, blas.NoTrans, 1, z, hu, 0, uhu) - // Compare Z^T*H_in*Z and H_out. + // Compare Zᵀ*H_in*Z and H_out. if !equalApproxGeneral(uhu, h, 10*tol) { - t.Errorf("%v: Z^T*(initial H)*Z and (final H) are not equal", prefix) + t.Errorf("%v: Zᵀ*(initial H)*Z and (final H) are not equal", prefix) } } } diff --git a/lapack/testlapack/dlaqr5.go b/lapack/testlapack/dlaqr5.go index d4c4272c..9d8a9ee6 100644 --- a/lapack/testlapack/dlaqr5.go +++ b/lapack/testlapack/dlaqr5.go @@ -189,7 +189,7 @@ func testDlaqr5(t *testing.T, impl Dlaqr5er, n, extra, kacc22 int, rnd *rand.Ran if !isOrthogonal(z) { t.Errorf("%v: Z is not orthogonal", prefix) } - // Construct Z^T * HOrig * Z and check that it is equal to H from Dlaqr5. + // Construct Zᵀ * HOrig * Z and check that it is equal to H from Dlaqr5. hz := blas64.General{ Rows: n, Cols: n, @@ -208,7 +208,7 @@ func testDlaqr5(t *testing.T, impl Dlaqr5er, n, extra, kacc22 int, rnd *rand.Ran for j := 0; j < n; j++ { diff := zhz.Data[i*zhz.Stride+j] - h.Data[i*h.Stride+j] if math.Abs(diff) > 1e-13 { - t.Errorf("%v: Z^T*HOrig*Z and H are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) + t.Errorf("%v: Zᵀ*HOrig*Z and H are not equal, diff at [%v,%v]=%v", prefix, i, j, diff) } } } diff --git a/lapack/testlapack/dlarfg.go b/lapack/testlapack/dlarfg.go index 57eca972..2d0d14b5 100644 --- a/lapack/testlapack/dlarfg.go +++ b/lapack/testlapack/dlarfg.go @@ -108,7 +108,7 @@ func DlarfgTest(t *testing.T, impl Dlarfger) { blas64.Gemm(blas.Trans, blas.NoTrans, 1, hmat, hmat, 0, eye) dist := distFromIdentity(n, eye.Data, n) if dist > tol { - t.Errorf("H^T * H is not close to I, dist=%v", dist) + t.Errorf("Hᵀ * H is not close to I, dist=%v", dist) } xVec := blas64.Vector{ diff --git a/lapack/testlapack/dlarft.go b/lapack/testlapack/dlarft.go index d4c174f8..c6f7b22f 100644 --- a/lapack/testlapack/dlarft.go +++ b/lapack/testlapack/dlarft.go @@ -115,14 +115,14 @@ func DlarftTest(t *testing.T, impl Dlarfter) { } var comp blas64.General if store == lapack.ColumnWise { - // H = I - V * T * V^T + // H = I - V * T * Vᵀ tmp := blas64.General{ Rows: T.Rows, Cols: vMatT.Cols, Stride: vMatT.Cols, Data: make([]float64, T.Rows*vMatT.Cols), } - // T * V^T + // T * Vᵀ blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, T, vMatT, 0, tmp) comp = blas64.General{ Rows: vMat.Rows, @@ -130,10 +130,10 @@ func DlarftTest(t *testing.T, impl Dlarfter) { Stride: tmp.Cols, Data: make([]float64, vMat.Rows*tmp.Cols), } - // V * (T * V^T) + // V * (T * Vᵀ) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, vMat, tmp, 0, comp) } else { - // H = I - V^T * T * V + // H = I - Vᵀ * T * V tmp := blas64.General{ Rows: T.Rows, Cols: vMat.Cols, @@ -148,10 +148,10 @@ func DlarftTest(t *testing.T, impl Dlarfter) { Stride: tmp.Cols, Data: make([]float64, vMatT.Rows*tmp.Cols), } - // V^T * (T * V) + // Vᵀ * (T * V) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, vMatT, tmp, 0, comp) } - // I - V^T * T * V + // I - Vᵀ * T * V for i := 0; i < comp.Rows; i++ { for j := 0; j < comp.Cols; j++ { comp.Data[i*m+j] *= -1 diff --git a/lapack/testlapack/dlarfx.go b/lapack/testlapack/dlarfx.go index af7ce0ee..723d894e 100644 --- a/lapack/testlapack/dlarfx.go +++ b/lapack/testlapack/dlarfx.go @@ -48,7 +48,7 @@ func testDlarfx(t *testing.T, impl Dlarfxer, side blas.Side, m, n, extra int, rn ldc := n + extra c := randomGeneral(m, n, ldc, rnd) - // Compute the matrix H explicitly as H := I - tau * v * v^T. + // Compute the matrix H explicitly as H := I - tau * v * vᵀ. var h blas64.General if side == blas.Left { h = eye(m, m+extra) diff --git a/lapack/testlapack/dlasq1.go b/lapack/testlapack/dlasq1.go index ad37bb7b..4200b032 100644 --- a/lapack/testlapack/dlasq1.go +++ b/lapack/testlapack/dlasq1.go @@ -56,7 +56,7 @@ func Dlasq1Test(t *testing.T, impl Dlasq1er) { // Check that they are singular values. The // singular values are the square roots of the - // eigenvalues of X^T * X + // eigenvalues of Xᵀ * X mmCopy := make([]float64, len(mm)) copy(mmCopy, mm) ipiv := make([]int, n) diff --git a/lapack/testlapack/dlatbs.go b/lapack/testlapack/dlatbs.go index 31ed0488..6c168e3d 100644 --- a/lapack/testlapack/dlatbs.go +++ b/lapack/testlapack/dlatbs.go @@ -105,7 +105,7 @@ func dlatbsTest(t *testing.T, impl Dlatbser, rnd *rand.Rand, kind int, uplo blas } // dlatbsResidual returns the residual for the solution to a scaled triangular -// system of equations A*x = s*b or A^T*x = s*b when A is an n×n triangular +// system of equations A*x = s*b or Aᵀ*x = s*b when A is an n×n triangular // band matrix with kd super- or sub-diagonals. The residual is computed as // norm( op(A)*x - scale*b ) / ( norm(op(A)) * norm(x) ). // diff --git a/lapack/testlapack/dlatrd.go b/lapack/testlapack/dlatrd.go index 994a31a6..e2695ff0 100644 --- a/lapack/testlapack/dlatrd.go +++ b/lapack/testlapack/dlatrd.go @@ -100,7 +100,7 @@ func DlatrdTest(t *testing.T, impl Dlatrder) { } v.Data[i-1] = 1 - // Compute H = I - tau[i-1] * v * v^T. + // Compute H = I - tau[i-1] * v * vᵀ. h := blas64.General{ Rows: n, Cols: n, Stride: n, Data: make([]float64, n*n), } @@ -132,7 +132,7 @@ func DlatrdTest(t *testing.T, impl Dlatrder) { v.Data[j] = a[j*lda+i] } - // Compute H = I - tau[i] * v * v^T. + // Compute H = I - tau[i] * v * vᵀ. h := blas64.General{ Rows: n, Cols: n, Stride: n, Data: make([]float64, n*n), } @@ -164,7 +164,7 @@ func DlatrdTest(t *testing.T, impl Dlatrder) { // dlatrdCheckDecomposition checks that the first nb rows have been successfully // reduced. func dlatrdCheckDecomposition(t *testing.T, uplo blas.Uplo, n, nb int, e, a []float64, lda int, aGen, q blas64.General) bool { - // Compute ans = Q^T * A * Q. + // Compute ans = Qᵀ * A * Q. // ans should be a tridiagonal matrix in the first or last nb rows and // columns, depending on uplo. tmp := blas64.General{ @@ -183,7 +183,7 @@ func dlatrdCheckDecomposition(t *testing.T, uplo blas.Uplo, n, nb int, e, a []fl blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, tmp, q, 0, ans) // Compare the output of Dlatrd (stored in a and e) with the explicit - // reduction to tridiagonal matrix Q^T * A * Q (stored in ans). + // reduction to tridiagonal matrix Qᵀ * A * Q (stored in ans). if uplo == blas.Upper { for i := n - nb; i < n; i++ { for j := 0; j < n; j++ { diff --git a/lapack/testlapack/dlauu2.go b/lapack/testlapack/dlauu2.go index 70ba9400..b3cb69a9 100644 --- a/lapack/testlapack/dlauu2.go +++ b/lapack/testlapack/dlauu2.go @@ -51,7 +51,7 @@ func dlauuTest(t *testing.T, dlauu func(blas.Uplo, int, []float64, int), uplo bl aCopy := make([]float64, len(a)) copy(aCopy, a) - // Compute U*U^T or L^T*L using Dlauu?. + // Compute U*Uᵀ or Lᵀ*L using Dlauu?. dlauu(uplo, n, a, lda) if n == 0 { @@ -85,7 +85,7 @@ func dlauuTest(t *testing.T, dlauu func(blas.Uplo, int, []float64, int), uplo bl } } - // Compute U*U^T or L^T*L using Dgemm with U and L + // Compute U*Uᵀ or Lᵀ*L using Dgemm with U and L // represented as dense triangular matrices. ldwant := n want := make([]float64, n*ldwant) @@ -93,14 +93,14 @@ func dlauuTest(t *testing.T, dlauu func(blas.Uplo, int, []float64, int), uplo bl // Use aCopy as a dense representation of the upper triangular U. u := aCopy ldu := lda - // Compute U * U^T and store the result into want. + // Compute U * Uᵀ and store the result into want. bi.Dgemm(blas.NoTrans, blas.Trans, n, n, n, 1, u, ldu, u, ldu, 0, want, ldwant) } else { // Use aCopy as a dense representation of the lower triangular L. l := aCopy ldl := lda - // Compute L^T * L and store the result into want. + // Compute Lᵀ * L and store the result into want. bi.Dgemm(blas.Trans, blas.NoTrans, n, n, n, 1, l, ldl, l, ldl, 0, want, ldwant) } diff --git a/lapack/testlapack/dorgbr.go b/lapack/testlapack/dorgbr.go index ba6f3d29..eb395f9e 100644 --- a/lapack/testlapack/dorgbr.go +++ b/lapack/testlapack/dorgbr.go @@ -138,7 +138,7 @@ func DorgbrTest(t *testing.T, impl Dorgbrer) { } nCols = n ansTmp := constructQPBidiagonal(lapack.ApplyP, ma, na, min(k, n), aCopy, lda, tau) - // Dorgbr actually computes P^T + // Dorgbr actually computes Pᵀ ans = transposeGeneral(ansTmp) } for i := 0; i < nRows; i++ { diff --git a/lapack/testlapack/dorgtr.go b/lapack/testlapack/dorgtr.go index a44a29f6..07c91d13 100644 --- a/lapack/testlapack/dorgtr.go +++ b/lapack/testlapack/dorgtr.go @@ -144,7 +144,7 @@ func DorgtrTest(t *testing.T, impl Dorgtrer) { } } - // Compute Q^T * A * Q and store the result in ans. + // Compute Qᵀ * A * Q and store the result in ans. tmp := blas64.General{Rows: n, Cols: n, Stride: n, Data: make([]float64, n*n)} blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, aMat, q, 0, tmp) ans := blas64.General{Rows: n, Cols: n, Stride: n, Data: make([]float64, n*n)} diff --git a/lapack/testlapack/dpbtf2.go b/lapack/testlapack/dpbtf2.go index 3c317225..89fba9ee 100644 --- a/lapack/testlapack/dpbtf2.go +++ b/lapack/testlapack/dpbtf2.go @@ -49,7 +49,7 @@ func dpbtf2Test(t *testing.T, impl Dpbtf2er, rnd *rand.Rand, uplo blas.Uplo, n, t.Fatalf("%v: bad test matrix, Dpbtf2 failed", name) } - // Reconstruct an symmetric band matrix from the U^T*U or L*L^T factorization, overwriting abFac. + // Reconstruct an symmetric band matrix from the Uᵀ*U or L*Lᵀ factorization, overwriting abFac. dsbmm(uplo, n, kd, abFac, ldab) // Compute and check the max-norm distance between the reconstructed and original matrix A. diff --git a/lapack/testlapack/dpbtrf.go b/lapack/testlapack/dpbtrf.go index 0125735e..a08b6e72 100644 --- a/lapack/testlapack/dpbtrf.go +++ b/lapack/testlapack/dpbtrf.go @@ -54,7 +54,7 @@ func dpbtrfTest(t *testing.T, impl Dpbtrfer, uplo blas.Uplo, n, kd int, ldab int t.Fatalf("%v: bad test matrix, Dpbtrf failed", name) } - // Reconstruct an symmetric band matrix from the U^T*U or L*L^T factorization, overwriting abFac. + // Reconstruct an symmetric band matrix from the Uᵀ*U or L*Lᵀ factorization, overwriting abFac. dsbmm(uplo, n, kd, abFac, ldab) // Compute and check the max-norm distance between the reconstructed and original matrix A. @@ -65,15 +65,15 @@ func dpbtrfTest(t *testing.T, impl Dpbtrfer, uplo blas.Uplo, n, kd int, ldab int } // dsbmm computes a symmetric band matrix A -// A = U^T*U if uplo == blas.Upper, -// A = L*L^T if uplo == blas.Lower, +// A = Uᵀ*U if uplo == blas.Upper, +// A = L*Lᵀ if uplo == blas.Lower, // where U and L is an upper, respectively lower, triangular band matrix // stored on entry in ab. The result is stored in-place into ab. func dsbmm(uplo blas.Uplo, n, kd int, ab []float64, ldab int) { bi := blas64.Implementation() switch uplo { case blas.Upper: - // Compute the product U^T * U. + // Compute the product Uᵀ * U. for k := n - 1; k >= 0; k-- { klen := min(kd, n-k-1) // Number of stored off-diagonal elements in the row // Add a multiple of row k of the factor U to each of rows k+1 through n. @@ -84,7 +84,7 @@ func dsbmm(uplo blas.Uplo, n, kd int, ab []float64, ldab int) { bi.Dscal(klen+1, ab[k*ldab], ab[k*ldab:], 1) } case blas.Lower: - // Compute the product L * L^T. + // Compute the product L * Lᵀ. for k := n - 1; k >= 0; k-- { kc := max(0, kd-k) // Index of the first valid element in the row klen := kd - kc // Number of stored off-diagonal elements in the row diff --git a/lapack/testlapack/dpbtrs.go b/lapack/testlapack/dpbtrs.go index b9daa86e..d0ee2918 100644 --- a/lapack/testlapack/dpbtrs.go +++ b/lapack/testlapack/dpbtrs.go @@ -74,7 +74,7 @@ func dpbtrsTest(t *testing.T, impl Dpbtrser, rnd *rand.Rand, uplo blas.Uplo, n, } } - // Solve U^T * U * X = B or L * L^T * X = B. + // Solve Uᵀ * U * X = B or L * Lᵀ * X = B. impl.Dpbtrs(uplo, n, kd, nrhs, abFac, ldab, b, ldb) xGot := b diff --git a/lapack/testlapack/dpotrf.go b/lapack/testlapack/dpotrf.go index b7ce0a5f..555442e3 100644 --- a/lapack/testlapack/dpotrf.go +++ b/lapack/testlapack/dpotrf.go @@ -55,7 +55,7 @@ func DpotrfTest(t *testing.T, impl Dpotrfer) { Dlatm1(d, 4, 10000, false, 1, rnd) // Construct a positive definite matrix A as - // A = U * D * U^T + // A = U * D * Uᵀ // where U is a random orthogonal matrix. lda := test.lda if lda == 0 { @@ -93,10 +93,10 @@ func DpotrfTest(t *testing.T, impl Dpotrfer) { ans := make([]float64, len(a)) switch uplo { case blas.Upper: - // Multiply U^T * U. + // Multiply Uᵀ * U. bi.Dsyrk(uplo, blas.Trans, n, n, 1, a, lda, 0, ans, lda) case blas.Lower: - // Multiply L * L^T. + // Multiply L * Lᵀ. bi.Dsyrk(uplo, blas.NoTrans, n, n, 1, a, lda, 0, ans, lda) } diff --git a/lapack/testlapack/dpotri.go b/lapack/testlapack/dpotri.go index 7f218037..b66a97cc 100644 --- a/lapack/testlapack/dpotri.go +++ b/lapack/testlapack/dpotri.go @@ -43,7 +43,7 @@ func DpotriTest(t *testing.T, impl Dpotrier) { Dlatm1(d, 3, 10000, false, 2, rnd) // Construct a positive definite matrix A as - // A = U * D * U^T + // A = U * D * Uᵀ // where U is a random orthogonal matrix. a := make([]float64, n*lda) Dlagsy(n, 0, d, a, lda, rnd, make([]float64, 2*n)) diff --git a/lapack/testlapack/dsytd2.go b/lapack/testlapack/dsytd2.go index ecfb4f19..3132d136 100644 --- a/lapack/testlapack/dsytd2.go +++ b/lapack/testlapack/dsytd2.go @@ -122,7 +122,7 @@ func Dsytd2Test(t *testing.T, impl Dsytd2er) { t.Errorf("Q not orthogonal") } - // Compute Q^T * A * Q. + // Compute Qᵀ * A * Q. aMat := blas64.General{ Rows: n, Cols: n, diff --git a/lapack/testlapack/dsytrd.go b/lapack/testlapack/dsytrd.go index 052e9ed3..22237586 100644 --- a/lapack/testlapack/dsytrd.go +++ b/lapack/testlapack/dsytrd.go @@ -145,7 +145,7 @@ func DsytrdTest(t *testing.T, impl Dsytrder) { } } - // Compute Q^T * A * Q. + // Compute Qᵀ * A * Q. tmp := zeros(n, n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, q, aCopy, 0, tmp) got := zeros(n, n, n) @@ -153,7 +153,7 @@ func DsytrdTest(t *testing.T, impl Dsytrder) { // Compare with T. if !equalApproxGeneral(got, tMat, tol) { - t.Errorf("%v: Q^T*A*Q != T", prefix) + t.Errorf("%v: Qᵀ*A*Q != T", prefix) } } } diff --git a/lapack/testlapack/dtgsja.go b/lapack/testlapack/dtgsja.go index 0c4c73b6..8f0f0ee6 100644 --- a/lapack/testlapack/dtgsja.go +++ b/lapack/testlapack/dtgsja.go @@ -135,7 +135,7 @@ func DtgsjaTest(t *testing.T, impl Dtgsjaer) { zeroR, d1, d2 := constructGSVDresults(n, p, m, k, l, a, b, alpha, beta) - // Check U^T*A*Q = D1*[ 0 R ]. + // Check Uᵀ*A*Q = D1*[ 0 R ]. uTmp := nanGeneral(m, n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, u, aCopy, 0, uTmp) uAns := nanGeneral(m, n, n) @@ -145,11 +145,11 @@ func DtgsjaTest(t *testing.T, impl Dtgsjaer) { blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, d1, zeroR, 0, d10r) if !equalApproxGeneral(uAns, d10r, 1e-14) { - t.Errorf("test %d: U^T*A*Q != D1*[ 0 R ]\nU^T*A*Q:\n%+v\nD1*[ 0 R ]:\n%+v", + t.Errorf("test %d: Uᵀ*A*Q != D1*[ 0 R ]\nUᵀ*A*Q:\n%+v\nD1*[ 0 R ]:\n%+v", cas, uAns, d10r) } - // Check V^T*B*Q = D2*[ 0 R ]. + // Check Vᵀ*B*Q = D2*[ 0 R ]. vTmp := nanGeneral(p, n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, v, bCopy, 0, vTmp) vAns := nanGeneral(p, n, n) @@ -159,7 +159,7 @@ func DtgsjaTest(t *testing.T, impl Dtgsjaer) { blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, d2, zeroR, 0, d20r) if !equalApproxGeneral(vAns, d20r, 1e-14) { - t.Errorf("test %d: V^T*B*Q != D2*[ 0 R ]\nV^T*B*Q:\n%+v\nD2*[ 0 R ]:\n%+v", + t.Errorf("test %d: Vᵀ*B*Q != D2*[ 0 R ]\nVᵀ*B*Q:\n%+v\nD2*[ 0 R ]:\n%+v", cas, vAns, d20r) } } diff --git a/lapack/testlapack/dtrexc.go b/lapack/testlapack/dtrexc.go index 92c29efd..4b20675e 100644 --- a/lapack/testlapack/dtrexc.go +++ b/lapack/testlapack/dtrexc.go @@ -209,12 +209,12 @@ func testDtrexc(t *testing.T, impl Dtrexcer, compq lapack.UpdateSchurComp, tmat } } } - // Check that Q^T TOrig Q == T. + // Check that Qᵀ TOrig Q == T. tq := eye(n, n) blas64.Gemm(blas.NoTrans, blas.NoTrans, 1, tmatCopy, q, 0, tq) qtq := eye(n, n) blas64.Gemm(blas.Trans, blas.NoTrans, 1, q, tq, 0, qtq) if !equalApproxGeneral(qtq, tmat, tol) { - t.Errorf("%v: Q^T (initial T) Q and (final T) are not equal", prefix) + t.Errorf("%v: Qᵀ (initial T) Q and (final T) are not equal", prefix) } } diff --git a/lapack/testlapack/general.go b/lapack/testlapack/general.go index 19119c33..3f65e403 100644 --- a/lapack/testlapack/general.go +++ b/lapack/testlapack/general.go @@ -510,7 +510,7 @@ func constructH(tau []float64, v blas64.General, store lapack.StoreV, direct lap for i := 0; i < m; i++ { hi.Data[i*m+i] = 1 } - // hi = I - tau * v * v^T + // hi = I - tau * v * vᵀ blas64.Ger(-tau[i], vec, vec, hi) hcopy := blas64.General{ @@ -613,7 +613,7 @@ func constructQK(kind string, m, n, k int, a []float64, lda int, tau []float64) // decomposition) is input in aCopy. // // checkBidiagonal constructs the V and U matrices, and from them constructs Q -// and P. Using these constructions, it checks that Q^T * A * P and checks that +// and P. Using these constructions, it checks that Qᵀ * A * P and checks that // the result is bidiagonal. func checkBidiagonal(t *testing.T, m, n, nb int, a []float64, lda int, d, e, tauP, tauQ, aCopy []float64) { // Check the answer. @@ -621,7 +621,7 @@ func checkBidiagonal(t *testing.T, m, n, nb int, a []float64, lda int, d, e, tau qMat := constructQPBidiagonal(lapack.ApplyQ, m, n, nb, a, lda, tauQ) pMat := constructQPBidiagonal(lapack.ApplyP, m, n, nb, a, lda, tauP) - // Compute Q^T * A * P. + // Compute Qᵀ * A * P. aMat := blas64.General{ Rows: m, Cols: n, @@ -1052,7 +1052,7 @@ func randSymBand(uplo blas.Uplo, n, kd, ldab int, rnd *rand.Rand) []float64 { ab[i*ldab+kd] = float64(n) + rnd.Float64() } } - // Compute U^T*U or L*L^T. The resulting (symmetric) matrix A will be + // Compute Uᵀ*U or L*Lᵀ. The resulting (symmetric) matrix A will be // positive definite and well-conditioned. dsbmm(uplo, n, kd, ab, ldab) return ab @@ -1324,9 +1324,9 @@ func isRightEigenvectorOf(a blas64.General, xRe, xIm []float64, lambda complex12 // // A left eigenvector corresponding to a complex eigenvalue λ is a complex // non-zero vector y such that -// y^H A = λ y^H, +// yᴴ A = λ yᴴ, // which is equivalent for real A to -// A^T y = conj(λ) y, +// Aᵀ y = conj(λ) y, func isLeftEigenvectorOf(a blas64.General, yRe, yIm []float64, lambda complex128, tol float64) bool { if a.Rows != a.Cols { panic("matrix not square") @@ -1340,7 +1340,7 @@ func isLeftEigenvectorOf(a blas64.General, yRe, yIm []float64, lambda complex128 n := a.Rows - // Compute A^T real(y) and store the result into yReAns. + // Compute Aᵀ real(y) and store the result into yReAns. yReAns := make([]float64, n) blas64.Gemv(blas.Trans, 1, a, blas64.Vector{Data: yRe, Inc: 1}, 0, blas64.Vector{Data: yReAns, Inc: 1}) @@ -1358,7 +1358,7 @@ func isLeftEigenvectorOf(a blas64.General, yRe, yIm []float64, lambda complex128 // Complex eigenvector, and real or complex eigenvalue. - // Compute A^T imag(y) and store the result into yImAns. + // Compute Aᵀ imag(y) and store the result into yImAns. yImAns := make([]float64, n) blas64.Gemv(blas.Trans, 1, a, blas64.Vector{Data: yIm, Inc: 1}, 0, blas64.Vector{Data: yImAns, Inc: 1}) diff --git a/lapack/testlapack/matgen.go b/lapack/testlapack/matgen.go index aa294a0d..a81b15b5 100644 --- a/lapack/testlapack/matgen.go +++ b/lapack/testlapack/matgen.go @@ -124,7 +124,7 @@ func Dlatm1(dst []float64, mode int, cond float64, rsign bool, dist int, rnd *ra // Dlagsy generates an n×n symmetric matrix A, by pre- and post- multiplying a // real diagonal matrix D with a random orthogonal matrix: -// A = U * D * U^T. +// A = U * D * Uᵀ. // // work must have length at least 2*n, otherwise Dlagsy will panic. // @@ -317,7 +317,7 @@ func dlarnv(dst []float64, dist int, rnd *rand.Rand) { // trans specifies whether the matrix A or its transpose will be used. // // If imat is greater than 10, dlattr also generates the right hand side of the -// linear system A*x=b, or A^T*x=b. Valid values of imat are 7, and all between 11 +// linear system A*x=b, or Aᵀ*x=b. Valid values of imat are 7, and all between 11 // and 19, inclusive. // // b mush have length n, and work must have length 3*n, and dlattr will panic diff --git a/lapack/testlapack/matgen_test.go b/lapack/testlapack/matgen_test.go index 1257487a..fd454e9d 100644 --- a/lapack/testlapack/matgen_test.go +++ b/lapack/testlapack/matgen_test.go @@ -28,10 +28,10 @@ func TestDlagsy(t *testing.T) { // Allocate an n×n symmetric matrix A and fill it with NaNs. a := nanSlice(n * lda) work := make([]float64, 2*n) - // Compute A = U * D * U^T where U is a random orthogonal matrix. + // Compute A = U * D * Uᵀ where U is a random orthogonal matrix. Dlagsy(n, 0, d, a, lda, rnd, work) // A should be the identity matrix because - // A = U * D * U^T = U * I * U^T = U * U^T = I. + // A = U * D * Uᵀ = U * I * Uᵀ = U * Uᵀ = I. dist := distFromIdentity(n, a, lda) if dist > tol { t.Errorf("Case n=%v,lda=%v: |A-I|=%v is too large", n, lda, dist) diff --git a/lapack/testlapack/test_matrices.go b/lapack/testlapack/test_matrices.go index dddafe14..39045c23 100644 --- a/lapack/testlapack/test_matrices.go +++ b/lapack/testlapack/test_matrices.go @@ -126,9 +126,9 @@ func (c Circulant) Eigenvalues() []complex128 { } // Clement is a generally non-symmetric matrix given by -// A[i,j] = i+1, if j == i+1, -// = n-i, if j == i-1, -// = 0, otherwise. +// A[i,j] = i+1 if j == i+1, +// = n-i if j == i-1, +// = 0 otherwise. // For example, for n=5, // [ . 1 . . . ] // [ 4 . 2 . . ] @@ -162,8 +162,8 @@ func (c Clement) Eigenvalues() []complex128 { } // Creation is a singular non-symmetric matrix given by -// A[i,j] = i, if j == i-1, -// = 0, otherwise. +// A[i,j] = i if j == i-1, +// = 0 otherwise. // For example, for n=5, // [ . . . . . ] // [ 1 . . . . ] @@ -187,8 +187,8 @@ func (c Creation) Eigenvalues() []complex128 { } // Diagonal is a diagonal matrix given by -// A[i,j] = i+1, if i == j, -// = 0, otherwise. +// A[i,j] = i+1 if i == j, +// = 0 otherwise. // For example, for n=5, // [ 1 . . . . ] // [ . 2 . . . ] @@ -217,8 +217,8 @@ func (d Diagonal) Eigenvalues() []complex128 { } // Downshift is a non-singular upper Hessenberg matrix given by -// A[i,j] = 1, if (i-j+n)%n == 1, -// = 0, otherwise. +// A[i,j] = 1 if (i-j+n)%n == 1, +// = 0 otherwise. // For example, for n=5, // [ . . . . 1 ] // [ 1 . . . . ] diff --git a/mat/cholesky.go b/mat/cholesky.go index 8f54e10c..d1f1efce 100644 --- a/mat/cholesky.go +++ b/mat/cholesky.go @@ -55,8 +55,8 @@ func (c *Cholesky) updateCond(norm float64) { if norm < 0 { // This is an approximation. By the definition of a norm, // |AB| <= |A| |B|. - // Since A = U^T*U, we get for the condition number κ that - // κ(A) := |A| |A^-1| = |U^T*U| |A^-1| <= |U^T| |U| |A^-1|, + // Since A = Uᵀ*U, we get for the condition number κ that + // κ(A) := |A| |A^-1| = |Uᵀ*U| |A^-1| <= |Uᵀ| |U| |A^-1|, // so this will overestimate the condition number somewhat. // The norm of the original factorized matrix cannot be stored // because of update possibilities. @@ -296,7 +296,7 @@ func (c *Cholesky) RawU() Triangular { // UTo extracts the n×n upper triangular matrix U from a Cholesky // decomposition into dst and returns the result. If dst is nil a new // TriDense is allocated. -// A = U^T * U. +// A = Uᵀ * U. func (c *Cholesky) UTo(dst *TriDense) *TriDense { if !c.valid() { panic(badCholesky) @@ -314,7 +314,7 @@ func (c *Cholesky) UTo(dst *TriDense) *TriDense { // LTo extracts the n×n lower triangular matrix L from a Cholesky // decomposition into dst and returns the result. If dst is nil a new // TriDense is allocated. -// A = L * L^T. +// A = L * Lᵀ. func (c *Cholesky) LTo(dst *TriDense) *TriDense { if !c.valid() { panic(badCholesky) @@ -356,7 +356,7 @@ func (c *Cholesky) ToSym(dst *SymDense) *SymDense { cap: n, } u.Copy(c.chol) - // Compute the product U^T*U using the algorithm from LAPACK/TESTING/LIN/dpot01.f + // Compute the product Uᵀ*U using the algorithm from LAPACK/TESTING/LIN/dpot01.f a := u.mat.Data lda := u.mat.Stride bi := blas64.Implementation() @@ -407,9 +407,9 @@ func (c *Cholesky) InverseTo(s *SymDense) error { // Scale multiplies the original matrix A by a positive constant using // its Cholesky decomposition, storing the result in-place into the receiver. // That is, if the original Cholesky factorization is -// U^T * U = A +// Uᵀ * U = A // the updated factorization is -// U'^T * U' = f A = A' +// U'ᵀ * U' = f A = A' // Scale panics if the constant is non-positive, or if the receiver is non-zero // and is of a different size from the input. func (c *Cholesky) Scale(f float64, orig *Cholesky) { @@ -497,9 +497,9 @@ func (c *Cholesky) ExtendVecSym(a *Cholesky, v Vector) (ok bool) { // SymRankOne performs a rank-1 update of the original matrix A and refactorizes // its Cholesky factorization, storing the result into the receiver. That is, if // in the original Cholesky factorization -// U^T * U = A, +// Uᵀ * U = A, // in the updated factorization -// U'^T * U' = A + alpha * x * x^T = A'. +// U'ᵀ * U' = A + alpha * x * xᵀ = A'. // // Note that when alpha is negative, the updating problem may be ill-conditioned // and the results may be inaccurate, or the updated matrix A' may not be @@ -605,7 +605,7 @@ func (c *Cholesky) SymRankOne(orig *Cholesky, alpha float64, x Vector) (ok bool) if alpha != 1 { blas64.Scal(alpha, blas64.Vector{N: n, Data: work, Inc: 1}) } - // Solve U^T * p = x storing the result into work. + // Solve Uᵀ * p = x storing the result into work. ok = lapack64.Trtrs(blas.Trans, c.chol.RawTriangular(), blas64.General{ Rows: n, Cols: 1, diff --git a/mat/cholesky_example_test.go b/mat/cholesky_example_test.go index af00c000..2b395d4a 100644 --- a/mat/cholesky_example_test.go +++ b/mat/cholesky_example_test.go @@ -46,7 +46,7 @@ func ExampleCholesky() { var test mat.Dense test.Mul(t, t.T()) fmt.Println() - fmt.Printf("L * L^T = %0.4v\n", mat.Formatted(&a, mat.Prefix(" "))) + fmt.Printf("L * Lᵀ = %0.4v\n", mat.Formatted(&a, mat.Prefix(" "))) // Output: // a = ⎡120 114 -4 -16⎤ @@ -62,10 +62,10 @@ func ExampleCholesky() { // ⎢-0.04681⎥ // ⎣ 0.1031⎦ // - // L * L^T = ⎡120 114 -4 -16⎤ - // ⎢114 118 11 -24⎥ - // ⎢ -4 11 58 17⎥ - // ⎣-16 -24 17 73⎦ + // L * Lᵀ = ⎡120 114 -4 -16⎤ + // ⎢114 118 11 -24⎥ + // ⎢ -4 11 58 17⎥ + // ⎣-16 -24 17 73⎦ } func ExampleCholesky_SymRankOne() { @@ -96,7 +96,7 @@ func ExampleCholesky_SymRankOne() { // Print the matrix that was updated directly. fmt.Printf("\nA' = %0.4v\n", mat.Formatted(a, mat.Prefix(" "))) // Print the matrix recovered from the factorization. - fmt.Printf("\nU'^T * U' = %0.4v\n", mat.Formatted(au, mat.Prefix(" "))) + fmt.Printf("\nU'ᵀ * U' = %0.4v\n", mat.Formatted(au, mat.Prefix(" "))) // Output: // A = ⎡ 1 1 1 1⎤ @@ -114,7 +114,7 @@ func ExampleCholesky_SymRankOne() { // ⎢ 1 3 6 10⎥ // ⎣ 1 4 10 21⎦ // - // U'^T * U' = ⎡ 1 1 1 1⎤ + // U'ᵀ * U' = ⎡ 1 1 1 1⎤ // ⎢ 1 2 3 4⎥ // ⎢ 1 3 6 10⎥ // ⎣ 1 4 10 21⎦ diff --git a/mat/dense_arithmetic.go b/mat/dense_arithmetic.go index 2132e756..b2b58c9d 100644 --- a/mat/dense_arithmetic.go +++ b/mat/dense_arithmetic.go @@ -298,8 +298,8 @@ func (m *Dense) Mul(a, b Matrix) { // Some of the cases do not have a transpose option, so create // temporary memory. - // C = A^T * B = (B^T * A)^T - // C^T = B^T * A. + // C = Aᵀ * B = (Bᵀ * A)ᵀ + // Cᵀ = Bᵀ * A. if aU, ok := aU.(*Dense); ok { if restore == nil { m.checkOverlap(aU.mat) @@ -756,7 +756,7 @@ func (m *Dense) Apply(fn func(i, j int, v float64) float64, a Matrix) { // RankOne performs a rank-one update to the matrix a with the vectors x and // y, where x and y are treated as column vectors. The result is stored in the // receiver. If a is zero, see Outer. -// m = a + alpha * x * y^T +// m = a + alpha * x * yᵀ func (m *Dense) RankOne(a Matrix, alpha float64, x, y Vector) { ar, ac := a.Dims() if x.Len() != ar { @@ -811,7 +811,7 @@ func (m *Dense) RankOne(a Matrix, alpha float64, x, y Vector) { // Outer calculates the outer product of the vectors x and y, where x and y // are treated as column vectors, and stores the result in the receiver. -// m = alpha * x * y^T +// m = alpha * x * yᵀ // In order to update an existing matrix, see RankOne. func (m *Dense) Outer(alpha float64, x, y Vector) { r, c := x.Len(), y.Len() diff --git a/mat/doc.go b/mat/doc.go index 2cc91001..9158b494 100644 --- a/mat/doc.go +++ b/mat/doc.go @@ -77,7 +77,7 @@ // // The T method is used for transposition on real matrices, and H is used for // conjugate transposition on complex matrices. For example, c.Mul(a.T(), b) computes -// c = a^T * b. The mat types implement this method implicitly — +// c = aᵀ * b. The mat types implement this method implicitly — // see the Transpose and Conjugate types for more details. Note that some // operations have a transpose as part of their definition, as in *SymDense.SymOuterK. // diff --git a/mat/errors.go b/mat/errors.go index 0430d126..b2cb5ee0 100644 --- a/mat/errors.go +++ b/mat/errors.go @@ -37,7 +37,7 @@ const ( // in the matrix packages. CondNorm = lapack.MaxRowSum - // CondNormTrans is the norm used to compute on A^T to get the same result as + // CondNormTrans is the norm used to compute on Aᵀ to get the same result as // computing CondNorm on A. CondNormTrans = lapack.MaxColumnSum ) diff --git a/mat/gsvd.go b/mat/gsvd.go index 2de511a9..17974c1e 100644 --- a/mat/gsvd.go +++ b/mat/gsvd.go @@ -62,12 +62,12 @@ func (gsvd *GSVD) succFact() bool { // input kind. // // The full singular value decomposition (kind == GSVDAll) deconstructs A and B as -// A = U * Σ₁ * [ 0 R ] * Q^T +// A = U * Σ₁ * [ 0 R ] * Qᵀ // -// B = V * Σ₂ * [ 0 R ] * Q^T +// B = V * Σ₂ * [ 0 R ] * Qᵀ // where Σ₁ and Σ₂ are r×(k+l) and p×(k+l) diagonal matrices of singular values, and // U, V and Q are r×r, p×p and c×c orthogonal matrices of singular vectors. k+l is the -// effective numerical rank of the matrix [ A^T B^T ]^T. +// effective numerical rank of the matrix [ Aᵀ Bᵀ ]ᵀ. // // It is frequently not necessary to compute the full GSVD. Computation time and // storage costs can be reduced using the appropriate kind. Either only the singular @@ -156,7 +156,7 @@ func (gsvd *GSVD) Kind() GSVDKind { return gsvd.kind } -// Rank returns the k and l terms of the rank of [ A^T B^T ]^T. +// Rank returns the k and l terms of the rank of [ Aᵀ Bᵀ ]ᵀ. func (gsvd *GSVD) Rank() (k, l int) { return gsvd.k, gsvd.l } diff --git a/mat/gsvd_example_test.go b/mat/gsvd_example_test.go index 4aad56db..65853775 100644 --- a/mat/gsvd_example_test.go +++ b/mat/gsvd_example_test.go @@ -37,8 +37,8 @@ func ExampleGSVD() { var q mat.Dense q.Mul(gsvd.ZeroRTo(nil), gsvd.QTo(nil)) - fmt.Printf("\nCommon basis vectors\n\n\tQ^T = %.4f\n", - mat.Formatted(q.T(), mat.Prefix("\t "))) + fmt.Printf("\nCommon basis vectors\n\n\tQᵀ = %.4f\n", + mat.Formatted(q.T(), mat.Prefix("\t "))) // Calculate the antisymmetric angular distances for each eigenvariable. fmt.Println("\nSignificance:") @@ -74,9 +74,9 @@ func ExampleGSVD() { // // Common basis vectors // - // Q^T = ⎡ -8172.4084 -4524.2933 4813.9616⎤ - // ⎢ 22581.8020 12397.1070 -16364.8933⎥ - // ⎣ -8910.8462 -10902.1488 15762.8719⎦ + // Qᵀ = ⎡ -8172.4084 -4524.2933 4813.9616⎤ + // ⎢ 22581.8020 12397.1070 -16364.8933⎥ + // ⎣ -8910.8462 -10902.1488 15762.8719⎦ // // Significance: // eigenvar_0: +0.7807 diff --git a/mat/gsvd_test.go b/mat/gsvd_test.go index 86597032..b7ddc5e6 100644 --- a/mat/gsvd_test.go +++ b/mat/gsvd_test.go @@ -66,11 +66,11 @@ func TestGSVD(t *testing.T) { d1R.Mul(sigma1, zeroR) d2R.Mul(sigma2, zeroR) if !EqualApprox(&ansU, &d1R, tol) { - t.Errorf("Answer mismatch with GSVDU|GSVDV|GSVDQ\nU^T * A * Q:\n% 0.2f\nΣ₁ * [ 0 R ]:\n% 0.2f", + t.Errorf("Answer mismatch with GSVDU|GSVDV|GSVDQ\nUᵀ * A * Q:\n% 0.2f\nΣ₁ * [ 0 R ]:\n% 0.2f", Formatted(&ansU), Formatted(&d1R)) } if !EqualApprox(&ansV, &d2R, tol) { - t.Errorf("Answer mismatch with GSVDU|GSVDV|GSVDQ\nV^T * B *Q:\n% 0.2f\nΣ₂ * [ 0 R ]:\n% 0.2f", + t.Errorf("Answer mismatch with GSVDU|GSVDV|GSVDQ\nVᵀ * B *Q:\n% 0.2f\nΣ₂ * [ 0 R ]:\n% 0.2f", Formatted(&d2R), Formatted(&ansV)) } diff --git a/mat/hogsvd.go b/mat/hogsvd.go index 61bd94ad..2e311607 100644 --- a/mat/hogsvd.go +++ b/mat/hogsvd.go @@ -33,12 +33,12 @@ func (gsvd *HOGSVD) succFact() bool { // of the n input r_i×c column tall matrices in m. HOGSV extends the GSVD case from 2 to n // input matrices. // -// M_0 = U_0 * Σ_0 * V^T -// M_1 = U_1 * Σ_1 * V^T +// M_0 = U_0 * Σ_0 * Vᵀ +// M_1 = U_1 * Σ_1 * Vᵀ // . // . // . -// M_{n-1} = U_{n-1} * Σ_{n-1} * V^T +// M_{n-1} = U_{n-1} * Σ_{n-1} * Vᵀ // // where U_i are r_i×c matrices of singular vectors, Σ are c×c matrices singular values, and V // is a c×c matrix of singular vectors. diff --git a/mat/hogsvd_example_test.go b/mat/hogsvd_example_test.go index ebd3fb17..66110abc 100644 --- a/mat/hogsvd_example_test.go +++ b/mat/hogsvd_example_test.go @@ -31,7 +31,7 @@ func ExampleHOGSVD() { } v := gsvd.VTo(nil) - fmt.Printf("\nCommon basis vectors\n\n\tV^T = %.4f", + fmt.Printf("\nCommon basis vectors\n\n\tVᵀ = %.4f", mat.Formatted(v.T(), mat.Prefix("\t "))) // Output: @@ -128,7 +128,7 @@ func ExampleHOGSVD() { // // Common basis vectors // - // V^T = ⎡-0.0897 -0.4460 -0.8905⎤ + // Vᵀ = ⎡-0.0897 -0.4460 -0.8905⎤ // ⎢-0.4911 -0.5432 -0.6810⎥ // ⎣ 0.0644 0.2841 0.9566⎦ } diff --git a/mat/hogsvd_test.go b/mat/hogsvd_test.go index 1336ad5b..3c9556df 100644 --- a/mat/hogsvd_test.go +++ b/mat/hogsvd_test.go @@ -21,7 +21,7 @@ func TestHOGSVD(t *testing.T) { {150, 150}, {200, 150}, - // Calculating A_i*A_j^T and A_j*A_i^T fails for wide matrices. + // Calculating A_i*A_jᵀ and A_j*A_iᵀ fails for wide matrices. {3, 5}, } { r := test.r @@ -67,7 +67,7 @@ func TestHOGSVD(t *testing.T) { got.Product(u[i], sigma, v.T()) if !EqualApprox(&got, want, tol) { - t.Errorf("test %d n=%d trial %d: unexpected answer\nU_%[4]d * S_%[4]d * V^T:\n% 0.2f\nD_%d:\n% 0.2f", + t.Errorf("test %d n=%d trial %d: unexpected answer\nU_%[4]d * S_%[4]d * Vᵀ:\n% 0.2f\nD_%d:\n% 0.2f", cas, n, trial, i, Formatted(&got, Excerpt(5)), i, Formatted(want, Excerpt(5))) } } diff --git a/mat/inner.go b/mat/inner.go index 76285181..7607cf9a 100644 --- a/mat/inner.go +++ b/mat/inner.go @@ -11,7 +11,7 @@ import ( ) // Inner computes the generalized inner product -// x^T A y +// xᵀ A y // between the vectors x and y with matrix A, where x and y are treated as // column vectors. // diff --git a/mat/lq.go b/mat/lq.go index e798ebdf..3478812e 100644 --- a/mat/lq.go +++ b/mat/lq.go @@ -24,9 +24,9 @@ type LQ struct { func (lq *LQ) updateCond(norm lapack.MatrixNorm) { // Since A = L*Q, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |L*Q| |(L*Q)^-1| = |L| |Q^T * L^-1| + // κ(A) := |A| |A^-1| = |L*Q| |(L*Q)^-1| = |L| |Qᵀ * L^-1| // = |L| |L^-1| = κ(L), - // where we used that fact that Q^-1 = Q^T. However, this assumes that + // where we used that fact that Q^-1 = Qᵀ. However, this assumes that // the matrix norm is invariant under orthogonal transformations which // is not the case for CondNorm. Hopefully the error is negligible: κ // is only a qualitative measure anyway. diff --git a/mat/lq_test.go b/mat/lq_test.go index c5cc1120..f403b950 100644 --- a/mat/lq_test.go +++ b/mat/lq_test.go @@ -81,8 +81,8 @@ func TestLQSolveTo(t *testing.T) { lq.SolveTo(&x, trans, b) // Test that the normal equations hold. - // A^T * A * x = A^T * b if !trans - // A * A^T * x = A * b if trans + // Aᵀ * A * x = Aᵀ * b if !trans + // A * Aᵀ * x = A * b if trans var lhs Dense var rhs Dense if trans { @@ -134,8 +134,8 @@ func TestLQSolveToVec(t *testing.T) { lq.SolveVecTo(&x, trans, b) // Test that the normal equations hold. - // A^T * A * x = A^T * b if !trans - // A * A^T * x = A * b if trans + // Aᵀ * A * x = Aᵀ * b if !trans + // A * Aᵀ * x = A * b if trans var lhs Dense var rhs Dense if trans { diff --git a/mat/lu.go b/mat/lu.go index e0437169..a2769604 100644 --- a/mat/lu.go +++ b/mat/lu.go @@ -179,7 +179,7 @@ func (lu *LU) Pivot(swaps []int) []int { // RankOne updates an LU factorization as if a rank-one update had been applied to // the original matrix A, storing the result into the receiver. That is, if in // the original LU decomposition P * L * U = A, in the updated decomposition -// P * L * U = A + alpha * x * y^T. +// P * L * U = A + alpha * x * yᵀ. // RankOne will panic if orig does not contain a factorization. func (lu *LU) RankOne(orig *LU, alpha float64, x, y Vector) { if !orig.isValid() { @@ -318,7 +318,7 @@ func (m *Dense) Permutation(r int, swaps []int) { // SolveTo solves a system of linear equations using the LU decomposition of a matrix. // It computes // A * X = B if trans == false -// A^T * X = B if trans == true +// Aᵀ * X = B if trans == true // In both cases, A is represented in LU factorized form, and the matrix X is // stored into dst. // @@ -366,7 +366,7 @@ func (lu *LU) SolveTo(dst *Dense, trans bool, b Matrix) error { // SolveVecTo solves a system of linear equations using the LU decomposition of a matrix. // It computes // A * x = b if trans == false -// A^T * x = b if trans == true +// Aᵀ * x = b if trans == true // In both cases, A is represented in LU factorized form, and the vector x is // stored into dst. // diff --git a/mat/matrix.go b/mat/matrix.go index fa9f1e85..7da6e56c 100644 --- a/mat/matrix.go +++ b/mat/matrix.go @@ -580,7 +580,7 @@ func Max(a Matrix) float64 { if r == 0 || c == 0 { panic(ErrShape) } - // Max(A) = Max(A^T) + // Max(A) = Max(Aᵀ) aU, _ := untranspose(a) switch m := aU.(type) { case RawMatrixer: @@ -655,7 +655,7 @@ func Min(a Matrix) float64 { if r == 0 || c == 0 { panic(ErrShape) } - // Min(A) = Min(A^T) + // Min(A) = Min(Aᵀ) aU, _ := untranspose(a) switch m := aU.(type) { case RawMatrixer: diff --git a/mat/qr.go b/mat/qr.go index e1cc8fd7..102d4db5 100644 --- a/mat/qr.go +++ b/mat/qr.go @@ -24,9 +24,9 @@ type QR struct { func (qr *QR) updateCond(norm lapack.MatrixNorm) { // Since A = Q*R, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |Q*R| |(Q*R)^-1| = |R| |R^-1 * Q^T| + // κ(A) := |A| |A^-1| = |Q*R| |(Q*R)^-1| = |R| |R^-1 * Qᵀ| // = |R| |R^-1| = κ(R), - // where we used that fact that Q^-1 = Q^T. However, this assumes that + // where we used that fact that Q^-1 = Qᵀ. However, this assumes that // the matrix norm is invariant under orthogonal transformations which // is not the case for CondNorm. Hopefully the error is negligible: κ // is only a qualitative measure anyway. @@ -159,7 +159,7 @@ func (qr *QR) QTo(dst *Dense) *Dense { // // The minimization problem solved depends on the input parameters. // If trans == false, find X such that ||A*X - B||_2 is minimized. -// If trans == true, find the minimum norm solution of A^T * X = B. +// If trans == true, find the minimum norm solution of Aᵀ * X = B. // The solution matrix, X, is stored in place into dst. // SolveTo will panic if the receiver does not contain a factorization. func (qr *QR) SolveTo(dst *Dense, trans bool, b Matrix) error { diff --git a/mat/qr_test.go b/mat/qr_test.go index 7e591040..6452dad8 100644 --- a/mat/qr_test.go +++ b/mat/qr_test.go @@ -105,8 +105,8 @@ func TestQRSolveTo(t *testing.T) { qr.SolveTo(&x, trans, b) // Test that the normal equations hold. - // A^T * A * x = A^T * b if !trans - // A * A^T * x = A * b if trans + // Aᵀ * A * x = Aᵀ * b if !trans + // A * Aᵀ * x = A * b if trans var lhs Dense var rhs Dense if trans { @@ -158,8 +158,8 @@ func TestQRSolveVecTo(t *testing.T) { qr.SolveVecTo(&x, trans, b) // Test that the normal equations hold. - // A^T * A * x = A^T * b if !trans - // A * A^T * x = A * b if trans + // Aᵀ * A * x = Aᵀ * b if !trans + // A * Aᵀ * x = A * b if trans var lhs Dense var rhs Dense if trans { diff --git a/mat/solve_test.go b/mat/solve_test.go index 7f4c7362..dadbd241 100644 --- a/mat/solve_test.go +++ b/mat/solve_test.go @@ -217,7 +217,7 @@ func TestSolve(t *testing.T) { x.Solve(a, b) // Test that the normal equations hold. - // A^T * A * x = A^T * b + // Aᵀ * A * x = Aᵀ * b var tmp, lhs, rhs Dense tmp.Mul(a.T(), a) lhs.Mul(&tmp, &x) @@ -272,7 +272,7 @@ func TestSolveVec(t *testing.T) { x.SolveVec(a, b) // Test that the normal equations hold. - // A^T * A * x = A^T * b + // Aᵀ * A * x = Aᵀ * b var tmp, lhs, rhs Dense tmp.Mul(a.T(), a) lhs.Mul(&tmp, &x) diff --git a/mat/svd.go b/mat/svd.go index 2f55c411..4c5c8d01 100644 --- a/mat/svd.go +++ b/mat/svd.go @@ -55,7 +55,7 @@ func (svd *SVD) succFact() bool { // // The full singular value decomposition (kind == SVDFull) is a factorization // of an m×n matrix A of the form -// A = U * Σ * V^T +// A = U * Σ * Vᵀ // where Σ is an m×n diagonal matrix, U is an m×m orthogonal matrix, and V is an // n×n orthogonal matrix. The diagonal elements of Σ are the singular values of A. // The first min(m,n) columns of U and V are, respectively, the left and right @@ -64,7 +64,7 @@ func (svd *SVD) succFact() bool { // Significant storage space can be saved by using the thin representation of // the SVD (kind == SVDThin) instead of the full SVD, especially if // m >> n or m << n. The thin SVD finds -// A = U~ * Σ * V~^T +// A = U~ * Σ * V~ᵀ // where U~ is of size m×min(m,n), Σ is a diagonal matrix of size min(m,n)×min(m,n) // and V~ is of size n×min(m,n). // diff --git a/mat/symmetric.go b/mat/symmetric.go index 6c8c5be3..10efbf50 100644 --- a/mat/symmetric.go +++ b/mat/symmetric.go @@ -265,7 +265,7 @@ func (s *SymDense) CopySym(a Symmetric) int { // SymRankOne performs a symmetric rank-one update to the matrix a with x, // which is treated as a column vector, and stores the result in the receiver -// s = a + alpha * x * x^T +// s = a + alpha * x * xᵀ func (s *SymDense) SymRankOne(a Symmetric, alpha float64, x Vector) { n := x.Len() if a.Symmetric() != n { @@ -376,7 +376,7 @@ func (s *SymDense) SymOuterK(alpha float64, x Matrix) { // RankTwo performs a symmetric rank-two update to the matrix a with the // vectors x and y, which are treated as column vectors, and stores the // result in the receiver -// m = a + alpha * (x * y^T + y * x^T) +// m = a + alpha * (x * yᵀ + y * xᵀ) func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { n := s.mat.N if x.Len() != n { diff --git a/optimize/bfgs.go b/optimize/bfgs.go index ad8947a1..3b2678ad 100644 --- a/optimize/bfgs.go +++ b/optimize/bfgs.go @@ -157,10 +157,10 @@ func (b *BFGS) NextDirection(loc *Location, dir []float64) (stepSize float64) { // Update the inverse Hessian according to the formula // // B_{k+1}^-1 = B_k^-1 - // + (s_k^T y_k + y_k^T B_k^-1 y_k) / (s_k^T y_k)^2 * (s_k s_k^T) - // - (B_k^-1 y_k s_k^T + s_k y_k^T B_k^-1) / (s_k^T y_k). + // + (s_kᵀ y_k + y_kᵀ B_k^-1 y_k) / (s_kᵀ y_k)^2 * (s_k s_kᵀ) + // - (B_k^-1 y_k s_kᵀ + s_k y_kᵀ B_k^-1) / (s_kᵀ y_k). // - // Note that y_k^T B_k^-1 y_k is a scalar, and that the third term is a + // Note that y_kᵀ B_k^-1 y_k is a scalar, and that the third term is a // rank-two update where B_k^-1 y_k is one vector and s_k is the other. yBy := mat.Inner(&b.y, b.invHess, &b.y) b.tmp.MulVec(b.invHess, &b.y) diff --git a/optimize/convex/lp/convert.go b/optimize/convex/lp/convert.go index 72e8cba0..2db3adad 100644 --- a/optimize/convex/lp/convert.go +++ b/optimize/convex/lp/convert.go @@ -19,11 +19,11 @@ import ( // Convert converts a General-form LP into a standard form LP. // The general form of an LP is: -// minimize c^T * x +// minimize cᵀ * x // s.t G * x <= h // A * x = b // And the standard form is: -// minimize cNew^T * x +// minimize cNewᵀ * x // s.t aNew * x = bNew // x >= 0 // If there are no constraints of the given type, the inputs may be nil. @@ -64,11 +64,11 @@ func Convert(c []float64, g mat.Matrix, h []float64, a mat.Matrix, b []float64) // Convert the general form LP. // Derivation: // 0. Start with general form - // min. c^T * x + // min. cᵀ * x // s.t. G * x <= h // A * x = b // 1. Introduce slack variables for each constraint - // min. c^T * x + // min. cᵀ * x // s.t. G * x + s = h // A * x = b // s >= 0 @@ -77,7 +77,7 @@ func Convert(c []float64, g mat.Matrix, h []float64, a mat.Matrix, b []float64) // x = xp - xn // xp >= 0, xn >= 0 // This makes the LP - // min. c^T * xp - c^T xn + // min. cᵀ * xp - cᵀ xn // s.t. G * xp - G * xn + s = h // A * xp - A * xn = b // xp >= 0, xn >= 0, s >= 0 @@ -85,19 +85,19 @@ func Convert(c []float64, g mat.Matrix, h []float64, a mat.Matrix, b []float64) // xt = [xp // xn // s ] - // min. [c^T, -c^T, 0] xt + // min. [cᵀ, -cᵀ, 0] xt // s.t. [G, -G, I] xt = h // [A, -A, 0] xt = b // x >= 0 // In summary: // Original LP: - // min. c^T * x + // min. cᵀ * x // s.t. G * x <= h // A * x = b // Standard Form: // xt = [xp; xn; s] - // min. [c^T, -c^T, 0] xt + // min. [cᵀ, -cᵀ, 0] xt // s.t. [G, -G, I] xt = h // [A, -A, 0] xt = b // x >= 0 diff --git a/optimize/convex/lp/simplex.go b/optimize/convex/lp/simplex.go index 9ebbe483..57fa5ec2 100644 --- a/optimize/convex/lp/simplex.go +++ b/optimize/convex/lp/simplex.go @@ -59,7 +59,7 @@ const ( // Simplex solves a linear program in standard form using Danzig's Simplex // algorithm. The standard form of a linear program is: -// minimize c^T x +// minimize cᵀ x // s.t. A*x = b // x >= 0 . // The input tol sets how close to the optimal solution is found (specifically, @@ -209,7 +209,7 @@ func simplex(initialBasic []int, c []float64, A mat.Matrix, b []float64, tol flo // Algorithm: // 1) Compute the "reduced costs" for the non-basic variables. The reduced // costs are the lagrange multipliers of the constraints. - // r = cn - an^T * ab^-T * cb + // r = cn - anᵀ * ab¯ᵀ * cb // 2) If all of the reduced costs are positive, no improvement is possible, // and the solution is optimal (xn can only increase because of // non-negativity constraints). Otherwise, the solution can be improved and @@ -231,7 +231,7 @@ func simplex(initialBasic []int, c []float64, A mat.Matrix, b []float64, tol flo // the intersection of several constraints. Use the Bland rule instead // of the rule in step 4 to avoid cycling. for { - // Compute reduced costs -- r = cn - an^T ab^-T cb + // Compute reduced costs -- r = cn - anᵀ ab¯ᵀ cb var tmp mat.VecDense err = tmp.SolveVec(ab.T(), cbVec) if err != nil { diff --git a/optimize/convex/lp/simplex_test.go b/optimize/convex/lp/simplex_test.go index 42516f0f..4ed2fb80 100644 --- a/optimize/convex/lp/simplex_test.go +++ b/optimize/convex/lp/simplex_test.go @@ -207,14 +207,14 @@ func testSimplex(t *testing.T, initialBasic []int, c []float64, a mat.Matrix, b // Construct and solve the dual LP. // Standard Form: - // minimize c^T * x + // minimize cᵀ * x // subject to A * x = b, x >= 0 // The dual of this problem is - // maximize -b^T * nu - // subject to A^T * nu + c >= 0 + // maximize -bᵀ * nu + // subject to Aᵀ * nu + c >= 0 // Which is - // minimize b^T * nu - // subject to -A^T * nu <= c + // minimize bᵀ * nu + // subject to -Aᵀ * nu <= c negAT := &mat.Dense{} negAT.CloneFrom(a.T()) @@ -238,7 +238,7 @@ func testSimplex(t *testing.T, initialBasic []int, c []float64, a mat.Matrix, b // If the primal problem is feasible, then the primal and the dual should // be the same answer. We have flopped the sign in the dual (minimizing - // b^T *nu instead of maximizing -b^T*nu), so flip it back. + // bᵀ * nu instead of maximizing -bᵀ * nu), so flip it back. if errPrimal == nil { if errDual != nil { t.Errorf("Primal feasible but dual errored: %s", errDual) diff --git a/stat/distmat/wishart.go b/stat/distmat/wishart.go index 38f9d6d7..5533b013 100644 --- a/stat/distmat/wishart.go +++ b/stat/distmat/wishart.go @@ -127,7 +127,7 @@ func (w *Wishart) logProbSymChol(cholX *mat.Cholesky) float64 { // (ν-d-1)/2 * log(|X|) - tr(V^-1 * X)/2 - (ν*d/2)*log(2) - ν/2 * log(|V|) - log(Γ_d(ν/2)) logdetx := cholX.LogDet() - // Compute tr(V^-1 * X), using the fact that X = U^T * U. + // Compute tr(V^-1 * X), using the fact that X = Uᵀ * U. var u mat.TriDense cholX.UTo(&u) @@ -162,7 +162,7 @@ func (w *Wishart) RandChol(c *mat.Cholesky) *mat.Cholesky { // to avoid the dim^2 allocation here. // Use the Bartlett Decomposition, which says that - // X ~ L A A^T L^T + // X ~ L A Aᵀ Lᵀ // Where A is a lower triangular matrix in which the diagonal of A is // generated from the square roots of χ^2 random variables, and the // off-diagonals are generated from standard normal variables. @@ -170,8 +170,8 @@ func (w *Wishart) RandChol(c *mat.Cholesky) *mat.Cholesky { // // mat64 works with the upper triagular decomposition, so we would like to do // the same. We can instead say that - // U_x = L_x^T = (L * A)^T = A^T * L^T = A^T * U - // Instead, generate A^T, by using the procedure above, except as an upper + // U_x = L_xᵀ = (L * A)ᵀ = Aᵀ * Lᵀ = Aᵀ * U + // Instead, generate Aᵀ, by using the procedure above, except as an upper // triangular matrix. norm := distuv.Normal{ Mu: 0, diff --git a/stat/distmv/normal.go b/stat/distmv/normal.go index 410a6293..bcbe2bb7 100644 --- a/stat/distmv/normal.go +++ b/stat/distmv/normal.go @@ -118,8 +118,8 @@ func NewNormalPrecision(mu []float64, prec *mat.SymDense, src rand.Source) (norm // on the input evidence. The returned multivariate normal has dimension // n - len(observed), where n is the dimension of the original receiver. The updated // mean and covariance are -// mu = mu_un + sigma_{ob,un}^T * sigma_{ob,ob}^-1 (v - mu_ob) -// sigma = sigma_{un,un} - sigma_{ob,un}^T * sigma_{ob,ob}^-1 * sigma_{ob,un} +// mu = mu_un + sigma_{ob,un}ᵀ * sigma_{ob,ob}^-1 (v - mu_ob) +// sigma = sigma_{un,un} - sigma_{ob,un}ᵀ * sigma_{ob,ob}^-1 * sigma_{ob,un} // where mu_un and mu_ob are the original means of the unobserved and observed // variables respectively, sigma_{un,un} is the unobserved subset of the covariance // matrix, sigma_{ob,ob} is the observed subset of the covariance matrix, and diff --git a/stat/distmv/statdist.go b/stat/distmv/statdist.go index d525e63a..34fddae6 100644 --- a/stat/distmv/statdist.go +++ b/stat/distmv/statdist.go @@ -32,7 +32,7 @@ type Bhattacharyya struct{} // // For Normal distributions, the Bhattacharyya distance is // Σ = (Σ_l + Σ_r)/2 -// D_B = (1/8)*(μ_l - μ_r)^T*Σ^-1*(μ_l - μ_r) + (1/2)*ln(det(Σ)/(det(Σ_l)*det(Σ_r))^(1/2)) +// D_B = (1/8)*(μ_l - μ_r)ᵀ*Σ^-1*(μ_l - μ_r) + (1/2)*ln(det(Σ)/(det(Σ_l)*det(Σ_r))^(1/2)) func (Bhattacharyya) DistNormal(l, r *Normal) float64 { dim := l.Dim() if dim != r.Dim() { @@ -179,7 +179,7 @@ func (KullbackLeibler) DistDirichlet(l, r *Dirichlet) float64 { // The dimensions of the input distributions must match or DistNormal will panic. // // For two normal distributions, the KL divergence is computed as -// D_KL(l || r) = 0.5*[ln(|Σ_r|) - ln(|Σ_l|) + (μ_l - μ_r)^T*Σ_r^-1*(μ_l - μ_r) + tr(Σ_r^-1*Σ_l)-d] +// D_KL(l || r) = 0.5*[ln(|Σ_r|) - ln(|Σ_l|) + (μ_l - μ_r)ᵀ*Σ_r^-1*(μ_l - μ_r) + tr(Σ_r^-1*Σ_l)-d] func (KullbackLeibler) DistNormal(l, r *Normal) float64 { dim := l.Dim() if dim != r.Dim() { @@ -191,7 +191,7 @@ func (KullbackLeibler) DistNormal(l, r *Normal) float64 { // TODO(btracey): Optimize where there is a SolveCholeskySym // TODO(btracey): There may be a more efficient way to just compute the trace - // Compute tr(Σ_r^-1*Σ_l) using the fact that Σ_l = U^T * U + // Compute tr(Σ_r^-1*Σ_l) using the fact that Σ_l = Uᵀ * U var u mat.TriDense l.chol.UTo(&u) var m mat.Dense diff --git a/stat/distmv/studentst.go b/stat/distmv/studentst.go index 6b2f46f2..7e83be74 100644 --- a/stat/distmv/studentst.go +++ b/stat/distmv/studentst.go @@ -20,7 +20,7 @@ import ( // StudentsT is a multivariate Student's T distribution. It is a distribution over // ℝ^n with the probability density // p(y) = (Γ((ν+n)/2) / Γ(ν/2)) * (νπ)^(-n/2) * |Ʃ|^(-1/2) * -// (1 + 1/ν * (y-μ)^T * Ʃ^-1 * (y-μ))^(-(ν+n)/2) +// (1 + 1/ν * (y-μ)ᵀ * Ʃ^-1 * (y-μ))^(-(ν+n)/2) // where ν is a scalar greater than 2, μ is a vector in ℝ^n, and Ʃ is an n×n // symmetric positive definite matrix. // @@ -157,7 +157,7 @@ func studentsTConditional(observed []int, values []float64, nu float64, mu []flo return math.NaN(), nil, nil } - // Compute mu_1 + sigma_{2,1}^T * sigma_{2,2}^-1 (v - mu_2). + // Compute mu_1 + sigma_{2,1}ᵀ * sigma_{2,2}^-1 (v - mu_2). v := mat.NewVecDense(ob, mu2) var tmp, tmp2 mat.VecDense err := chol.SolveVecTo(&tmp, v) @@ -170,7 +170,7 @@ func studentsTConditional(observed []int, values []float64, nu float64, mu []flo mu1[i] += tmp2.At(i, 0) } - // Compute tmp4 = sigma_{2,1}^T * sigma_{2,2}^-1 * sigma_{2,1}. + // Compute tmp4 = sigma_{2,1}ᵀ * sigma_{2,2}^-1 * sigma_{2,1}. // TODO(btracey): Should this be a method of SymDense? var tmp3, tmp4 mat.Dense err = chol.SolveTo(&tmp3, sigma21) @@ -194,7 +194,7 @@ func studentsTConditional(observed []int, values []float64, nu float64, mu []flo return nu, mu1, &sigma11 } - // Compute beta = (v - mu_2)^T * sigma_{2,2}^-1 * (v - mu_2)^T + // Compute beta = (v - mu_2)ᵀ * sigma_{2,2}^-1 * (v - mu_2)ᵀ beta := mat.Dot(v, &tmp) // Scale the covariance matrix diff --git a/stat/pca_cca.go b/stat/pca_cca.go index 2613d7ae..5c9e06af 100644 --- a/stat/pca_cca.go +++ b/stat/pca_cca.go @@ -130,8 +130,8 @@ type CC struct { // as Xc * Sx^{-1/2} and Yc * Sy^{-1/2} respectively, and the correlation matrix // between the sphered data is called the canonical correlation matrix, // Sx^{-1/2} * Sxy * Sy^{-1/2}. In cases where S^{-1/2} is ambiguous for some -// covariance matrix S, S^{-1/2} is taken to be E * D^{-1/2} * E^T where S can -// be eigendecomposed as S = E * D * E^T. +// covariance matrix S, S^{-1/2} is taken to be E * D^{-1/2} * Eᵀ where S can +// be eigendecomposed as S = E * D * Eᵀ. // // The canonical correlations are the correlations between the corresponding // pairs of canonical variables and can be obtained with c.Corrs(). Canonical diff --git a/stat/pca_test.go b/stat/pca_test.go index d3c89e34..18356270 100644 --- a/stat/pca_test.go +++ b/stat/pca_test.go @@ -182,7 +182,7 @@ tests: } // Check that the set of principal vectors is - // orthonormal by comparing V^T*V to the identity matrix. + // orthonormal by comparing Vᵀ*V to the identity matrix. I := mat.NewDiagDense(c, nil) for k := 0; k < c; k++ { I.SetDiag(k, 1) diff --git a/stat/statmat.go b/stat/statmat.go index 285623e2..13965d9c 100644 --- a/stat/statmat.go +++ b/stat/statmat.go @@ -123,7 +123,7 @@ func corrToCov(c *mat.SymDense, sigma []float64) { } // Mahalanobis computes the Mahalanobis distance -// D = sqrt((x-y)^T * Σ^-1 * (x-y)) +// D = sqrt((x-y)ᵀ * Σ^-1 * (x-y)) // between the column vectors x and y given the cholesky decomposition of Σ. // Mahalanobis returns NaN if the linear solve fails. //