ergo
template_lapack_ggev.h
Go to the documentation of this file.
1/* Ergo, version 3.8, a program for linear scaling electronic structure
2 * calculations.
3 * Copyright (C) 2019 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4 * and Anastasia Kruchinina.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Primary academic reference:
20 * Ergo: An open-source program for linear-scaling electronic structure
21 * calculations,
22 * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23 * Kruchinina,
24 * SoftwareX 7, 107 (2018),
25 * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26 *
27 * For further information about Ergo, see <http://www.ergoscf.org>.
28 */
29
30 /* This file belongs to the template_lapack part of the Ergo source
31 * code. The source files in the template_lapack directory are modified
32 * versions of files originally distributed as CLAPACK, see the
33 * Copyright/license notice in the file template_lapack/COPYING.
34 */
35
36
37#ifndef TEMPLATE_LAPACK_GGEV_HEADER
38#define TEMPLATE_LAPACK_GGEV_HEADER
39
40
41template<class Treal>
42int template_lapack_ggev(const char *jobvl, const char *jobvr, const integer *n, Treal *
43 a, const integer *lda, Treal *b, const integer *ldb, Treal *alphar,
44 Treal *alphai, Treal *beta, Treal *vl, const integer *ldvl,
45 Treal *vr, const integer *ldvr, Treal *work, const integer *lwork,
46 integer *info)
47{
48/* -- LAPACK driver routine (version 3.0) --
49 Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
50 Courant Institute, Argonne National Lab, and Rice University
51 June 30, 1999
52
53
54 Purpose
55 =======
56
57 DGGEV computes for a pair of N-by-N real nonsymmetric matrices (A,B)
58 the generalized eigenvalues, and optionally, the left and/or right
59 generalized eigenvectors.
60
61 A generalized eigenvalue for a pair of matrices (A,B) is a scalar
62 lambda or a ratio alpha/beta = lambda, such that A - lambda*B is
63 singular. It is usually represented as the pair (alpha,beta), as
64 there is a reasonable interpretation for beta=0, and even for both
65 being zero.
66
67 The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
68 of (A,B) satisfies
69
70 A * v(j) = lambda(j) * B * v(j).
71
72 The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
73 of (A,B) satisfies
74
75 u(j)**H * A = lambda(j) * u(j)**H * B .
76
77 where u(j)**H is the conjugate-transpose of u(j).
78
79
80 Arguments
81 =========
82
83 JOBVL (input) CHARACTER*1
84 = 'N': do not compute the left generalized eigenvectors;
85 = 'V': compute the left generalized eigenvectors.
86
87 JOBVR (input) CHARACTER*1
88 = 'N': do not compute the right generalized eigenvectors;
89 = 'V': compute the right generalized eigenvectors.
90
91 N (input) INTEGER
92 The order of the matrices A, B, VL, and VR. N >= 0.
93
94 A (input/output) DOUBLE PRECISION array, dimension (LDA, N)
95 On entry, the matrix A in the pair (A,B).
96 On exit, A has been overwritten.
97
98 LDA (input) INTEGER
99 The leading dimension of A. LDA >= max(1,N).
100
101 B (input/output) DOUBLE PRECISION array, dimension (LDB, N)
102 On entry, the matrix B in the pair (A,B).
103 On exit, B has been overwritten.
104
105 LDB (input) INTEGER
106 The leading dimension of B. LDB >= max(1,N).
107
108 ALPHAR (output) DOUBLE PRECISION array, dimension (N)
109 ALPHAI (output) DOUBLE PRECISION array, dimension (N)
110 BETA (output) DOUBLE PRECISION array, dimension (N)
111 On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
112 be the generalized eigenvalues. If ALPHAI(j) is zero, then
113 the j-th eigenvalue is real; if positive, then the j-th and
114 (j+1)-st eigenvalues are a complex conjugate pair, with
115 ALPHAI(j+1) negative.
116
117 Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
118 may easily over- or underflow, and BETA(j) may even be zero.
119 Thus, the user should avoid naively computing the ratio
120 alpha/beta. However, ALPHAR and ALPHAI will be always less
121 than and usually comparable with norm(A) in magnitude, and
122 BETA always less than and usually comparable with norm(B).
123
124 VL (output) DOUBLE PRECISION array, dimension (LDVL,N)
125 If JOBVL = 'V', the left eigenvectors u(j) are stored one
126 after another in the columns of VL, in the same order as
127 their eigenvalues. If the j-th eigenvalue is real, then
128 u(j) = VL(:,j), the j-th column of VL. If the j-th and
129 (j+1)-th eigenvalues form a complex conjugate pair, then
130 u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)-i*VL(:,j+1).
131 Each eigenvector will be scaled so the largest component have
132 abs(real part)+abs(imag. part)=1.
133 Not referenced if JOBVL = 'N'.
134
135 LDVL (input) INTEGER
136 The leading dimension of the matrix VL. LDVL >= 1, and
137 if JOBVL = 'V', LDVL >= N.
138
139 VR (output) DOUBLE PRECISION array, dimension (LDVR,N)
140 If JOBVR = 'V', the right eigenvectors v(j) are stored one
141 after another in the columns of VR, in the same order as
142 their eigenvalues. If the j-th eigenvalue is real, then
143 v(j) = VR(:,j), the j-th column of VR. If the j-th and
144 (j+1)-th eigenvalues form a complex conjugate pair, then
145 v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)-i*VR(:,j+1).
146 Each eigenvector will be scaled so the largest component have
147 abs(real part)+abs(imag. part)=1.
148 Not referenced if JOBVR = 'N'.
149
150 LDVR (input) INTEGER
151 The leading dimension of the matrix VR. LDVR >= 1, and
152 if JOBVR = 'V', LDVR >= N.
153
154 WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK)
155 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
156
157 LWORK (input) INTEGER
158 The dimension of the array WORK. LWORK >= max(1,8*N).
159 For good performance, LWORK must generally be larger.
160
161 If LWORK = -1, then a workspace query is assumed; the routine
162 only calculates the optimal size of the WORK array, returns
163 this value as the first entry of the WORK array, and no error
164 message related to LWORK is issued by XERBLA.
165
166 INFO (output) INTEGER
167 = 0: successful exit
168 < 0: if INFO = -i, the i-th argument had an illegal value.
169 = 1,...,N:
170 The QZ iteration failed. No eigenvectors have been
171 calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
172 should be correct for j=INFO+1,...,N.
173 > N: =N+1: other than QZ iteration failed in DHGEQZ.
174 =N+2: error return from DTGEVC.
175
176 =====================================================================
177
178
179 Decode the input arguments
180
181 Parameter adjustments */
182 /* Table of constant values */
183 integer c__1 = 1;
184 integer c__0 = 0;
185 Treal c_b26 = 0.;
186 Treal c_b27 = 1.;
187
188 /* System generated locals */
189 integer a_dim1, a_offset, b_dim1, b_offset, vl_dim1, vl_offset, vr_dim1,
190 vr_offset, i__1, i__2;
191 Treal d__1, d__2, d__3, d__4;
192 /* Local variables */
193 Treal anrm, bnrm;
194 integer ierr, itau;
195 Treal temp;
196 logical ilvl, ilvr;
197 integer iwrk;
198 integer ileft, icols, irows;
199 integer jc;
200 integer in;
201 integer jr;
202 logical ilascl, ilbscl;
203 logical ldumma[1];
204 char chtemp[1];
205 Treal bignum;
206 integer ijobvl, iright, ijobvr;
207 Treal anrmto, bnrmto;
208 integer minwrk, maxwrk;
209 Treal smlnum;
210 logical lquery;
211 integer ihi, ilo;
212 Treal eps;
213 logical ilv;
214#define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1]
215#define b_ref(a_1,a_2) b[(a_2)*b_dim1 + a_1]
216#define vl_ref(a_1,a_2) vl[(a_2)*vl_dim1 + a_1]
217#define vr_ref(a_1,a_2) vr[(a_2)*vr_dim1 + a_1]
218
219
220 a_dim1 = *lda;
221 a_offset = 1 + a_dim1 * 1;
222 a -= a_offset;
223 b_dim1 = *ldb;
224 b_offset = 1 + b_dim1 * 1;
225 b -= b_offset;
226 --alphar;
227 --alphai;
228 --beta;
229 vl_dim1 = *ldvl;
230 vl_offset = 1 + vl_dim1 * 1;
231 vl -= vl_offset;
232 vr_dim1 = *ldvr;
233 vr_offset = 1 + vr_dim1 * 1;
234 vr -= vr_offset;
235 --work;
236
237 /* Initialization added by Elias to get rid of compiler warnings. */
238 maxwrk = 0;
239 /* Function Body */
240 if (template_blas_lsame(jobvl, "N")) {
241 ijobvl = 1;
242 ilvl = FALSE_;
243 } else if (template_blas_lsame(jobvl, "V")) {
244 ijobvl = 2;
245 ilvl = TRUE_;
246 } else {
247 ijobvl = -1;
248 ilvl = FALSE_;
249 }
250
251 if (template_blas_lsame(jobvr, "N")) {
252 ijobvr = 1;
253 ilvr = FALSE_;
254 } else if (template_blas_lsame(jobvr, "V")) {
255 ijobvr = 2;
256 ilvr = TRUE_;
257 } else {
258 ijobvr = -1;
259 ilvr = FALSE_;
260 }
261 ilv = ilvl || ilvr;
262
263/* Test the input arguments */
264
265 *info = 0;
266 lquery = *lwork == -1;
267 if (ijobvl <= 0) {
268 *info = -1;
269 } else if (ijobvr <= 0) {
270 *info = -2;
271 } else if (*n < 0) {
272 *info = -3;
273 } else if (*lda < maxMACRO(1,*n)) {
274 *info = -5;
275 } else if (*ldb < maxMACRO(1,*n)) {
276 *info = -7;
277 } else if (*ldvl < 1 || ( ilvl && *ldvl < *n ) ) {
278 *info = -12;
279 } else if (*ldvr < 1 || ( ilvr && *ldvr < *n ) ) {
280 *info = -14;
281 }
282
283/* Compute workspace
284 (Note: Comments in the code beginning "Workspace:" describe the
285 minimal amount of workspace needed at that point in the code,
286 as well as the preferred amount for good performance.
287 NB refers to the optimal block size for the immediately
288 following subroutine, as returned by ILAENV. The workspace is
289 computed assuming ILO = 1 and IHI = N, the worst case.) */
290
291 minwrk = 1;
292 if (*info == 0 && (*lwork >= 1 || lquery)) {
293 maxwrk = *n * 7 + *n * template_lapack_ilaenv(&c__1, "DGEQRF", " ", n, &c__1, n, &
294 c__0, (ftnlen)6, (ftnlen)1);
295 /* Computing MAX */
296 i__1 = 1, i__2 = *n << 3;
297 minwrk = maxMACRO(i__1,i__2);
298 work[1] = (Treal) maxwrk;
299 }
300
301 if (*lwork < minwrk && ! lquery) {
302 *info = -16;
303 }
304
305 if (*info != 0) {
306 i__1 = -(*info);
307 template_blas_erbla("GGEV ", &i__1);
308 return 0;
309 } else if (lquery) {
310 return 0;
311 }
312
313/* Quick return if possible */
314
315 if (*n == 0) {
316 return 0;
317 }
318
319/* Get machine constants */
320
321 eps = template_lapack_lamch("P", (Treal)0);
322 smlnum = template_lapack_lamch("S", (Treal)0);
323 bignum = 1. / smlnum;
324 template_lapack_labad(&smlnum, &bignum);
325 smlnum = template_blas_sqrt(smlnum) / eps;
326 bignum = 1. / smlnum;
327
328/* Scale A if max element outside range [SMLNUM,BIGNUM] */
329
330 anrm = template_lapack_lange("M", n, n, &a[a_offset], lda, &work[1]);
331 ilascl = FALSE_;
332 if (anrm > 0. && anrm < smlnum) {
333 anrmto = smlnum;
334 ilascl = TRUE_;
335 } else if (anrm > bignum) {
336 anrmto = bignum;
337 ilascl = TRUE_;
338 }
339 if (ilascl) {
340 template_lapack_lascl("G", &c__0, &c__0, &anrm, &anrmto, n, n, &a[a_offset], lda, &
341 ierr);
342 }
343
344/* Scale B if max element outside range [SMLNUM,BIGNUM] */
345
346 bnrm = template_lapack_lange("M", n, n, &b[b_offset], ldb, &work[1]);
347 ilbscl = FALSE_;
348 if (bnrm > 0. && bnrm < smlnum) {
349 bnrmto = smlnum;
350 ilbscl = TRUE_;
351 } else if (bnrm > bignum) {
352 bnrmto = bignum;
353 ilbscl = TRUE_;
354 }
355 if (ilbscl) {
356 template_lapack_lascl("G", &c__0, &c__0, &bnrm, &bnrmto, n, n, &b[b_offset], ldb, &
357 ierr);
358 }
359
360/* Permute the matrices A, B to isolate eigenvalues if possible
361 (Workspace: need 6*N) */
362
363 ileft = 1;
364 iright = *n + 1;
365 iwrk = iright + *n;
366 template_lapack_ggbal("P", n, &a[a_offset], lda, &b[b_offset], ldb, &ilo, &ihi, &work[
367 ileft], &work[iright], &work[iwrk], &ierr);
368
369/* Reduce B to triangular form (QR decomposition of B)
370 (Workspace: need N, prefer N*NB) */
371
372 irows = ihi + 1 - ilo;
373 if (ilv) {
374 icols = *n + 1 - ilo;
375 } else {
376 icols = irows;
377 }
378 itau = iwrk;
379 iwrk = itau + irows;
380 i__1 = *lwork + 1 - iwrk;
381 template_lapack_geqrf(&irows, &icols, &b_ref(ilo, ilo), ldb, &work[itau], &work[iwrk], &
382 i__1, &ierr);
383
384/* Apply the orthogonal transformation to matrix A
385 (Workspace: need N, prefer N*NB) */
386
387 i__1 = *lwork + 1 - iwrk;
388 /* Local char arrays added by Elias to get rid of compiler warnings. */
389 char str_L[] = {'L', 0};
390 char str_T[] = {'T', 0};
391 template_lapack_ormqr(str_L, str_T, &irows, &icols, &irows, &b_ref(ilo, ilo), ldb, &work[
392 itau], &a_ref(ilo, ilo), lda, &work[iwrk], &i__1, &ierr);
393
394/* Initialize VL
395 (Workspace: need N, prefer N*NB) */
396
397 if (ilvl) {
398 template_lapack_laset("Full", n, n, &c_b26, &c_b27, &vl[vl_offset], ldvl)
399 ;
400 i__1 = irows - 1;
401 i__2 = irows - 1;
402 template_lapack_lacpy("L", &i__1, &i__2, &b_ref(ilo + 1, ilo), ldb, &vl_ref(ilo + 1,
403 ilo), ldvl);
404 i__1 = *lwork + 1 - iwrk;
405 template_lapack_orgqr(&irows, &irows, &irows, &vl_ref(ilo, ilo), ldvl, &work[itau],
406 &work[iwrk], &i__1, &ierr);
407 }
408
409/* Initialize VR */
410
411 if (ilvr) {
412 template_lapack_laset("Full", n, n, &c_b26, &c_b27, &vr[vr_offset], ldvr)
413 ;
414 }
415
416/* Reduce to generalized Hessenberg form
417 (Workspace: none needed) */
418
419 if (ilv) {
420
421/* Eigenvectors requested -- work on whole matrix. */
422
423 template_lapack_gghrd(jobvl, jobvr, n, &ilo, &ihi, &a[a_offset], lda, &b[b_offset],
424 ldb, &vl[vl_offset], ldvl, &vr[vr_offset], ldvr, &ierr);
425 } else {
426 template_lapack_gghrd("N", "N", &irows, &c__1, &irows, &a_ref(ilo, ilo), lda, &
427 b_ref(ilo, ilo), ldb, &vl[vl_offset], ldvl, &vr[vr_offset],
428 ldvr, &ierr);
429 }
430
431/* Perform QZ algorithm (Compute eigenvalues, and optionally, the
432 Schur forms and Schur vectors)
433 (Workspace: need N) */
434
435 iwrk = itau;
436 if (ilv) {
437 *(unsigned char *)chtemp = 'S';
438 } else {
439 *(unsigned char *)chtemp = 'E';
440 }
441 i__1 = *lwork + 1 - iwrk;
442 template_lapack_hgeqz(chtemp, jobvl, jobvr, n, &ilo, &ihi, &a[a_offset], lda, &b[
443 b_offset], ldb, &alphar[1], &alphai[1], &beta[1], &vl[vl_offset],
444 ldvl, &vr[vr_offset], ldvr, &work[iwrk], &i__1, &ierr);
445 if (ierr != 0) {
446 if (ierr > 0 && ierr <= *n) {
447 *info = ierr;
448 } else if (ierr > *n && ierr <= *n << 1) {
449 *info = ierr - *n;
450 } else {
451 *info = *n + 1;
452 }
453 goto L110;
454 }
455
456/* Compute Eigenvectors
457 (Workspace: need 6*N) */
458
459 if (ilv) {
460 if (ilvl) {
461 if (ilvr) {
462 *(unsigned char *)chtemp = 'B';
463 } else {
464 *(unsigned char *)chtemp = 'L';
465 }
466 } else {
467 *(unsigned char *)chtemp = 'R';
468 }
469 template_lapack_tgevc(chtemp, "B", ldumma, n, &a[a_offset], lda, &b[b_offset], ldb,
470 &vl[vl_offset], ldvl, &vr[vr_offset], ldvr, n, &in, &work[
471 iwrk], &ierr);
472 if (ierr != 0) {
473 *info = *n + 2;
474 goto L110;
475 }
476
477/* Undo balancing on VL and VR and normalization
478 (Workspace: none needed) */
479
480 if (ilvl) {
481 template_lapack_ggbak("P", "L", n, &ilo, &ihi, &work[ileft], &work[iright], n, &
482 vl[vl_offset], ldvl, &ierr);
483 i__1 = *n;
484 for (jc = 1; jc <= i__1; ++jc) {
485 if (alphai[jc] < 0.) {
486 goto L50;
487 }
488 temp = 0.;
489 if (alphai[jc] == 0.) {
490 i__2 = *n;
491 for (jr = 1; jr <= i__2; ++jr) {
492/* Computing MAX */
493 d__2 = temp, d__3 = (d__1 = vl_ref(jr, jc), absMACRO(d__1))
494 ;
495 temp = maxMACRO(d__2,d__3);
496/* L10: */
497 }
498 } else {
499 i__2 = *n;
500 for (jr = 1; jr <= i__2; ++jr) {
501/* Computing MAX */
502 d__3 = temp, d__4 = (d__1 = vl_ref(jr, jc), absMACRO(d__1))
503 + (d__2 = vl_ref(jr, jc + 1), absMACRO(d__2));
504 temp = maxMACRO(d__3,d__4);
505/* L20: */
506 }
507 }
508 if (temp < smlnum) {
509 goto L50;
510 }
511 temp = 1. / temp;
512 if (alphai[jc] == 0.) {
513 i__2 = *n;
514 for (jr = 1; jr <= i__2; ++jr) {
515 vl_ref(jr, jc) = vl_ref(jr, jc) * temp;
516/* L30: */
517 }
518 } else {
519 i__2 = *n;
520 for (jr = 1; jr <= i__2; ++jr) {
521 vl_ref(jr, jc) = vl_ref(jr, jc) * temp;
522 vl_ref(jr, jc + 1) = vl_ref(jr, jc + 1) * temp;
523/* L40: */
524 }
525 }
526L50:
527 ;
528 }
529 }
530 if (ilvr) {
531 template_lapack_ggbak("P", "R", n, &ilo, &ihi, &work[ileft], &work[iright], n, &
532 vr[vr_offset], ldvr, &ierr);
533 i__1 = *n;
534 for (jc = 1; jc <= i__1; ++jc) {
535 if (alphai[jc] < 0.) {
536 goto L100;
537 }
538 temp = 0.;
539 if (alphai[jc] == 0.) {
540 i__2 = *n;
541 for (jr = 1; jr <= i__2; ++jr) {
542/* Computing MAX */
543 d__2 = temp, d__3 = (d__1 = vr_ref(jr, jc), absMACRO(d__1))
544 ;
545 temp = maxMACRO(d__2,d__3);
546/* L60: */
547 }
548 } else {
549 i__2 = *n;
550 for (jr = 1; jr <= i__2; ++jr) {
551/* Computing MAX */
552 d__3 = temp, d__4 = (d__1 = vr_ref(jr, jc), absMACRO(d__1))
553 + (d__2 = vr_ref(jr, jc + 1), absMACRO(d__2));
554 temp = maxMACRO(d__3,d__4);
555/* L70: */
556 }
557 }
558 if (temp < smlnum) {
559 goto L100;
560 }
561 temp = 1. / temp;
562 if (alphai[jc] == 0.) {
563 i__2 = *n;
564 for (jr = 1; jr <= i__2; ++jr) {
565 vr_ref(jr, jc) = vr_ref(jr, jc) * temp;
566/* L80: */
567 }
568 } else {
569 i__2 = *n;
570 for (jr = 1; jr <= i__2; ++jr) {
571 vr_ref(jr, jc) = vr_ref(jr, jc) * temp;
572 vr_ref(jr, jc + 1) = vr_ref(jr, jc + 1) * temp;
573/* L90: */
574 }
575 }
576L100:
577 ;
578 }
579 }
580
581/* End of eigenvector calculation */
582
583 }
584
585/* Undo scaling if necessary */
586
587 if (ilascl) {
588 template_lapack_lascl("G", &c__0, &c__0, &anrmto, &anrm, n, &c__1, &alphar[1], n, &
589 ierr);
590 template_lapack_lascl("G", &c__0, &c__0, &anrmto, &anrm, n, &c__1, &alphai[1], n, &
591 ierr);
592 }
593
594 if (ilbscl) {
595 template_lapack_lascl("G", &c__0, &c__0, &bnrmto, &bnrm, n, &c__1, &beta[1], n, &
596 ierr);
597 }
598
599L110:
600
601 work[1] = (Treal) maxwrk;
602
603 return 0;
604
605/* End of DGGEV */
606
607} /* dggev_ */
608
609#undef vr_ref
610#undef vl_ref
611#undef b_ref
612#undef a_ref
613
614
615#endif
Treal template_blas_sqrt(Treal x)
int template_blas_erbla(const char *srname, integer *info)
Definition: template_blas_common.cc:146
logical template_blas_lsame(const char *ca, const char *cb)
Definition: template_blas_common.cc:46
int integer
Definition: template_blas_common.h:40
#define absMACRO(x)
Definition: template_blas_common.h:47
int ftnlen
Definition: template_blas_common.h:42
#define maxMACRO(a, b)
Definition: template_blas_common.h:45
bool logical
Definition: template_blas_common.h:41
integer template_lapack_ilaenv(const integer *ispec, const char *name__, const char *opts, const integer *n1, const integer *n2, const integer *n3, const integer *n4, ftnlen name_len, ftnlen opts_len)
Definition: template_lapack_common.cc:281
#define TRUE_
Definition: template_lapack_common.h:42
#define FALSE_
Definition: template_lapack_common.h:43
int template_lapack_geqrf(const integer *m, const integer *n, Treal *a, const integer *lda, Treal *tau, Treal *work, const integer *lwork, integer *info)
Definition: template_lapack_geqrf.h:42
int template_lapack_ggbak(const char *job, const char *side, const integer *n, const integer *ilo, const integer *ihi, const Treal *lscale, const Treal *rscale, const integer *m, Treal *v, const integer *ldv, integer *info)
Definition: template_lapack_ggbak.h:42
int template_lapack_ggbal(const char *job, const integer *n, Treal *a, const integer *lda, Treal *b, const integer *ldb, integer *ilo, integer *ihi, Treal *lscale, Treal *rscale, Treal *work, integer *info)
Definition: template_lapack_ggbal.h:42
#define vl_ref(a_1, a_2)
int template_lapack_ggev(const char *jobvl, const char *jobvr, const integer *n, Treal *a, const integer *lda, Treal *b, const integer *ldb, Treal *alphar, Treal *alphai, Treal *beta, Treal *vl, const integer *ldvl, Treal *vr, const integer *ldvr, Treal *work, const integer *lwork, integer *info)
Definition: template_lapack_ggev.h:42
#define a_ref(a_1, a_2)
#define b_ref(a_1, a_2)
#define vr_ref(a_1, a_2)
int template_lapack_gghrd(const char *compq, const char *compz, const integer *n, const integer *ilo, const integer *ihi, Treal *a, const integer *lda, Treal *b, const integer *ldb, Treal *q, const integer *ldq, Treal *z__, const integer *ldz, integer *info)
Definition: template_lapack_gghrd.h:42
int template_lapack_hgeqz(const char *job, const char *compq, const char *compz, const integer *n, const integer *ilo, const integer *ihi, Treal *a, const integer *lda, Treal *b, const integer *ldb, Treal *alphar, Treal *alphai, Treal *beta, Treal *q, const integer *ldq, Treal *z__, const integer *ldz, Treal *work, const integer *lwork, integer *info)
Definition: template_lapack_hgeqz.h:42
int template_lapack_labad(Treal *small, Treal *large)
Definition: template_lapack_labad.h:42
int template_lapack_lacpy(const char *uplo, const integer *m, const integer *n, const Treal *a, const integer *lda, Treal *b, const integer *ldb)
Definition: template_lapack_lacpy.h:42
Treal template_lapack_lamch(const char *cmach, Treal dummyReal)
Definition: template_lapack_lamch.h:202
Treal template_lapack_lange(const char *norm, const integer *m, const integer *n, const Treal *a, const integer *lda, Treal *work)
Definition: template_lapack_lange.h:42
int template_lapack_lascl(const char *type__, const integer *kl, const integer *ku, const Treal *cfrom, const Treal *cto, const integer *m, const integer *n, Treal *a, const integer *lda, integer *info)
Definition: template_lapack_lascl.h:42
int template_lapack_laset(const char *uplo, const integer *m, const integer *n, const Treal *alpha, const Treal *beta, Treal *a, const integer *lda)
Definition: template_lapack_laset.h:42
int template_lapack_orgqr(const integer *m, const integer *n, const integer *k, Treal *a, const integer *lda, const Treal *tau, Treal *work, const integer *lwork, integer *info)
Definition: template_lapack_orgqr.h:43
int template_lapack_ormqr(char *side, char *trans, const integer *m, const integer *n, const integer *k, Treal *a, const integer *lda, const Treal *tau, Treal *c__, const integer *ldc, Treal *work, const integer *lwork, integer *info)
Definition: template_lapack_ormqr.h:42
int template_lapack_tgevc(const char *side, const char *howmny, const logical *select, const integer *n, const Treal *a, const integer *lda, const Treal *b, const integer *ldb, Treal *vl, const integer *ldvl, Treal *vr, const integer *ldvr, const integer *mm, integer *m, Treal *work, integer *info)
Definition: template_lapack_tgevc.h:46