github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/lapack/lapack.go (about) 1 // Copyright ©2015 The Gonum Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package lapack 6 7 import "github.com/jingcheng-WU/gonum/blas" 8 9 // Complex128 defines the public complex128 LAPACK API supported by gonum/lapack. 10 type Complex128 interface{} 11 12 // Float64 defines the public float64 LAPACK API supported by gonum/lapack. 13 type Float64 interface { 14 Dgecon(norm MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 15 Dgeev(jobvl LeftEVJob, jobvr RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) 16 Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool 17 Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) 18 Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) 19 Dgesvd(jobU, jobVT SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool) 20 Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool) 21 Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool) 22 Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int) 23 Dggsvd3(jobU, jobV, jobQ GSVDJob, m, n, p int, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int) (k, l int, ok bool) 24 Dlantr(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64 25 Dlange(norm MatrixNorm, m, n int, a []float64, lda int, work []float64) float64 26 Dlansy(norm MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64 27 Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int) 28 Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) 29 Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) 30 Dpbcon(uplo blas.Uplo, n, kd int, ab []float64, ldab int, anorm float64, work []float64, iwork []int) float64 31 Dpbtrf(uplo blas.Uplo, n, kd int, ab []float64, ldab int) (ok bool) 32 Dpbtrs(uplo blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) 33 Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 34 Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) 35 Dpotri(ul blas.Uplo, n int, a []float64, lda int) (ok bool) 36 Dpotrs(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) 37 Dsyev(jobz EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) (ok bool) 38 Dtbtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, kd, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) 39 Dtrcon(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int, work []float64, iwork []int) float64 40 Dtrtri(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) (ok bool) 41 Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) 42 } 43 44 // Direct specifies the direction of the multiplication for the Householder matrix. 45 type Direct byte 46 47 const ( 48 Forward Direct = 'F' // Reflectors are right-multiplied, H_0 * H_1 * ... * H_{k-1}. 49 Backward Direct = 'B' // Reflectors are left-multiplied, H_{k-1} * ... * H_1 * H_0. 50 ) 51 52 // Sort is the sorting order. 53 type Sort byte 54 55 const ( 56 SortIncreasing Sort = 'I' 57 SortDecreasing Sort = 'D' 58 ) 59 60 // StoreV indicates the storage direction of elementary reflectors. 61 type StoreV byte 62 63 const ( 64 ColumnWise StoreV = 'C' // Reflector stored in a column of the matrix. 65 RowWise StoreV = 'R' // Reflector stored in a row of the matrix. 66 ) 67 68 // MatrixNorm represents the kind of matrix norm to compute. 69 type MatrixNorm byte 70 71 const ( 72 MaxAbs MatrixNorm = 'M' // max(abs(A(i,j))) 73 MaxColumnSum MatrixNorm = 'O' // Maximum absolute column sum (one norm) 74 MaxRowSum MatrixNorm = 'I' // Maximum absolute row sum (infinity norm) 75 Frobenius MatrixNorm = 'F' // Frobenius norm (sqrt of sum of squares) 76 ) 77 78 // MatrixType represents the kind of matrix represented in the data. 79 type MatrixType byte 80 81 const ( 82 General MatrixType = 'G' // A general dense matrix. 83 UpperTri MatrixType = 'U' // An upper triangular matrix. 84 LowerTri MatrixType = 'L' // A lower triangular matrix. 85 ) 86 87 // Pivot specifies the pivot type for plane rotations. 88 type Pivot byte 89 90 const ( 91 Variable Pivot = 'V' 92 Top Pivot = 'T' 93 Bottom Pivot = 'B' 94 ) 95 96 // ApplyOrtho specifies which orthogonal matrix is applied in Dormbr. 97 type ApplyOrtho byte 98 99 const ( 100 ApplyP ApplyOrtho = 'P' // Apply P or Pᵀ. 101 ApplyQ ApplyOrtho = 'Q' // Apply Q or Qᵀ. 102 ) 103 104 // GenOrtho specifies which orthogonal matrix is generated in Dorgbr. 105 type GenOrtho byte 106 107 const ( 108 GeneratePT GenOrtho = 'P' // Generate Pᵀ. 109 GenerateQ GenOrtho = 'Q' // Generate Q. 110 ) 111 112 // SVDJob specifies the singular vector computation type for SVD. 113 type SVDJob byte 114 115 const ( 116 SVDAll SVDJob = 'A' // Compute all columns of the orthogonal matrix U or V. 117 SVDStore SVDJob = 'S' // Compute the singular vectors and store them in the orthogonal matrix U or V. 118 SVDOverwrite SVDJob = 'O' // Compute the singular vectors and overwrite them on the input matrix A. 119 SVDNone SVDJob = 'N' // Do not compute singular vectors. 120 ) 121 122 // GSVDJob specifies the singular vector computation type for Generalized SVD. 123 type GSVDJob byte 124 125 const ( 126 GSVDU GSVDJob = 'U' // Compute orthogonal matrix U. 127 GSVDV GSVDJob = 'V' // Compute orthogonal matrix V. 128 GSVDQ GSVDJob = 'Q' // Compute orthogonal matrix Q. 129 GSVDUnit GSVDJob = 'I' // Use unit-initialized matrix. 130 GSVDNone GSVDJob = 'N' // Do not compute orthogonal matrix. 131 ) 132 133 // EVComp specifies how eigenvectors are computed in Dsteqr. 134 type EVComp byte 135 136 const ( 137 EVOrig EVComp = 'V' // Compute eigenvectors of the original symmetric matrix. 138 EVTridiag EVComp = 'I' // Compute eigenvectors of the tridiagonal matrix. 139 EVCompNone EVComp = 'N' // Do not compute eigenvectors. 140 ) 141 142 // EVJob specifies whether eigenvectors are computed in Dsyev. 143 type EVJob byte 144 145 const ( 146 EVCompute EVJob = 'V' // Compute eigenvectors. 147 EVNone EVJob = 'N' // Do not compute eigenvectors. 148 ) 149 150 // LeftEVJob specifies whether left eigenvectors are computed in Dgeev. 151 type LeftEVJob byte 152 153 const ( 154 LeftEVCompute LeftEVJob = 'V' // Compute left eigenvectors. 155 LeftEVNone LeftEVJob = 'N' // Do not compute left eigenvectors. 156 ) 157 158 // RightEVJob specifies whether right eigenvectors are computed in Dgeev. 159 type RightEVJob byte 160 161 const ( 162 RightEVCompute RightEVJob = 'V' // Compute right eigenvectors. 163 RightEVNone RightEVJob = 'N' // Do not compute right eigenvectors. 164 ) 165 166 // BalanceJob specifies matrix balancing operation. 167 type BalanceJob byte 168 169 const ( 170 Permute BalanceJob = 'P' 171 Scale BalanceJob = 'S' 172 PermuteScale BalanceJob = 'B' 173 BalanceNone BalanceJob = 'N' 174 ) 175 176 // SchurJob specifies whether the Schur form is computed in Dhseqr. 177 type SchurJob byte 178 179 const ( 180 EigenvaluesOnly SchurJob = 'E' 181 EigenvaluesAndSchur SchurJob = 'S' 182 ) 183 184 // SchurComp specifies whether and how the Schur vectors are computed in Dhseqr. 185 type SchurComp byte 186 187 const ( 188 SchurOrig SchurComp = 'V' // Compute Schur vectors of the original matrix. 189 SchurHess SchurComp = 'I' // Compute Schur vectors of the upper Hessenberg matrix. 190 SchurNone SchurComp = 'N' // Do not compute Schur vectors. 191 ) 192 193 // UpdateSchurComp specifies whether the matrix of Schur vectors is updated in Dtrexc. 194 type UpdateSchurComp byte 195 196 const ( 197 UpdateSchur UpdateSchurComp = 'V' // Update the matrix of Schur vectors. 198 UpdateSchurNone UpdateSchurComp = 'N' // Do not update the matrix of Schur vectors. 199 ) 200 201 // EVSide specifies what eigenvectors are computed in Dtrevc3. 202 type EVSide byte 203 204 const ( 205 EVRight EVSide = 'R' // Compute only right eigenvectors. 206 EVLeft EVSide = 'L' // Compute only left eigenvectors. 207 EVBoth EVSide = 'B' // Compute both right and left eigenvectors. 208 ) 209 210 // EVHowMany specifies which eigenvectors are computed in Dtrevc3 and how. 211 type EVHowMany byte 212 213 const ( 214 EVAll EVHowMany = 'A' // Compute all right and/or left eigenvectors. 215 EVAllMulQ EVHowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix. 216 EVSelected EVHowMany = 'S' // Compute selected right and/or left eigenvectors. 217 )