OSDN Git Service

new repo
[bytom/vapor.git] / vendor / gonum.org / v1 / gonum / lapack / lapack.go
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 // import "gonum.org/v1/gonum/lapack"
6
7 import "gonum.org/v1/gonum/blas"
8
9 const None = 'N'
10
11 type Job byte
12
13 type Comp byte
14
15 // Complex128 defines the public complex128 LAPACK API supported by gonum/lapack.
16 type Complex128 interface{}
17
18 // Float64 defines the public float64 LAPACK API supported by gonum/lapack.
19 type Float64 interface {
20         Dgecon(norm MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64
21         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)
22         Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool
23         Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int)
24         Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int)
25         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)
26         Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool)
27         Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool)
28         Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int)
29         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)
30         Dlantr(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64
31         Dlange(norm MatrixNorm, m, n int, a []float64, lda int, work []float64) float64
32         Dlansy(norm MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64
33         Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int)
34         Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int)
35         Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int)
36         Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64
37         Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool)
38         Dsyev(jobz EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork 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)))  ('M')
73         MaxColumnSum MatrixNorm = 'O' // Maximum column sum (one norm) ('1', 'O')
74         MaxRowSum    MatrixNorm = 'I' // Maximum row sum (infinity norm) ('I', 'i')
75         NormFrob     MatrixNorm = 'F' // Frobenius norm (sqrt of sum of squares) ('F', 'f', E, 'e')
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 dense matrix (like blas64.General).
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 type DecompUpdate byte
97
98 const (
99         ApplyP DecompUpdate = 'P'
100         ApplyQ DecompUpdate = 'Q'
101 )
102
103 // SVDJob specifies the singular vector computation type for SVD.
104 type SVDJob byte
105
106 const (
107         SVDAll       SVDJob = 'A' // Compute all singular vectors
108         SVDInPlace   SVDJob = 'S' // Compute the first singular vectors and store them in provided storage.
109         SVDOverwrite SVDJob = 'O' // Compute the singular vectors and store them in input matrix
110         SVDNone      SVDJob = 'N' // Do not compute singular vectors
111 )
112
113 // GSVDJob specifies the singular vector computation type for Generalized SVD.
114 type GSVDJob byte
115
116 const (
117         GSVDU    GSVDJob = 'U' // Compute orthogonal matrix U
118         GSVDV    GSVDJob = 'V' // Compute orthogonal matrix V
119         GSVDQ    GSVDJob = 'Q' // Compute orthogonal matrix Q
120         GSVDUnit GSVDJob = 'I' // Use unit-initialized matrix
121         GSVDNone GSVDJob = 'N' // Do not compute orthogonal matrix
122 )
123
124 // EVComp specifies how eigenvectors are computed.
125 type EVComp byte
126
127 const (
128         // OriginalEV specifies to compute the eigenvectors of the original
129         // matrix.
130         OriginalEV EVComp = 'V'
131         // TridiagEV specifies to compute both the eigenvectors of the input
132         // tridiagonal matrix.
133         TridiagEV EVComp = 'I'
134         // HessEV specifies to compute both the eigenvectors of the input upper
135         // Hessenberg matrix.
136         HessEV EVComp = 'I'
137
138         // UpdateSchur specifies that the matrix of Schur vectors will be
139         // updated by Dtrexc.
140         UpdateSchur EVComp = 'V'
141 )
142
143 // Job types for computation of eigenvectors.
144 type (
145         EVJob      byte
146         LeftEVJob  byte
147         RightEVJob byte
148 )
149
150 // Job constants for computation of eigenvectors.
151 const (
152         ComputeEV      EVJob      = 'V' // Compute eigenvectors in Dsyev.
153         ComputeLeftEV  LeftEVJob  = 'V' // Compute left eigenvectors.
154         ComputeRightEV RightEVJob = 'V' // Compute right eigenvectors.
155 )
156
157 // Jobs for Dgebal.
158 const (
159         Permute      Job = 'P'
160         Scale        Job = 'S'
161         PermuteScale Job = 'B'
162 )
163
164 // Job constants for Dhseqr.
165 const (
166         EigenvaluesOnly     EVJob = 'E'
167         EigenvaluesAndSchur EVJob = 'S'
168 )
169
170 // EVSide specifies what eigenvectors will be computed.
171 type EVSide byte
172
173 // EVSide constants for Dtrevc3.
174 const (
175         RightEV     EVSide = 'R' // Compute right eigenvectors only.
176         LeftEV      EVSide = 'L' // Compute left eigenvectors only.
177         RightLeftEV EVSide = 'B' // Compute both right and left eigenvectors.
178 )
179
180 // HowMany specifies which eigenvectors will be computed.
181 type HowMany byte
182
183 // HowMany constants for Dhseqr.
184 const (
185         AllEV      HowMany = 'A' // Compute all right and/or left eigenvectors.
186         AllEVMulQ  HowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix.
187         SelectedEV HowMany = 'S' // Compute selected right and/or left eigenvectors.
188 )