14 typedef long long BLASLONG;
15 typedef unsigned long long BLASULONG;
17 typedef long BLASLONG;
18 typedef unsigned long BLASULONG;
22 typedef BLASLONG blasint;
24 #define blasabs(x) llabs(x)
26 #define blasabs(x) labs(x)
30 #define blasabs(x) abs(x)
33 typedef blasint integer;
35 typedef unsigned int uinteger;
36 typedef char *address;
37 typedef short int shortint;
39 typedef double doublereal;
40 typedef struct { real r, i; } complex;
41 typedef struct { doublereal r, i; } doublecomplex;
43 static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
44 static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
45 static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
46 static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
48 static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
49 static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
50 static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
51 static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
53 #define pCf(z) (*_pCf(z))
54 #define pCd(z) (*_pCd(z))
56 typedef short int shortlogical;
57 typedef char logical1;
58 typedef char integer1;
63 /* Extern is for use with -E */
74 /*external read, write*/
83 /*internal read, write*/
113 /*rewind, backspace, endfile*/
125 ftnint *inex; /*parameters in standard's order*/
151 union Multitype { /* for multiple entry points */
162 typedef union Multitype Multitype;
164 struct Vardesc { /* for Namelist */
170 typedef struct Vardesc Vardesc;
177 typedef struct Namelist Namelist;
179 #define abs(x) ((x) >= 0 ? (x) : -(x))
180 #define dabs(x) (fabs(x))
181 #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
182 #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
183 #define dmin(a,b) (f2cmin(a,b))
184 #define dmax(a,b) (f2cmax(a,b))
185 #define bit_test(a,b) ((a) >> (b) & 1)
186 #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
187 #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
189 #define abort_() { sig_die("Fortran abort routine called", 1); }
190 #define c_abs(z) (cabsf(Cf(z)))
191 #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
193 #define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);}
194 #define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/df(b)._Val[1]);}
196 #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
197 #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
199 #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
200 #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
201 #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
202 //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
203 #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
204 #define d_abs(x) (fabs(*(x)))
205 #define d_acos(x) (acos(*(x)))
206 #define d_asin(x) (asin(*(x)))
207 #define d_atan(x) (atan(*(x)))
208 #define d_atn2(x, y) (atan2(*(x),*(y)))
209 #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
210 #define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
211 #define d_cos(x) (cos(*(x)))
212 #define d_cosh(x) (cosh(*(x)))
213 #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
214 #define d_exp(x) (exp(*(x)))
215 #define d_imag(z) (cimag(Cd(z)))
216 #define r_imag(z) (cimagf(Cf(z)))
217 #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
218 #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
219 #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
220 #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
221 #define d_log(x) (log(*(x)))
222 #define d_mod(x, y) (fmod(*(x), *(y)))
223 #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
224 #define d_nint(x) u_nint(*(x))
225 #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
226 #define d_sign(a,b) u_sign(*(a),*(b))
227 #define r_sign(a,b) u_sign(*(a),*(b))
228 #define d_sin(x) (sin(*(x)))
229 #define d_sinh(x) (sinh(*(x)))
230 #define d_sqrt(x) (sqrt(*(x)))
231 #define d_tan(x) (tan(*(x)))
232 #define d_tanh(x) (tanh(*(x)))
233 #define i_abs(x) abs(*(x))
234 #define i_dnnt(x) ((integer)u_nint(*(x)))
235 #define i_len(s, n) (n)
236 #define i_nint(x) ((integer)u_nint(*(x)))
237 #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
238 #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
239 #define pow_si(B,E) spow_ui(*(B),*(E))
240 #define pow_ri(B,E) spow_ui(*(B),*(E))
241 #define pow_di(B,E) dpow_ui(*(B),*(E))
242 #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
243 #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
244 #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
245 #define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; }
246 #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
247 #define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
248 #define sig_die(s, kill) { exit(1); }
249 #define s_stop(s, n) {exit(0);}
250 static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
251 #define z_abs(z) (cabs(Cd(z)))
252 #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
253 #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
254 #define myexit_() break;
255 #define mycycle() continue;
256 #define myceiling(w) {ceil(w)}
257 #define myhuge(w) {HUGE_VAL}
258 //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
259 #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
261 /* procedure parameter types for -A and -C++ */
263 #define F2C_proc_par_types 1
265 typedef logical (*L_fp)(...);
267 typedef logical (*L_fp)();
270 static float spow_ui(float x, integer n) {
271 float pow=1.0; unsigned long int u;
273 if(n < 0) n = -n, x = 1/x;
282 static double dpow_ui(double x, integer n) {
283 double pow=1.0; unsigned long int u;
285 if(n < 0) n = -n, x = 1/x;
295 static _Fcomplex cpow_ui(complex x, integer n) {
296 complex pow={1.0,0.0}; unsigned long int u;
298 if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i;
300 if(u & 01) pow.r *= x.r, pow.i *= x.i;
301 if(u >>= 1) x.r *= x.r, x.i *= x.i;
305 _Fcomplex p={pow.r, pow.i};
309 static _Complex float cpow_ui(_Complex float x, integer n) {
310 _Complex float pow=1.0; unsigned long int u;
312 if(n < 0) n = -n, x = 1/x;
323 static _Dcomplex zpow_ui(_Dcomplex x, integer n) {
324 _Dcomplex pow={1.0,0.0}; unsigned long int u;
326 if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1];
328 if(u & 01) pow._Val[0] *= x._Val[0], pow._Val[1] *= x._Val[1];
329 if(u >>= 1) x._Val[0] *= x._Val[0], x._Val[1] *= x._Val[1];
333 _Dcomplex p = {pow._Val[0], pow._Val[1]};
337 static _Complex double zpow_ui(_Complex double x, integer n) {
338 _Complex double pow=1.0; unsigned long int u;
340 if(n < 0) n = -n, x = 1/x;
350 static integer pow_ii(integer x, integer n) {
351 integer pow; unsigned long int u;
353 if (n == 0 || x == 1) pow = 1;
354 else if (x != -1) pow = x == 0 ? 1/x : 0;
357 if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
367 static integer dmaxloc_(double *w, integer s, integer e, integer *n)
369 double m; integer i, mi;
370 for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
371 if (w[i-1]>m) mi=i ,m=w[i-1];
374 static integer smaxloc_(float *w, integer s, integer e, integer *n)
376 float m; integer i, mi;
377 for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
378 if (w[i-1]>m) mi=i ,m=w[i-1];
381 static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
382 integer n = *n_, incx = *incx_, incy = *incy_, i;
384 _Fcomplex zdotc = {0.0, 0.0};
385 if (incx == 1 && incy == 1) {
386 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
387 zdotc._Val[0] += conjf(Cf(&x[i]))._Val[0] * Cf(&y[i])._Val[0];
388 zdotc._Val[1] += conjf(Cf(&x[i]))._Val[1] * Cf(&y[i])._Val[1];
391 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
392 zdotc._Val[0] += conjf(Cf(&x[i*incx]))._Val[0] * Cf(&y[i*incy])._Val[0];
393 zdotc._Val[1] += conjf(Cf(&x[i*incx]))._Val[1] * Cf(&y[i*incy])._Val[1];
399 _Complex float zdotc = 0.0;
400 if (incx == 1 && incy == 1) {
401 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
402 zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
405 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
406 zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
412 static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
413 integer n = *n_, incx = *incx_, incy = *incy_, i;
415 _Dcomplex zdotc = {0.0, 0.0};
416 if (incx == 1 && incy == 1) {
417 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
418 zdotc._Val[0] += conj(Cd(&x[i]))._Val[0] * Cd(&y[i])._Val[0];
419 zdotc._Val[1] += conj(Cd(&x[i]))._Val[1] * Cd(&y[i])._Val[1];
422 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
423 zdotc._Val[0] += conj(Cd(&x[i*incx]))._Val[0] * Cd(&y[i*incy])._Val[0];
424 zdotc._Val[1] += conj(Cd(&x[i*incx]))._Val[1] * Cd(&y[i*incy])._Val[1];
430 _Complex double zdotc = 0.0;
431 if (incx == 1 && incy == 1) {
432 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
433 zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
436 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
437 zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
443 static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
444 integer n = *n_, incx = *incx_, incy = *incy_, i;
446 _Fcomplex zdotc = {0.0, 0.0};
447 if (incx == 1 && incy == 1) {
448 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
449 zdotc._Val[0] += Cf(&x[i])._Val[0] * Cf(&y[i])._Val[0];
450 zdotc._Val[1] += Cf(&x[i])._Val[1] * Cf(&y[i])._Val[1];
453 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
454 zdotc._Val[0] += Cf(&x[i*incx])._Val[0] * Cf(&y[i*incy])._Val[0];
455 zdotc._Val[1] += Cf(&x[i*incx])._Val[1] * Cf(&y[i*incy])._Val[1];
461 _Complex float zdotc = 0.0;
462 if (incx == 1 && incy == 1) {
463 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
464 zdotc += Cf(&x[i]) * Cf(&y[i]);
467 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
468 zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
474 static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
475 integer n = *n_, incx = *incx_, incy = *incy_, i;
477 _Dcomplex zdotc = {0.0, 0.0};
478 if (incx == 1 && incy == 1) {
479 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
480 zdotc._Val[0] += Cd(&x[i])._Val[0] * Cd(&y[i])._Val[0];
481 zdotc._Val[1] += Cd(&x[i])._Val[1] * Cd(&y[i])._Val[1];
484 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
485 zdotc._Val[0] += Cd(&x[i*incx])._Val[0] * Cd(&y[i*incy])._Val[0];
486 zdotc._Val[1] += Cd(&x[i*incx])._Val[1] * Cd(&y[i*incy])._Val[1];
492 _Complex double zdotc = 0.0;
493 if (incx == 1 && incy == 1) {
494 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
495 zdotc += Cd(&x[i]) * Cd(&y[i]);
498 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
499 zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
505 /* -- translated by f2c (version 20000121).
506 You must link the resulting object file with the libraries:
507 -lf2c -lm (in that order)
513 /* Table of constant values */
515 static complex c_b1 = {1.f,0.f};
516 static complex c_b2 = {0.f,0.f};
518 /* > \brief \b CTPRFB applies a real or complex "triangular-pentagonal" blocked reflector to a real or complex
519 matrix, which is composed of two blocks. */
521 /* =========== DOCUMENTATION =========== */
523 /* Online html documentation available at */
524 /* http://www.netlib.org/lapack/explore-html/ */
527 /* > Download CTPRFB + dependencies */
528 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ctprfb.
531 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ctprfb.
534 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctprfb.
542 /* SUBROUTINE CTPRFB( SIDE, TRANS, DIRECT, STOREV, M, N, K, L, */
543 /* V, LDV, T, LDT, A, LDA, B, LDB, WORK, LDWORK ) */
545 /* CHARACTER DIRECT, SIDE, STOREV, TRANS */
546 /* INTEGER K, L, LDA, LDB, LDT, LDV, LDWORK, M, N */
547 /* COMPLEX A( LDA, * ), B( LDB, * ), T( LDT, * ), */
548 /* $ V( LDV, * ), WORK( LDWORK, * ) */
551 /* > \par Purpose: */
556 /* > CTPRFB applies a complex "triangular-pentagonal" block reflector H or its */
557 /* > conjugate transpose H**H to a complex matrix C, which is composed of two */
558 /* > blocks A and B, either from the left or right. */
565 /* > \param[in] SIDE */
567 /* > SIDE is CHARACTER*1 */
568 /* > = 'L': apply H or H**H from the Left */
569 /* > = 'R': apply H or H**H from the Right */
572 /* > \param[in] TRANS */
574 /* > TRANS is CHARACTER*1 */
575 /* > = 'N': apply H (No transpose) */
576 /* > = 'C': apply H**H (Conjugate transpose) */
579 /* > \param[in] DIRECT */
581 /* > DIRECT is CHARACTER*1 */
582 /* > Indicates how H is formed from a product of elementary */
584 /* > = 'F': H = H(1) H(2) . . . H(k) (Forward) */
585 /* > = 'B': H = H(k) . . . H(2) H(1) (Backward) */
588 /* > \param[in] STOREV */
590 /* > STOREV is CHARACTER*1 */
591 /* > Indicates how the vectors which define the elementary */
592 /* > reflectors are stored: */
593 /* > = 'C': Columns */
600 /* > The number of rows of the matrix B. */
607 /* > The number of columns of the matrix B. */
614 /* > The order of the matrix T, i.e. the number of elementary */
615 /* > reflectors whose product defines the block reflector. */
622 /* > The order of the trapezoidal part of V. */
623 /* > K >= L >= 0. See Further Details. */
628 /* > V is COMPLEX array, dimension */
629 /* > (LDV,K) if STOREV = 'C' */
630 /* > (LDV,M) if STOREV = 'R' and SIDE = 'L' */
631 /* > (LDV,N) if STOREV = 'R' and SIDE = 'R' */
632 /* > The pentagonal matrix V, which contains the elementary reflectors */
633 /* > H(1), H(2), ..., H(K). See Further Details. */
636 /* > \param[in] LDV */
638 /* > LDV is INTEGER */
639 /* > The leading dimension of the array V. */
640 /* > If STOREV = 'C' and SIDE = 'L', LDV >= f2cmax(1,M); */
641 /* > if STOREV = 'C' and SIDE = 'R', LDV >= f2cmax(1,N); */
642 /* > if STOREV = 'R', LDV >= K. */
647 /* > T is COMPLEX array, dimension (LDT,K) */
648 /* > The triangular K-by-K matrix T in the representation of the */
649 /* > block reflector. */
652 /* > \param[in] LDT */
654 /* > LDT is INTEGER */
655 /* > The leading dimension of the array T. */
659 /* > \param[in,out] A */
661 /* > A is COMPLEX array, dimension */
662 /* > (LDA,N) if SIDE = 'L' or (LDA,K) if SIDE = 'R' */
663 /* > On entry, the K-by-N or M-by-K matrix A. */
664 /* > On exit, A is overwritten by the corresponding block of */
665 /* > H*C or H**H*C or C*H or C*H**H. See Further Details. */
668 /* > \param[in] LDA */
670 /* > LDA is INTEGER */
671 /* > The leading dimension of the array A. */
672 /* > If SIDE = 'L', LDA >= f2cmax(1,K); */
673 /* > If SIDE = 'R', LDA >= f2cmax(1,M). */
676 /* > \param[in,out] B */
678 /* > B is COMPLEX array, dimension (LDB,N) */
679 /* > On entry, the M-by-N matrix B. */
680 /* > On exit, B is overwritten by the corresponding block of */
681 /* > H*C or H**H*C or C*H or C*H**H. See Further Details. */
684 /* > \param[in] LDB */
686 /* > LDB is INTEGER */
687 /* > The leading dimension of the array B. */
688 /* > LDB >= f2cmax(1,M). */
691 /* > \param[out] WORK */
693 /* > WORK is COMPLEX array, dimension */
694 /* > (LDWORK,N) if SIDE = 'L', */
695 /* > (LDWORK,K) if SIDE = 'R'. */
698 /* > \param[in] LDWORK */
700 /* > LDWORK is INTEGER */
701 /* > The leading dimension of the array WORK. */
702 /* > If SIDE = 'L', LDWORK >= K; */
703 /* > if SIDE = 'R', LDWORK >= M. */
709 /* > \author Univ. of Tennessee */
710 /* > \author Univ. of California Berkeley */
711 /* > \author Univ. of Colorado Denver */
712 /* > \author NAG Ltd. */
714 /* > \date December 2016 */
716 /* > \ingroup complexOTHERauxiliary */
718 /* > \par Further Details: */
719 /* ===================== */
723 /* > The matrix C is a composite matrix formed from blocks A and B. */
724 /* > The block B is of size M-by-N; if SIDE = 'R', A is of size M-by-K, */
725 /* > and if SIDE = 'L', A is of size K-by-N. */
727 /* > If SIDE = 'R' and DIRECT = 'F', C = [A B]. */
729 /* > If SIDE = 'L' and DIRECT = 'F', C = [A] */
732 /* > If SIDE = 'R' and DIRECT = 'B', C = [B A]. */
734 /* > If SIDE = 'L' and DIRECT = 'B', C = [B] */
737 /* > The pentagonal matrix V is composed of a rectangular block V1 and a */
738 /* > trapezoidal block V2. The size of the trapezoidal block is determined by */
739 /* > the parameter L, where 0<=L<=K. If L=K, the V2 block of V is triangular; */
740 /* > if L=0, there is no trapezoidal block, thus V = V1 is rectangular. */
742 /* > If DIRECT = 'F' and STOREV = 'C': V = [V1] */
744 /* > - V2 is upper trapezoidal (first L rows of K-by-K upper triangular) */
746 /* > If DIRECT = 'F' and STOREV = 'R': V = [V1 V2] */
748 /* > - V2 is lower trapezoidal (first L columns of K-by-K lower triangular) */
750 /* > If DIRECT = 'B' and STOREV = 'C': V = [V2] */
752 /* > - V2 is lower trapezoidal (last L rows of K-by-K lower triangular) */
754 /* > If DIRECT = 'B' and STOREV = 'R': V = [V2 V1] */
756 /* > - V2 is upper trapezoidal (last L columns of K-by-K upper triangular) */
758 /* > If STOREV = 'C' and SIDE = 'L', V is M-by-K with V2 L-by-K. */
760 /* > If STOREV = 'C' and SIDE = 'R', V is N-by-K with V2 L-by-K. */
762 /* > If STOREV = 'R' and SIDE = 'L', V is K-by-M with V2 K-by-L. */
764 /* > If STOREV = 'R' and SIDE = 'R', V is K-by-N with V2 K-by-L. */
767 /* ===================================================================== */
768 /* Subroutine */ int ctprfb_(char *side, char *trans, char *direct, char *
769 storev, integer *m, integer *n, integer *k, integer *l, complex *v,
770 integer *ldv, complex *t, integer *ldt, complex *a, integer *lda,
771 complex *b, integer *ldb, complex *work, integer *ldwork)
773 /* System generated locals */
774 integer a_dim1, a_offset, b_dim1, b_offset, t_dim1, t_offset, v_dim1,
775 v_offset, work_dim1, work_offset, i__1, i__2, i__3, i__4, i__5;
778 /* Local variables */
779 logical left, backward;
781 extern /* Subroutine */ int cgemm_(char *, char *, integer *, integer *,
782 integer *, complex *, complex *, integer *, complex *, integer *,
783 complex *, complex *, integer *);
784 extern logical lsame_(char *, char *);
786 extern /* Subroutine */ int ctrmm_(char *, char *, char *, char *,
787 integer *, integer *, complex *, complex *, integer *, complex *,
790 logical column, row, forward;
793 /* -- LAPACK auxiliary routine (version 3.7.0) -- */
794 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
795 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
799 /* ========================================================================== */
802 /* Quick return if possible */
804 /* Parameter adjustments */
806 v_offset = 1 + v_dim1 * 1;
809 t_offset = 1 + t_dim1 * 1;
812 a_offset = 1 + a_dim1 * 1;
815 b_offset = 1 + b_dim1 * 1;
818 work_offset = 1 + work_dim1 * 1;
822 if (*m <= 0 || *n <= 0 || *k <= 0 || *l < 0) {
826 if (lsame_(storev, "C")) {
829 } else if (lsame_(storev, "R")) {
837 if (lsame_(side, "L")) {
840 } else if (lsame_(side, "R")) {
848 if (lsame_(direct, "F")) {
851 } else if (lsame_(direct, "B")) {
859 /* --------------------------------------------------------------------------- */
861 if (column && forward && left) {
863 /* --------------------------------------------------------------------------- */
865 /* Let W = [ I ] (K-by-K) */
868 /* Form H C or H**H C where C = [ A ] (K-by-N) */
871 /* H = I - W T W**H or H**H = I - W T**H W**H */
873 /* A = A - T (A + V**H B) or A = A - T**H (A + V**H B) */
874 /* B = B - V T (A + V**H B) or B = B - V T**H (A + V**H B) */
876 /* --------------------------------------------------------------------------- */
880 mp = f2cmin(i__1,*m);
883 kp = f2cmin(i__1,*k);
886 for (j = 1; j <= i__1; ++j) {
888 for (i__ = 1; i__ <= i__2; ++i__) {
889 i__3 = i__ + j * work_dim1;
890 i__4 = *m - *l + i__ + j * b_dim1;
891 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
894 ctrmm_("L", "U", "C", "N", l, n, &c_b1, &v[mp + v_dim1], ldv, &work[
895 work_offset], ldwork);
897 cgemm_("C", "N", l, n, &i__1, &c_b1, &v[v_offset], ldv, &b[b_offset],
898 ldb, &c_b1, &work[work_offset], ldwork);
900 cgemm_("C", "N", &i__1, n, m, &c_b1, &v[kp * v_dim1 + 1], ldv, &b[
901 b_offset], ldb, &c_b2, &work[kp + work_dim1], ldwork);
904 for (j = 1; j <= i__1; ++j) {
906 for (i__ = 1; i__ <= i__2; ++i__) {
907 i__3 = i__ + j * work_dim1;
908 i__4 = i__ + j * work_dim1;
909 i__5 = i__ + j * a_dim1;
910 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
912 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
916 ctrmm_("L", "U", trans, "N", k, n, &c_b1, &t[t_offset], ldt, &work[
917 work_offset], ldwork);
920 for (j = 1; j <= i__1; ++j) {
922 for (i__ = 1; i__ <= i__2; ++i__) {
923 i__3 = i__ + j * a_dim1;
924 i__4 = i__ + j * a_dim1;
925 i__5 = i__ + j * work_dim1;
926 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
928 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
933 q__1.r = -1.f, q__1.i = 0.f;
934 cgemm_("N", "N", &i__1, n, k, &q__1, &v[v_offset], ldv, &work[
935 work_offset], ldwork, &c_b1, &b[b_offset], ldb);
937 q__1.r = -1.f, q__1.i = 0.f;
938 cgemm_("N", "N", l, n, &i__1, &q__1, &v[mp + kp * v_dim1], ldv, &work[
939 kp + work_dim1], ldwork, &c_b1, &b[mp + b_dim1], ldb);
940 ctrmm_("L", "U", "N", "N", l, n, &c_b1, &v[mp + v_dim1], ldv, &work[
941 work_offset], ldwork);
943 for (j = 1; j <= i__1; ++j) {
945 for (i__ = 1; i__ <= i__2; ++i__) {
946 i__3 = *m - *l + i__ + j * b_dim1;
947 i__4 = *m - *l + i__ + j * b_dim1;
948 i__5 = i__ + j * work_dim1;
949 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
951 b[i__3].r = q__1.r, b[i__3].i = q__1.i;
955 /* --------------------------------------------------------------------------- */
957 } else if (column && forward && right) {
959 /* --------------------------------------------------------------------------- */
961 /* Let W = [ I ] (K-by-K) */
964 /* Form C H or C H**H where C = [ A B ] (A is M-by-K, B is M-by-N) */
966 /* H = I - W T W**H or H**H = I - W T**H W**H */
968 /* A = A - (A + B V) T or A = A - (A + B V) T**H */
969 /* B = B - (A + B V) T V**H or B = B - (A + B V) T**H V**H */
971 /* --------------------------------------------------------------------------- */
975 np = f2cmin(i__1,*n);
978 kp = f2cmin(i__1,*k);
981 for (j = 1; j <= i__1; ++j) {
983 for (i__ = 1; i__ <= i__2; ++i__) {
984 i__3 = i__ + j * work_dim1;
985 i__4 = i__ + (*n - *l + j) * b_dim1;
986 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
989 ctrmm_("R", "U", "N", "N", m, l, &c_b1, &v[np + v_dim1], ldv, &work[
990 work_offset], ldwork);
992 cgemm_("N", "N", m, l, &i__1, &c_b1, &b[b_offset], ldb, &v[v_offset],
993 ldv, &c_b1, &work[work_offset], ldwork);
995 cgemm_("N", "N", m, &i__1, n, &c_b1, &b[b_offset], ldb, &v[kp *
996 v_dim1 + 1], ldv, &c_b2, &work[kp * work_dim1 + 1], ldwork);
999 for (j = 1; j <= i__1; ++j) {
1001 for (i__ = 1; i__ <= i__2; ++i__) {
1002 i__3 = i__ + j * work_dim1;
1003 i__4 = i__ + j * work_dim1;
1004 i__5 = i__ + j * a_dim1;
1005 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
1007 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1011 ctrmm_("R", "U", trans, "N", m, k, &c_b1, &t[t_offset], ldt, &work[
1012 work_offset], ldwork);
1015 for (j = 1; j <= i__1; ++j) {
1017 for (i__ = 1; i__ <= i__2; ++i__) {
1018 i__3 = i__ + j * a_dim1;
1019 i__4 = i__ + j * a_dim1;
1020 i__5 = i__ + j * work_dim1;
1021 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
1023 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
1028 q__1.r = -1.f, q__1.i = 0.f;
1029 cgemm_("N", "C", m, &i__1, k, &q__1, &work[work_offset], ldwork, &v[
1030 v_offset], ldv, &c_b1, &b[b_offset], ldb);
1032 q__1.r = -1.f, q__1.i = 0.f;
1033 cgemm_("N", "C", m, l, &i__1, &q__1, &work[kp * work_dim1 + 1],
1034 ldwork, &v[np + kp * v_dim1], ldv, &c_b1, &b[np * b_dim1 + 1],
1036 ctrmm_("R", "U", "C", "N", m, l, &c_b1, &v[np + v_dim1], ldv, &work[
1037 work_offset], ldwork);
1039 for (j = 1; j <= i__1; ++j) {
1041 for (i__ = 1; i__ <= i__2; ++i__) {
1042 i__3 = i__ + (*n - *l + j) * b_dim1;
1043 i__4 = i__ + (*n - *l + j) * b_dim1;
1044 i__5 = i__ + j * work_dim1;
1045 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
1047 b[i__3].r = q__1.r, b[i__3].i = q__1.i;
1051 /* --------------------------------------------------------------------------- */
1053 } else if (column && backward && left) {
1055 /* --------------------------------------------------------------------------- */
1057 /* Let W = [ V ] (M-by-K) */
1058 /* [ I ] (K-by-K) */
1060 /* Form H C or H**H C where C = [ B ] (M-by-N) */
1061 /* [ A ] (K-by-N) */
1063 /* H = I - W T W**H or H**H = I - W T**H W**H */
1065 /* A = A - T (A + V**H B) or A = A - T**H (A + V**H B) */
1066 /* B = B - V T (A + V**H B) or B = B - V T**H (A + V**H B) */
1068 /* --------------------------------------------------------------------------- */
1072 mp = f2cmin(i__1,*m);
1075 kp = f2cmin(i__1,*k);
1078 for (j = 1; j <= i__1; ++j) {
1080 for (i__ = 1; i__ <= i__2; ++i__) {
1081 i__3 = *k - *l + i__ + j * work_dim1;
1082 i__4 = i__ + j * b_dim1;
1083 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
1087 ctrmm_("L", "L", "C", "N", l, n, &c_b1, &v[kp * v_dim1 + 1], ldv, &
1088 work[kp + work_dim1], ldwork);
1090 cgemm_("C", "N", l, n, &i__1, &c_b1, &v[mp + kp * v_dim1], ldv, &b[mp
1091 + b_dim1], ldb, &c_b1, &work[kp + work_dim1], ldwork);
1093 cgemm_("C", "N", &i__1, n, m, &c_b1, &v[v_offset], ldv, &b[b_offset],
1094 ldb, &c_b2, &work[work_offset], ldwork);
1097 for (j = 1; j <= i__1; ++j) {
1099 for (i__ = 1; i__ <= i__2; ++i__) {
1100 i__3 = i__ + j * work_dim1;
1101 i__4 = i__ + j * work_dim1;
1102 i__5 = i__ + j * a_dim1;
1103 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
1105 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1109 ctrmm_("L", "L", trans, "N", k, n, &c_b1, &t[t_offset], ldt, &work[
1110 work_offset], ldwork);
1113 for (j = 1; j <= i__1; ++j) {
1115 for (i__ = 1; i__ <= i__2; ++i__) {
1116 i__3 = i__ + j * a_dim1;
1117 i__4 = i__ + j * a_dim1;
1118 i__5 = i__ + j * work_dim1;
1119 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
1121 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
1126 q__1.r = -1.f, q__1.i = 0.f;
1127 cgemm_("N", "N", &i__1, n, k, &q__1, &v[mp + v_dim1], ldv, &work[
1128 work_offset], ldwork, &c_b1, &b[mp + b_dim1], ldb);
1130 q__1.r = -1.f, q__1.i = 0.f;
1131 cgemm_("N", "N", l, n, &i__1, &q__1, &v[v_offset], ldv, &work[
1132 work_offset], ldwork, &c_b1, &b[b_offset], ldb);
1133 ctrmm_("L", "L", "N", "N", l, n, &c_b1, &v[kp * v_dim1 + 1], ldv, &
1134 work[kp + work_dim1], ldwork);
1136 for (j = 1; j <= i__1; ++j) {
1138 for (i__ = 1; i__ <= i__2; ++i__) {
1139 i__3 = i__ + j * b_dim1;
1140 i__4 = i__ + j * b_dim1;
1141 i__5 = *k - *l + i__ + j * work_dim1;
1142 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
1144 b[i__3].r = q__1.r, b[i__3].i = q__1.i;
1148 /* --------------------------------------------------------------------------- */
1150 } else if (column && backward && right) {
1152 /* --------------------------------------------------------------------------- */
1154 /* Let W = [ V ] (N-by-K) */
1155 /* [ I ] (K-by-K) */
1157 /* Form C H or C H**H where C = [ B A ] (B is M-by-N, A is M-by-K) */
1159 /* H = I - W T W**H or H**H = I - W T**H W**H */
1161 /* A = A - (A + B V) T or A = A - (A + B V) T**H */
1162 /* B = B - (A + B V) T V**H or B = B - (A + B V) T**H V**H */
1164 /* --------------------------------------------------------------------------- */
1168 np = f2cmin(i__1,*n);
1171 kp = f2cmin(i__1,*k);
1174 for (j = 1; j <= i__1; ++j) {
1176 for (i__ = 1; i__ <= i__2; ++i__) {
1177 i__3 = i__ + (*k - *l + j) * work_dim1;
1178 i__4 = i__ + j * b_dim1;
1179 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
1182 ctrmm_("R", "L", "N", "N", m, l, &c_b1, &v[kp * v_dim1 + 1], ldv, &
1183 work[kp * work_dim1 + 1], ldwork);
1185 cgemm_("N", "N", m, l, &i__1, &c_b1, &b[np * b_dim1 + 1], ldb, &v[np
1186 + kp * v_dim1], ldv, &c_b1, &work[kp * work_dim1 + 1], ldwork);
1188 cgemm_("N", "N", m, &i__1, n, &c_b1, &b[b_offset], ldb, &v[v_offset],
1189 ldv, &c_b2, &work[work_offset], ldwork);
1192 for (j = 1; j <= i__1; ++j) {
1194 for (i__ = 1; i__ <= i__2; ++i__) {
1195 i__3 = i__ + j * work_dim1;
1196 i__4 = i__ + j * work_dim1;
1197 i__5 = i__ + j * a_dim1;
1198 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
1200 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1204 ctrmm_("R", "L", trans, "N", m, k, &c_b1, &t[t_offset], ldt, &work[
1205 work_offset], ldwork);
1208 for (j = 1; j <= i__1; ++j) {
1210 for (i__ = 1; i__ <= i__2; ++i__) {
1211 i__3 = i__ + j * a_dim1;
1212 i__4 = i__ + j * a_dim1;
1213 i__5 = i__ + j * work_dim1;
1214 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
1216 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
1221 q__1.r = -1.f, q__1.i = 0.f;
1222 cgemm_("N", "C", m, &i__1, k, &q__1, &work[work_offset], ldwork, &v[
1223 np + v_dim1], ldv, &c_b1, &b[np * b_dim1 + 1], ldb);
1225 q__1.r = -1.f, q__1.i = 0.f;
1226 cgemm_("N", "C", m, l, &i__1, &q__1, &work[work_offset], ldwork, &v[
1227 v_offset], ldv, &c_b1, &b[b_offset], ldb);
1228 ctrmm_("R", "L", "C", "N", m, l, &c_b1, &v[kp * v_dim1 + 1], ldv, &
1229 work[kp * work_dim1 + 1], ldwork);
1231 for (j = 1; j <= i__1; ++j) {
1233 for (i__ = 1; i__ <= i__2; ++i__) {
1234 i__3 = i__ + j * b_dim1;
1235 i__4 = i__ + j * b_dim1;
1236 i__5 = i__ + (*k - *l + j) * work_dim1;
1237 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
1239 b[i__3].r = q__1.r, b[i__3].i = q__1.i;
1243 /* --------------------------------------------------------------------------- */
1245 } else if (row && forward && left) {
1247 /* --------------------------------------------------------------------------- */
1249 /* Let W = [ I V ] ( I is K-by-K, V is K-by-M ) */
1251 /* Form H C or H**H C where C = [ A ] (K-by-N) */
1252 /* [ B ] (M-by-N) */
1254 /* H = I - W**H T W or H**H = I - W**H T**H W */
1256 /* A = A - T (A + V B) or A = A - T**H (A + V B) */
1257 /* B = B - V**H T (A + V B) or B = B - V**H T**H (A + V B) */
1259 /* --------------------------------------------------------------------------- */
1263 mp = f2cmin(i__1,*m);
1266 kp = f2cmin(i__1,*k);
1269 for (j = 1; j <= i__1; ++j) {
1271 for (i__ = 1; i__ <= i__2; ++i__) {
1272 i__3 = i__ + j * work_dim1;
1273 i__4 = *m - *l + i__ + j * b_dim1;
1274 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
1277 ctrmm_("L", "L", "N", "N", l, n, &c_b1, &v[mp * v_dim1 + 1], ldv, &
1278 work[work_offset], ldb);
1280 cgemm_("N", "N", l, n, &i__1, &c_b1, &v[v_offset], ldv, &b[b_offset],
1281 ldb, &c_b1, &work[work_offset], ldwork);
1283 cgemm_("N", "N", &i__1, n, m, &c_b1, &v[kp + v_dim1], ldv, &b[
1284 b_offset], ldb, &c_b2, &work[kp + work_dim1], ldwork);
1287 for (j = 1; j <= i__1; ++j) {
1289 for (i__ = 1; i__ <= i__2; ++i__) {
1290 i__3 = i__ + j * work_dim1;
1291 i__4 = i__ + j * work_dim1;
1292 i__5 = i__ + j * a_dim1;
1293 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
1295 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1299 ctrmm_("L", "U", trans, "N", k, n, &c_b1, &t[t_offset], ldt, &work[
1300 work_offset], ldwork);
1303 for (j = 1; j <= i__1; ++j) {
1305 for (i__ = 1; i__ <= i__2; ++i__) {
1306 i__3 = i__ + j * a_dim1;
1307 i__4 = i__ + j * a_dim1;
1308 i__5 = i__ + j * work_dim1;
1309 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
1311 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
1316 q__1.r = -1.f, q__1.i = 0.f;
1317 cgemm_("C", "N", &i__1, n, k, &q__1, &v[v_offset], ldv, &work[
1318 work_offset], ldwork, &c_b1, &b[b_offset], ldb);
1320 q__1.r = -1.f, q__1.i = 0.f;
1321 cgemm_("C", "N", l, n, &i__1, &q__1, &v[kp + mp * v_dim1], ldv, &work[
1322 kp + work_dim1], ldwork, &c_b1, &b[mp + b_dim1], ldb);
1323 ctrmm_("L", "L", "C", "N", l, n, &c_b1, &v[mp * v_dim1 + 1], ldv, &
1324 work[work_offset], ldwork);
1326 for (j = 1; j <= i__1; ++j) {
1328 for (i__ = 1; i__ <= i__2; ++i__) {
1329 i__3 = *m - *l + i__ + j * b_dim1;
1330 i__4 = *m - *l + i__ + j * b_dim1;
1331 i__5 = i__ + j * work_dim1;
1332 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
1334 b[i__3].r = q__1.r, b[i__3].i = q__1.i;
1338 /* --------------------------------------------------------------------------- */
1340 } else if (row && forward && right) {
1342 /* --------------------------------------------------------------------------- */
1344 /* Let W = [ I V ] ( I is K-by-K, V is K-by-N ) */
1346 /* Form C H or C H**H where C = [ A B ] (A is M-by-K, B is M-by-N) */
1348 /* H = I - W**H T W or H**H = I - W**H T**H W */
1350 /* A = A - (A + B V**H) T or A = A - (A + B V**H) T**H */
1351 /* B = B - (A + B V**H) T V or B = B - (A + B V**H) T**H V */
1353 /* --------------------------------------------------------------------------- */
1357 np = f2cmin(i__1,*n);
1360 kp = f2cmin(i__1,*k);
1363 for (j = 1; j <= i__1; ++j) {
1365 for (i__ = 1; i__ <= i__2; ++i__) {
1366 i__3 = i__ + j * work_dim1;
1367 i__4 = i__ + (*n - *l + j) * b_dim1;
1368 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
1371 ctrmm_("R", "L", "C", "N", m, l, &c_b1, &v[np * v_dim1 + 1], ldv, &
1372 work[work_offset], ldwork);
1374 cgemm_("N", "C", m, l, &i__1, &c_b1, &b[b_offset], ldb, &v[v_offset],
1375 ldv, &c_b1, &work[work_offset], ldwork);
1377 cgemm_("N", "C", m, &i__1, n, &c_b1, &b[b_offset], ldb, &v[kp +
1378 v_dim1], ldv, &c_b2, &work[kp * work_dim1 + 1], ldwork);
1381 for (j = 1; j <= i__1; ++j) {
1383 for (i__ = 1; i__ <= i__2; ++i__) {
1384 i__3 = i__ + j * work_dim1;
1385 i__4 = i__ + j * work_dim1;
1386 i__5 = i__ + j * a_dim1;
1387 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
1389 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1393 ctrmm_("R", "U", trans, "N", m, k, &c_b1, &t[t_offset], ldt, &work[
1394 work_offset], ldwork);
1397 for (j = 1; j <= i__1; ++j) {
1399 for (i__ = 1; i__ <= i__2; ++i__) {
1400 i__3 = i__ + j * a_dim1;
1401 i__4 = i__ + j * a_dim1;
1402 i__5 = i__ + j * work_dim1;
1403 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
1405 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
1410 q__1.r = -1.f, q__1.i = 0.f;
1411 cgemm_("N", "N", m, &i__1, k, &q__1, &work[work_offset], ldwork, &v[
1412 v_offset], ldv, &c_b1, &b[b_offset], ldb);
1414 q__1.r = -1.f, q__1.i = 0.f;
1415 cgemm_("N", "N", m, l, &i__1, &q__1, &work[kp * work_dim1 + 1],
1416 ldwork, &v[kp + np * v_dim1], ldv, &c_b1, &b[np * b_dim1 + 1],
1418 ctrmm_("R", "L", "N", "N", m, l, &c_b1, &v[np * v_dim1 + 1], ldv, &
1419 work[work_offset], ldwork);
1421 for (j = 1; j <= i__1; ++j) {
1423 for (i__ = 1; i__ <= i__2; ++i__) {
1424 i__3 = i__ + (*n - *l + j) * b_dim1;
1425 i__4 = i__ + (*n - *l + j) * b_dim1;
1426 i__5 = i__ + j * work_dim1;
1427 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
1429 b[i__3].r = q__1.r, b[i__3].i = q__1.i;
1433 /* --------------------------------------------------------------------------- */
1435 } else if (row && backward && left) {
1437 /* --------------------------------------------------------------------------- */
1439 /* Let W = [ V I ] ( I is K-by-K, V is K-by-M ) */
1441 /* Form H C or H**H C where C = [ B ] (M-by-N) */
1442 /* [ A ] (K-by-N) */
1444 /* H = I - W**H T W or H**H = I - W**H T**H W */
1446 /* A = A - T (A + V B) or A = A - T**H (A + V B) */
1447 /* B = B - V**H T (A + V B) or B = B - V**H T**H (A + V B) */
1449 /* --------------------------------------------------------------------------- */
1453 mp = f2cmin(i__1,*m);
1456 kp = f2cmin(i__1,*k);
1459 for (j = 1; j <= i__1; ++j) {
1461 for (i__ = 1; i__ <= i__2; ++i__) {
1462 i__3 = *k - *l + i__ + j * work_dim1;
1463 i__4 = i__ + j * b_dim1;
1464 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
1467 ctrmm_("L", "U", "N", "N", l, n, &c_b1, &v[kp + v_dim1], ldv, &work[
1468 kp + work_dim1], ldwork);
1470 cgemm_("N", "N", l, n, &i__1, &c_b1, &v[kp + mp * v_dim1], ldv, &b[mp
1471 + b_dim1], ldb, &c_b1, &work[kp + work_dim1], ldwork);
1473 cgemm_("N", "N", &i__1, n, m, &c_b1, &v[v_offset], ldv, &b[b_offset],
1474 ldb, &c_b2, &work[work_offset], ldwork);
1477 for (j = 1; j <= i__1; ++j) {
1479 for (i__ = 1; i__ <= i__2; ++i__) {
1480 i__3 = i__ + j * work_dim1;
1481 i__4 = i__ + j * work_dim1;
1482 i__5 = i__ + j * a_dim1;
1483 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
1485 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1489 ctrmm_("L", "L ", trans, "N", k, n, &c_b1, &t[t_offset], ldt, &work[
1490 work_offset], ldwork);
1493 for (j = 1; j <= i__1; ++j) {
1495 for (i__ = 1; i__ <= i__2; ++i__) {
1496 i__3 = i__ + j * a_dim1;
1497 i__4 = i__ + j * a_dim1;
1498 i__5 = i__ + j * work_dim1;
1499 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
1501 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
1506 q__1.r = -1.f, q__1.i = 0.f;
1507 cgemm_("C", "N", &i__1, n, k, &q__1, &v[mp * v_dim1 + 1], ldv, &work[
1508 work_offset], ldwork, &c_b1, &b[mp + b_dim1], ldb);
1510 q__1.r = -1.f, q__1.i = 0.f;
1511 cgemm_("C", "N", l, n, &i__1, &q__1, &v[v_offset], ldv, &work[
1512 work_offset], ldwork, &c_b1, &b[b_offset], ldb);
1513 ctrmm_("L", "U", "C", "N", l, n, &c_b1, &v[kp + v_dim1], ldv, &work[
1514 kp + work_dim1], ldwork);
1516 for (j = 1; j <= i__1; ++j) {
1518 for (i__ = 1; i__ <= i__2; ++i__) {
1519 i__3 = i__ + j * b_dim1;
1520 i__4 = i__ + j * b_dim1;
1521 i__5 = *k - *l + i__ + j * work_dim1;
1522 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
1524 b[i__3].r = q__1.r, b[i__3].i = q__1.i;
1528 /* --------------------------------------------------------------------------- */
1530 } else if (row && backward && right) {
1532 /* --------------------------------------------------------------------------- */
1534 /* Let W = [ V I ] ( I is K-by-K, V is K-by-N ) */
1536 /* Form C H or C H**H where C = [ B A ] (A is M-by-K, B is M-by-N) */
1538 /* H = I - W**H T W or H**H = I - W**H T**H W */
1540 /* A = A - (A + B V**H) T or A = A - (A + B V**H) T**H */
1541 /* B = B - (A + B V**H) T V or B = B - (A + B V**H) T**H V */
1543 /* --------------------------------------------------------------------------- */
1547 np = f2cmin(i__1,*n);
1550 kp = f2cmin(i__1,*k);
1553 for (j = 1; j <= i__1; ++j) {
1555 for (i__ = 1; i__ <= i__2; ++i__) {
1556 i__3 = i__ + (*k - *l + j) * work_dim1;
1557 i__4 = i__ + j * b_dim1;
1558 work[i__3].r = b[i__4].r, work[i__3].i = b[i__4].i;
1561 ctrmm_("R", "U", "C", "N", m, l, &c_b1, &v[kp + v_dim1], ldv, &work[
1562 kp * work_dim1 + 1], ldwork);
1564 cgemm_("N", "C", m, l, &i__1, &c_b1, &b[np * b_dim1 + 1], ldb, &v[kp
1565 + np * v_dim1], ldv, &c_b1, &work[kp * work_dim1 + 1], ldwork);
1567 cgemm_("N", "C", m, &i__1, n, &c_b1, &b[b_offset], ldb, &v[v_offset],
1568 ldv, &c_b2, &work[work_offset], ldwork);
1571 for (j = 1; j <= i__1; ++j) {
1573 for (i__ = 1; i__ <= i__2; ++i__) {
1574 i__3 = i__ + j * work_dim1;
1575 i__4 = i__ + j * work_dim1;
1576 i__5 = i__ + j * a_dim1;
1577 q__1.r = work[i__4].r + a[i__5].r, q__1.i = work[i__4].i + a[
1579 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1583 ctrmm_("R", "L", trans, "N", m, k, &c_b1, &t[t_offset], ldt, &work[
1584 work_offset], ldwork);
1587 for (j = 1; j <= i__1; ++j) {
1589 for (i__ = 1; i__ <= i__2; ++i__) {
1590 i__3 = i__ + j * a_dim1;
1591 i__4 = i__ + j * a_dim1;
1592 i__5 = i__ + j * work_dim1;
1593 q__1.r = a[i__4].r - work[i__5].r, q__1.i = a[i__4].i - work[
1595 a[i__3].r = q__1.r, a[i__3].i = q__1.i;
1600 q__1.r = -1.f, q__1.i = 0.f;
1601 cgemm_("N", "N", m, &i__1, k, &q__1, &work[work_offset], ldwork, &v[
1602 np * v_dim1 + 1], ldv, &c_b1, &b[np * b_dim1 + 1], ldb);
1604 q__1.r = -1.f, q__1.i = 0.f;
1605 cgemm_("N", "N", m, l, &i__1, &q__1, &work[work_offset], ldwork, &v[
1606 v_offset], ldv, &c_b1, &b[b_offset], ldb);
1607 ctrmm_("R", "U", "N", "N", m, l, &c_b1, &v[kp + v_dim1], ldv, &work[
1608 kp * work_dim1 + 1], ldwork);
1610 for (j = 1; j <= i__1; ++j) {
1612 for (i__ = 1; i__ <= i__2; ++i__) {
1613 i__3 = i__ + j * b_dim1;
1614 i__4 = i__ + j * b_dim1;
1615 i__5 = i__ + (*k - *l + j) * work_dim1;
1616 q__1.r = b[i__4].r - work[i__5].r, q__1.i = b[i__4].i - work[
1618 b[i__3].r = q__1.r, b[i__3].i = q__1.i;