forked from carvalho/numlua
-
Notifications
You must be signed in to change notification settings - Fork 4
/
lapack.h
395 lines (316 loc) · 16.7 KB
/
lapack.h
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 */
double dlamch_(char *cmach, int lmach);
/* 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
* */
double dlange_(char *norm, int *m, int *n, double *a,
int *lda, double *work, int lnorm);
double zlange_(char *norm, int *m, int *n, double complex *a,
int *lda, double *work, int lnorm);
/* xLASET - initialize an m-by-n matrix A to BETA on the diagonal and
* ALPHA on the offdiagonals */
int dlaset_(char *uplo, int *m, int *n, double *alpha,
double *beta, double *a, int *lda, int luplo);
int zlaset_(char *uplo, int *m, int *n, double complex *alpha,
double complex *beta, double complex *a, int *lda, int luplo);
/* =========================== 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 */
int dgebak_(char *job, char *side, int *n, int *ilo,
int *ihi, double *scale, int *m, double *v,
int *ldv, int *info, int ljob, int lside);
int zgebak_(char *job, char *side, int *n, int *ilo,
int *ihi, double *scale, int *m, double complex *v,
int *ldv, int *info, int ljob, int lside);
/* xGEBAL - balance a general real [complex] matrix A */
int dgebal_(char *job, int *n, double *a, int *lda,
int *ilo, int *ihi, double *scale, int *info,
int ljob);
int zgebal_(char *job, int *n, double complex *a, int *lda,
int *ilo, int *ihi, double *scale, int *info,
int ljob);
/* 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 */
int dgecon_(char *norm, int *n, double *a, int *lda,
double *anorm, double *rcond, double *work,
int *iwork, int *info, int lnorm);
int zgecon_(char *norm, int *n, double complex *a, int *lda,
double *anorm, double *rcond, double complex *work,
double *rwork, int *info, int lnorm);
/* xGEEV - compute for an N-by-N real [complex] nonsymmetric matrix A, the
* eigenvalues and, optionally, the left and/or right eigenvectors */
int dgeev_(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, int ljobvl, int ljobvr);
int zgeev_(char *jobvl, char *jobvr, int *n, double complex *a,
int *lda, double complex *w, double complex *vl, int *ldvl,
double complex *vr, int *ldvr, double complex *work,
int *lwork, double *rwork, int *info, int ljobvl,
int ljobvr);
/* xGEHRD - reduce a real [complex] general matrix A to upper Hessenberg form
* H by an orthogonal similarity transformation */
int dgehrd_(int *n, int *ilo, int *ihi, double *a,
int *lda, double *tau, double *work,
int *lwork, int *info);
int zgehrd_(int *n, int *ilo, int *ihi, double complex *a,
int *lda, double complex *tau, double complex *work,
int *lwork, int *info);
/* xGELQF - compute an LQ factorization of a real [complex] M-by-N matrix A */
int dgelqf_(int *m, int *n, double *a, int *lda,
double *tau, double *work, int *lwork, int *info);
int zgelqf_(int *m, int *n, double complex *a, int *lda,
double complex *tau, double complex *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 */
int dgels_(char *trans, int *m, int *n, int *nrhs,
double *a, int *lda, double *b, int *ldb,
double *work, int *lwork, int *info, int ltrans);
int zgels_(char *trans, int *m, int *n, int *nrhs,
double complex *a, int *lda, double complex *b, int *ldb,
double complex *work, int *lwork, int *info, int ltrans);
/* xGELSD - compute the minimum-norm solution to a real [complex] linear
* least squares problem */
int dgelsd_(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);
int zgelsd_(int *m, int *n, int *nrhs, double complex *a,
int *lda, double complex *b, int *ldb, double *s,
double *rcond, int *rank, double complex *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 */
int dgelsy_(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);
int zgelsy_(int *m, int *n, int *nrhs, double complex *a,
int *lda, double complex *b, int *ldb, int *jpvt,
double *rcond, int *rank, double complex *work, int *lwork,
double *rwork, int *info);
/* xGELSS - compute the minimum norm solution to a real [complex] linear
* least squares problem using SVD decomposition */
int dgelss_(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);
int zgelss_(int *m, int *n, int *nrhs, double complex *a,
int *lda, double complex *b, int *ldb, double *s,
double *rcond, int *rank, double complex *work, int *lwork,
double *rwork, int *info);
/* xGEQP3 - compute a QR factorization with column pivoting of a matrix A */
int dgeqp3_(int *m, int *n, double *a, int *lda,
int *jpvt, double *tau, double *work, int *lwork,
int *info);
int zgeqp3_(int *m, int *n, double complex *a, int *lda,
int *jpvt, double complex *tau, double complex *work,
int *lwork, double *rwork, int *info);
/* xGEQRF - compute a QR factorization of a real [complex] M-by-N matrix A */
int dgeqrf_(int *m, int *n, double *a, int *lda,
double *tau, double *work, int *lwork, int *info);
int zgeqrf_(int *m, int *n, double complex *a, int *lda,
double complex *tau, double complex *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 */
int dgesv_(int *n, int *nrhs, double *a, int *lda,
int *ipiv, double *b, int *ldb, int *info);
int zgesv_(int *n, int *nrhs, double complex *a, int *lda,
int *ipiv, double complex *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 */
int dgesvd_(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, int ljobu, int ljobvt);
int zgesvd_(char *jobu, char *jobvt, int *m, int *n,
double complex *a, int *lda, double *s, double complex *u,
int *ldu, double complex *vt, int *ldvt, double complex *work,
int *lwork, double *rwork, int *info, int ljobu,
int ljobvt);
/* xGETRF - compute an LU factorization of a general M-by-N matrix A using
* partial pivoting with row interchanges */
int dgetrf_(int *m, int *n, double *a, int *lda,
int *ipiv, int *info);
int zgetrf_(int *m, int *n, double complex *a, int *lda,
int *ipiv, int *info);
/* xGETRI - compute the inverse of a matrix using the LU factorization
* computed by xGETRF */
int dgetri_(int *n, double *a, int *lda, int *ipiv,
double *work, int *lwork, int *info);
int zgetri_(int *n, double complex *a, int *lda, int *ipiv,
double complex *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 */
int dgetrs_(char *trans, int *n, int *nrhs, double *a,
int *lda, int *ipiv, double *b, int *ldb,
int *info, int ltrans);
int zgetrs_(char *trans, int *n, int *nrhs, double complex *a,
int *lda, int *ipiv, double complex *b, int *ldb,
int *info, int ltrans);
/* 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
* */
int dorghr_(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 */
int dorglq_(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 */
int dorgqr_(int *m, int *n, int *k, double *a,
int *lda, double *tau, double *work, int *lwork,
int *info);
int zungqr_(int *m, int *n, int *k, double complex *a,
int *lda, double complex *tau, double complex *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 */
int dormhr_(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, int lside, int ltrans);
/* 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 */
int dormlq_(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, int lside, int ltrans);
/* 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 */
int dormqr_(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, int lside, int ltrans);
int zunmqr_(char *side, char *trans, int *m, int *n,
int *k, double complex *a, int *lda, double complex *tau,
double complex *c, int *ldc, double complex *work, int *lwork,
int *info, int lside, int ltrans);
/* =========================== 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 */
int dpocon_(char *uplo, int *n, double *a, int *lda,
double *anorm, double *rcond, double *work,
int *iwork, int *info, int luplo);
int zpocon_(char *uplo, int *n, double complex *a, int *lda,
double *anorm, double *rcond, double complex *work,
double *rwork, int *info, int luplo);
/* xPOTRF - compute the Cholesky factorization of a real [complex] symmetric
* [Hermitian] positive definite matrix A */
int dpotrf_(char *uplo, int *n, double *a, int *lda,
int *info, int luplo);
int zpotrf_(char *uplo, int *n, double complex *a, int *lda,
int *info, int luplo);
/* 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 */
int dpotri_(char *uplo, int *n, double *a, int *lda,
int *info, int luplo);
int zpotri_(char *uplo, int *n, double complex *a, int *lda,
int *info, int luplo);
/* 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 */
int dpotrs_(char *uplo, int *n, int *nrhs, double *a,
int *lda, double *b, int *ldb, int *info, int luplo);
int zpotrs_(char *uplo, int *n, int *nrhs, double complex *a,
int *lda, double complex *b, int *ldb, int *info, int luplo);
/* =========================== 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 */
int dsycon_(char *uplo, int *n, double *a, int *lda,
int *ipiv, double *anorm, double *rcond, double *work,
int *iwork, int *info, int luplo);
int zhecon_(char *uplo, int *n, double complex *a, int *lda,
int *ipiv, double *anorm, double *rcond,
double complex *work, int *info, int luplo);
/* xSY[HE]EV - compute all eigenvalues and, optionally, eigenvectors of a real
* symmetric [SY] or complex Hermitian [HE] matrix A */
int dsyev_(char *jobz, char *uplo, int *n, double *a,
int *lda, double *w, double *work, int *lwork,
int *info, int ljobz, int luplo);
int zheev_(char *jobz, char *uplo, int *n, double complex *a,
int *lda, double *w, double complex *work, int *lwork,
double *rwork, int *info, int ljobz, int luplo);
/* 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 */
int dsysv_(char *uplo, int *n, int *nrhs, double *a,
int *lda, int *ipiv, double *b, int *ldb,
double *work, int *lwork, int *info, int luplo);
int zhesv_(char *uplo, int *n, int *nrhs, double complex *a,
int *lda, int *ipiv, double complex *b, int *ldb,
double complex *work, int *lwork, int *info, int luplo);
/* xSY[HE]TRF - compute the factorization of a real symmetric [SY] or complex
* Hermitian [HE] matrix A using the Bunch-Kaufman diagonal pivoting method */
int dsytrf_(char *uplo, int *n, double *a, int *lda,
int *ipiv, double *work, int *lwork, int *info,
int luplo);
int zhetrf_(char *uplo, int *n, double complex *a, int *lda,
int *ipiv, double complex *work, int *lwork, int *info,
int luplo);
/* 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 */
int dsytri_(char *uplo, int *n, double *a, int *lda,
int *ipiv, double *work, int *info, int luplo);
int zhetri_(char *uplo, int *n, double complex *a, int *lda,
int *ipiv, double complex *work, int *info, int luplo);
/* 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 */
int dsytrs_(char *uplo, int *n, int *nrhs, double *a,
int *lda, int *ipiv, double *b, int *ldb,
int *info, int luplo);
int zhetrs_(char *uplo, int *n, int *nrhs, double complex *a,
int *lda, int *ipiv, double complex *b, int *ldb,
int *info, int luplo);
/* =========================== Triangular ============================= */
/* xTRCON - estimate the reciprocal of the condition number of a triangular
* matrix A, in either the 1-norm or the infinity-norm */
int dtrcon_(char *norm, char *uplo, char *diag, int *n,
double *a, int *lda, double *rcond, double *work,
int *iwork, int *info, int lnorm, int luplo,
int ldiag);
int ztrcon_(char *norm, char *uplo, char *diag, int *n,
double complex *a, int *lda, double *rcond,
double complex *work, double *rwork, int *info, int lnorm,
int luplo, int ldiag);
/* xTRTRI - compute the inverse of a real [complex] upper or lower triangular
* matrix A */
int dtrtri_(char *uplo, char *diag, int *n, double *a,
int *lda, int *info, int luplo, int ldiag);
int ztrtri_(char *uplo, char *diag, int *n, double complex *a,
int *lda, int *info, int luplo, int ldiag);
/* 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 */
int dtrtrs_(char *uplo, char *trans, char *diag, int *n,
int *nrhs, double *a, int *lda, double *b,
int *ldb, int *info, int luplo, int ltrans,
int ldiag);
int ztrtrs_(char *uplo, char *trans, char *diag, int *n,
int *nrhs, double complex *a, int *lda, double complex *b,
int *ldb, int *info, int luplo, int ltrans,
int ldiag);