Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Nov 20, 2020. It is now read-only.
forked from carvalho/numlua
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlapack.h
More file actions
Latest commit
395 lines (316 loc) · 16.7 KB
/
Copy pathlapack.h
File metadata and controls
395 lines (316 loc) · 16.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
/* =========================== Internals ============================= */
/* DLAMCH - determine double precision machine parameters */
doubledlamch_(char*cmach, intlmach);
/* xLANGE - return the value of the one norm, or the Frobenius norm, or the
* infinity norm, or the element of largest absolute value of a real matrix A
* */
doubledlange_(char*norm, int*m, int*n, double*a,
int*lda, double*work, intlnorm);
doublezlange_(char*norm, int*m, int*n, doublecomplex*a,
int*lda, double*work, intlnorm);
/* xLASET - initialize an m-by-n matrix A to BETA on the diagonal and
* ALPHA on the offdiagonals */
intdlaset_(char*uplo, int*m, int*n, double*alpha,
double*beta, double*a, int*lda, intluplo);
intzlaset_(char*uplo, int*m, int*n, doublecomplex*alpha,
doublecomplex*beta, doublecomplex*a, int*lda, intluplo);
/* =========================== General ============================= */
/* xGEBAK - form the right or left eigenvectors of a real [complex] general
* matrix by backward transformation on the computed eigenvectors of the
* balanced matrix output by xGEBAL */
intdgebak_(char*job, char*side, int*n, int*ilo,
int*ihi, double*scale, int*m, double*v,
int*ldv, int*info, intljob, intlside);
intzgebak_(char*job, char*side, int*n, int*ilo,
int*ihi, double*scale, int*m, doublecomplex*v,
int*ldv, int*info, intljob, intlside);
/* xGEBAL - balance a general real [complex] matrix A */
intdgebal_(char*job, int*n, double*a, int*lda,
int*ilo, int*ihi, double*scale, int*info,
intljob);
intzgebal_(char*job, int*n, doublecomplex*a, int*lda,
int*ilo, int*ihi, double*scale, int*info,
intljob);
/* xGECON - estimate the reciprocal of the condition number of a general real
* [complex] matrix A, in either the 1-norm or the infinity-norm, using the LU
* factorization computed by xGETRF */
intdgecon_(char*norm, int*n, double*a, int*lda,
double*anorm, double*rcond, double*work,
int*iwork, int*info, intlnorm);
intzgecon_(char*norm, int*n, doublecomplex*a, int*lda,
double*anorm, double*rcond, doublecomplex*work,
double*rwork, int*info, intlnorm);
/* xGEEV - compute for an N-by-N real [complex] nonsymmetric matrix A, the
* eigenvalues and, optionally, the left and/or right eigenvectors */
intdgeev_(char*jobvl, char*jobvr, int*n, double*a,
int*lda, double*wr, double*wi, double*vl,
int*ldvl, double*vr, int*ldvr, double*work,
int*lwork, int*info, intljobvl, intljobvr);
intzgeev_(char*jobvl, char*jobvr, int*n, doublecomplex*a,
int*lda, doublecomplex*w, doublecomplex*vl, int*ldvl,
doublecomplex*vr, int*ldvr, doublecomplex*work,
int*lwork, double*rwork, int*info, intljobvl,
intljobvr);
/* xGEHRD - reduce a real [complex] general matrix A to upper Hessenberg form
* H by an orthogonal similarity transformation */
intdgehrd_(int*n, int*ilo, int*ihi, double*a,
int*lda, double*tau, double*work,
int*lwork, int*info);
intzgehrd_(int*n, int*ilo, int*ihi, doublecomplex*a,
int*lda, doublecomplex*tau, doublecomplex*work,
int*lwork, int*info);
/* xGELQF - compute an LQ factorization of a real [complex] M-by-N matrix A */
intdgelqf_(int*m, int*n, double*a, int*lda,
double*tau, double*work, int*lwork, int*info);
intzgelqf_(int*m, int*n, doublecomplex*a, int*lda,
doublecomplex*tau, doublecomplex*work, int*lwork,
int*info);
/* xGELS - solve overdetermined or underdetermined real [complex] linear
* systems involving an M-by-N matrix A, or its transpose, using a QR or LQ
* factorization of A */
intdgels_(char*trans, int*m, int*n, int*nrhs,
double*a, int*lda, double*b, int*ldb,
double*work, int*lwork, int*info, intltrans);
intzgels_(char*trans, int*m, int*n, int*nrhs,
doublecomplex*a, int*lda, doublecomplex*b, int*ldb,
doublecomplex*work, int*lwork, int*info, intltrans);
/* xGELSD - compute the minimum-norm solution to a real [complex] linear
* least squares problem */
intdgelsd_(int*m, int*n, int*nrhs, double*a,
int*lda, double*b, int*ldb, double*s,
double*rcond, int*rank, double*work, int*lwork,
int*iwork, int*info);
intzgelsd_(int*m, int*n, int*nrhs, doublecomplex*a,
int*lda, doublecomplex*b, int*ldb, double*s,
double*rcond, int*rank, doublecomplex*work, int*lwork,
double*rwork, int*iwork, int*info);
/* xGELSY - compute the minimum-norm solution to a real [complex] linear
* least squares problem using complete orthogonal decomposition */
intdgelsy_(int*m, int*n, int*nrhs, double*a,
int*lda, double*b, int*ldb, int*jpvt,
double*rcond, int*rank, double*work, int*lwork,
int*info);
intzgelsy_(int*m, int*n, int*nrhs, doublecomplex*a,
int*lda, doublecomplex*b, int*ldb, int*jpvt,
double*rcond, int*rank, doublecomplex*work, int*lwork,
double*rwork, int*info);
/* xGELSS - compute the minimum norm solution to a real [complex] linear
* least squares problem using SVD decomposition */
intdgelss_(int*m, int*n, int*nrhs, double*a,
int*lda, double*b, int*ldb, double*s,
double*rcond, int*rank, double*work, int*lwork,
int*info);
intzgelss_(int*m, int*n, int*nrhs, doublecomplex*a,
int*lda, doublecomplex*b, int*ldb, double*s,
double*rcond, int*rank, doublecomplex*work, int*lwork,
double*rwork, int*info);
/* xGEQP3 - compute a QR factorization with column pivoting of a matrix A */
intdgeqp3_(int*m, int*n, double*a, int*lda,
int*jpvt, double*tau, double*work, int*lwork,
int*info);
intzgeqp3_(int*m, int*n, doublecomplex*a, int*lda,
int*jpvt, doublecomplex*tau, doublecomplex*work,
int*lwork, double*rwork, int*info);
/* xGEQRF - compute a QR factorization of a real [complex] M-by-N matrix A */
intdgeqrf_(int*m, int*n, double*a, int*lda,
double*tau, double*work, int*lwork, int*info);
intzgeqrf_(int*m, int*n, doublecomplex*a, int*lda,
doublecomplex*tau, doublecomplex*work, int*lwork,
int*info);
/* xGESV - compute the solution to a real [complex] system of linear equations
* A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices */
intdgesv_(int*n, int*nrhs, double*a, int*lda,
int*ipiv, double*b, int*ldb, int*info);
intzgesv_(int*n, int*nrhs, doublecomplex*a, int*lda,
int*ipiv, doublecomplex*b, int*ldb, int*info);
/* xGESVD - compute the singular value decomposition (SVD) of a real [complex]
* M-by-N matrix A, optionally computing the left and/or right singular
* vectors */
intdgesvd_(char*jobu, char*jobvt, int*m, int*n,
double*a, int*lda, double*s, double*u,
int*ldu, double*vt, int*ldvt, double*work,
int*lwork, int*info, intljobu, intljobvt);
intzgesvd_(char*jobu, char*jobvt, int*m, int*n,
doublecomplex*a, int*lda, double*s, doublecomplex*u,
int*ldu, doublecomplex*vt, int*ldvt, doublecomplex*work,
int*lwork, double*rwork, int*info, intljobu,
intljobvt);
/* xGETRF - compute an LU factorization of a general M-by-N matrix A using
* partial pivoting with row interchanges */
intdgetrf_(int*m, int*n, double*a, int*lda,
int*ipiv, int*info);
intzgetrf_(int*m, int*n, doublecomplex*a, int*lda,
int*ipiv, int*info);
/* xGETRI - compute the inverse of a matrix using the LU factorization
* computed by xGETRF */
intdgetri_(int*n, double*a, int*lda, int*ipiv,
double*work, int*lwork, int*info);
intzgetri_(int*n, doublecomplex*a, int*lda, int*ipiv,
doublecomplex*work, int*lwork, int*info);
/* xGETRS - solve a system of linear equations A * X = B or A' * X = B with a
* general N-by-N matrix A using the LU factorization computed by xGETRF */
intdgetrs_(char*trans, int*n, int*nrhs, double*a,
int*lda, int*ipiv, double*b, int*ldb,
int*info, intltrans);
intzgetrs_(char*trans, int*n, int*nrhs, doublecomplex*a,
int*lda, int*ipiv, doublecomplex*b, int*ldb,
int*info, intltrans);
/* DORGHR - generate a real orthogonal matrix Q which is defined as the
* product of IHI-ILO elementary reflectors of order N, as returned by DGEHRD
* */
intdorghr_(int*n, int*ilo, int*ihi, double*a,
int*lda, double*tau, double*work, int*lwork,
int*info);
/* DORGLQ - generate an M-by-N real matrix Q with orthonormal rows, which is
* defined as the first M rows of a product of K elementary reflectors of
* order N as returned by DGELQF */
intdorglq_(int*m, int*n, int*k, double*a,
int*lda, double*tau, double*work, int*lwork,
int*info);
/* xOR[UN]GQR - generate an M-by-N real [complex] matrix Q with orthonormal
* columns, which is defined as the first N columns of a product of K
* elementary reflectors of order M as returned by xGEQRF */
intdorgqr_(int*m, int*n, int*k, double*a,
int*lda, double*tau, double*work, int*lwork,
int*info);
intzungqr_(int*m, int*n, int*k, doublecomplex*a,
int*lda, doublecomplex*tau, doublecomplex*work, int*lwork,
int*info);
/* DORMHR - overwrite the general real M-by-N matrix C with SIDE = 'L' SIDE =
* 'R' TRANS = 'N': Q * C C * Q TRANS = 'T': Q**T * C C * Q**T where Q is a
* real orthogonal matrix of order nq, with nq = m if SIDE = 'L' and nq = n if
* SIDE = 'R'. Q is defined as the product of IHI-ILO elementary reflectors,
* as returned by DGEHRD */
intdormhr_(char*side, char*trans, int*m, int*n,
int*ilo, int*ihi, double*a, int*lda, double*
tau, double*c, int*ldc, double*work, int*lwork,
int*info, intlside, intltrans);
/* DORMLQ - overwrite the general real M-by-N matrix C with SIDE = 'L' SIDE =
* 'R' TRANS = 'N': Q * C C * Q TRANS = 'T': Q**T * C C * Q**T where Q is a
* real orthogonal matrix defined as the product of k elementary reflectors,
* as returned by DGELQF */
intdormlq_(char*side, char*trans, int*m, int*n,
int*k, double*a, int*lda, double*tau,
double*c, int*ldc, double*work, int*lwork,
int*info, intlside, intltrans);
/* xOR[UN]MQR - overwrite the general real M-by-N matrix C with SIDE = 'L' SIDE =
* 'R' TRANS = 'N': Q * C C * Q TRANS = 'T': Q**T * C C * Q**T where Q is a
* real orthogonal matrix defined as the product of k elementary reflectors,
* as returned by xGEQRF */
intdormqr_(char*side, char*trans, int*m, int*n,
int*k, double*a, int*lda, double*tau,
double*c, int*ldc, double*work, int*lwork,
int*info, intlside, intltrans);
intzunmqr_(char*side, char*trans, int*m, int*n,
int*k, doublecomplex*a, int*lda, doublecomplex*tau,
doublecomplex*c, int*ldc, doublecomplex*work, int*lwork,
int*info, intlside, intltrans);
/* =========================== Posdef Symm ============================= */
/* xPOCON - estimate the reciprocal of the condition number (in the 1-norm) of
* a real [complex] symmetric [Hermitian] positive definite matrix using the
* Cholesky factorization A = U**H*U or A = L*L**H computed by xPOTRF */
intdpocon_(char*uplo, int*n, double*a, int*lda,
double*anorm, double*rcond, double*work,
int*iwork, int*info, intluplo);
intzpocon_(char*uplo, int*n, doublecomplex*a, int*lda,
double*anorm, double*rcond, doublecomplex*work,
double*rwork, int*info, intluplo);
/* xPOTRF - compute the Cholesky factorization of a real [complex] symmetric
* [Hermitian] positive definite matrix A */
intdpotrf_(char*uplo, int*n, double*a, int*lda,
int*info, intluplo);
intzpotrf_(char*uplo, int*n, doublecomplex*a, int*lda,
int*info, intluplo);
/* xPOTRI - compute the inverse of a real [complex] symmetric [Hermitian]
* positive definite matrix A using the Cholesky factorization A = U**H*U or
* A = L*L**H computed by xPOTRF */
intdpotri_(char*uplo, int*n, double*a, int*lda,
int*info, intluplo);
intzpotri_(char*uplo, int*n, doublecomplex*a, int*lda,
int*info, intluplo);
/* xPOTRS - solve a system of linear equations A*X = B with a symmetric
* [Hermitian] positive definite matrix A using the Cholesky factorization
* A = U**H*U or A = L*L**H computed by xPOTRF */
intdpotrs_(char*uplo, int*n, int*nrhs, double*a,
int*lda, double*b, int*ldb, int*info, intluplo);
intzpotrs_(char*uplo, int*n, int*nrhs, doublecomplex*a,
int*lda, doublecomplex*b, int*ldb, int*info, intluplo);
/* =========================== Symmetric ============================= */
/* xSY[HE]CON - estimate the reciprocal of the condition number (in the 1-norm)
* of a real symmetric [SY] or complex Hermitian [HE] matrix A using the
* factorization A = U*D*U**H or A = L*D*L**H computed by xSY[HE]TRF */
intdsycon_(char*uplo, int*n, double*a, int*lda,
int*ipiv, double*anorm, double*rcond, double*work,
int*iwork, int*info, intluplo);
intzhecon_(char*uplo, int*n, doublecomplex*a, int*lda,
int*ipiv, double*anorm, double*rcond,
doublecomplex*work, int*info, intluplo);
/* xSY[HE]EV - compute all eigenvalues and, optionally, eigenvectors of a real
* symmetric [SY] or complex Hermitian [HE] matrix A */
intdsyev_(char*jobz, char*uplo, int*n, double*a,
int*lda, double*w, double*work, int*lwork,
int*info, intljobz, intluplo);
intzheev_(char*jobz, char*uplo, int*n, doublecomplex*a,
int*lda, double*w, doublecomplex*work, int*lwork,
double*rwork, int*info, intljobz, intluplo);
/* xSY[HE]SV - compute the solution to a real [complex] system of linear
* equations A * X = B, where A is an N-by-N symmetric [Hermitian] matrix and
* X and B are N-by-NRHS matrices */
intdsysv_(char*uplo, int*n, int*nrhs, double*a,
int*lda, int*ipiv, double*b, int*ldb,
double*work, int*lwork, int*info, intluplo);
intzhesv_(char*uplo, int*n, int*nrhs, doublecomplex*a,
int*lda, int*ipiv, doublecomplex*b, int*ldb,
doublecomplex*work, int*lwork, int*info, intluplo);
/* xSY[HE]TRF - compute the factorization of a real symmetric [SY] or complex
* Hermitian [HE] matrix A using the Bunch-Kaufman diagonal pivoting method */
intdsytrf_(char*uplo, int*n, double*a, int*lda,
int*ipiv, double*work, int*lwork, int*info,
intluplo);
intzhetrf_(char*uplo, int*n, doublecomplex*a, int*lda,
int*ipiv, doublecomplex*work, int*lwork, int*info,
intluplo);
/* xSY[HE]TRI - compute the inverse of a real symmetric [SY] or complex
* Hermitian [HE] indefinite matrix A using the factorization A = U*D*U**H
* or A = L*D*L**H computed by xSY[HE]TRF */
intdsytri_(char*uplo, int*n, double*a, int*lda,
int*ipiv, double*work, int*info, intluplo);
intzhetri_(char*uplo, int*n, doublecomplex*a, int*lda,
int*ipiv, doublecomplex*work, int*info, intluplo);
/* xSY[HE]TRS - solve a system of linear equations A*X = B with a real
* symmetric [SY] or complex Hermitian [HE] matrix A using the factorization
* A = U*D*U**H or A = L*D*L**H computed by xSY[HE]TRF */
intdsytrs_(char*uplo, int*n, int*nrhs, double*a,
int*lda, int*ipiv, double*b, int*ldb,
int*info, intluplo);
intzhetrs_(char*uplo, int*n, int*nrhs, doublecomplex*a,
int*lda, int*ipiv, doublecomplex*b, int*ldb,
int*info, intluplo);
/* =========================== Triangular ============================= */
/* xTRCON - estimate the reciprocal of the condition number of a triangular
* matrix A, in either the 1-norm or the infinity-norm */
intdtrcon_(char*norm, char*uplo, char*diag, int*n,
double*a, int*lda, double*rcond, double*work,
int*iwork, int*info, intlnorm, intluplo,
intldiag);
intztrcon_(char*norm, char*uplo, char*diag, int*n,
doublecomplex*a, int*lda, double*rcond,
doublecomplex*work, double*rwork, int*info, intlnorm,
intluplo, intldiag);
/* xTRTRI - compute the inverse of a real [complex] upper or lower triangular
* matrix A */
intdtrtri_(char*uplo, char*diag, int*n, double*a,
int*lda, int*info, intluplo, intldiag);
intztrtri_(char*uplo, char*diag, int*n, doublecomplex*a,
int*lda, int*info, intluplo, intldiag);
/* xTRTRS - solve a triangular system of the form A * X = B or A**H * X = B,
* where A is a triangular matrix of order N, and B is an N-by-NRHS matrix. A
* check is made to verify that A is nonsingular */
intdtrtrs_(char*uplo, char*trans, char*diag, int*n,
int*nrhs, double*a, int*lda, double*b,
int*ldb, int*info, intluplo, intltrans,
intldiag);
intztrtrs_(char*uplo, char*trans, char*diag, int*n,
int*nrhs, doublecomplex*a, int*lda, doublecomplex*b,
int*ldb, int*info, intluplo, intltrans,
intldiag);