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]/Cd(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 doublecomplex c_b1 = {1.,0.};
516 static integer c__1 = 1;
518 /* > \brief \b ZSYTF2_ROOK computes the factorization of a complex symmetric indefinite matrix using the bound
519 ed Bunch-Kaufman ("rook") diagonal pivoting method (unblocked algorithm). */
521 /* =========== DOCUMENTATION =========== */
523 /* Online html documentation available at */
524 /* http://www.netlib.org/lapack/explore-html/ */
527 /* > Download ZSYTF2_ROOK + dependencies */
528 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsytf2_
531 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsytf2_
534 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsytf2_
542 /* SUBROUTINE ZSYTF2_ROOK( UPLO, N, A, LDA, IPIV, INFO ) */
545 /* INTEGER INFO, LDA, N */
546 /* INTEGER IPIV( * ) */
547 /* COMPLEX*16 A( LDA, * ) */
550 /* > \par Purpose: */
555 /* > ZSYTF2_ROOK computes the factorization of a complex symmetric matrix A */
556 /* > using the bounded Bunch-Kaufman ("rook") diagonal pivoting method: */
558 /* > A = U*D*U**T or A = L*D*L**T */
560 /* > where U (or L) is a product of permutation and unit upper (lower) */
561 /* > triangular matrices, U**T is the transpose of U, and D is symmetric and */
562 /* > block diagonal with 1-by-1 and 2-by-2 diagonal blocks. */
564 /* > This is the unblocked version of the algorithm, calling Level 2 BLAS. */
570 /* > \param[in] UPLO */
572 /* > UPLO is CHARACTER*1 */
573 /* > Specifies whether the upper or lower triangular part of the */
574 /* > symmetric matrix A is stored: */
575 /* > = 'U': Upper triangular */
576 /* > = 'L': Lower triangular */
582 /* > The order of the matrix A. N >= 0. */
585 /* > \param[in,out] A */
587 /* > A is COMPLEX*16 array, dimension (LDA,N) */
588 /* > On entry, the symmetric matrix A. If UPLO = 'U', the leading */
589 /* > n-by-n upper triangular part of A contains the upper */
590 /* > triangular part of the matrix A, and the strictly lower */
591 /* > triangular part of A is not referenced. If UPLO = 'L', the */
592 /* > leading n-by-n lower triangular part of A contains the lower */
593 /* > triangular part of the matrix A, and the strictly upper */
594 /* > triangular part of A is not referenced. */
596 /* > On exit, the block diagonal matrix D and the multipliers used */
597 /* > to obtain the factor U or L (see below for further details). */
600 /* > \param[in] LDA */
602 /* > LDA is INTEGER */
603 /* > The leading dimension of the array A. LDA >= f2cmax(1,N). */
606 /* > \param[out] IPIV */
608 /* > IPIV is INTEGER array, dimension (N) */
609 /* > Details of the interchanges and the block structure of D. */
611 /* > If UPLO = 'U': */
612 /* > If IPIV(k) > 0, then rows and columns k and IPIV(k) */
613 /* > were interchanged and D(k,k) is a 1-by-1 diagonal block. */
615 /* > If IPIV(k) < 0 and IPIV(k-1) < 0, then rows and */
616 /* > columns k and -IPIV(k) were interchanged and rows and */
617 /* > columns k-1 and -IPIV(k-1) were inerchaged, */
618 /* > D(k-1:k,k-1:k) is a 2-by-2 diagonal block. */
620 /* > If UPLO = 'L': */
621 /* > If IPIV(k) > 0, then rows and columns k and IPIV(k) */
622 /* > were interchanged and D(k,k) is a 1-by-1 diagonal block. */
624 /* > If IPIV(k) < 0 and IPIV(k+1) < 0, then rows and */
625 /* > columns k and -IPIV(k) were interchanged and rows and */
626 /* > columns k+1 and -IPIV(k+1) were inerchaged, */
627 /* > D(k:k+1,k:k+1) is a 2-by-2 diagonal block. */
630 /* > \param[out] INFO */
632 /* > INFO is INTEGER */
633 /* > = 0: successful exit */
634 /* > < 0: if INFO = -k, the k-th argument had an illegal value */
635 /* > > 0: if INFO = k, D(k,k) is exactly zero. The factorization */
636 /* > has been completed, but the block diagonal matrix D is */
637 /* > exactly singular, and division by zero will occur if it */
638 /* > is used to solve a system of equations. */
644 /* > \author Univ. of Tennessee */
645 /* > \author Univ. of California Berkeley */
646 /* > \author Univ. of Colorado Denver */
647 /* > \author NAG Ltd. */
649 /* > \date November 2013 */
651 /* > \ingroup complex16SYcomputational */
653 /* > \par Further Details: */
654 /* ===================== */
658 /* > If UPLO = 'U', then A = U*D*U**T, where */
659 /* > U = P(n)*U(n)* ... *P(k)U(k)* ..., */
660 /* > i.e., U is a product of terms P(k)*U(k), where k decreases from n to */
661 /* > 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 */
662 /* > and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as */
663 /* > defined by IPIV(k), and U(k) is a unit upper triangular matrix, such */
664 /* > that if the diagonal block D(k) is of order s (s = 1 or 2), then */
666 /* > ( I v 0 ) k-s */
667 /* > U(k) = ( 0 I 0 ) s */
668 /* > ( 0 0 I ) n-k */
671 /* > If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). */
672 /* > If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), */
673 /* > and A(k,k), and v overwrites A(1:k-2,k-1:k). */
675 /* > If UPLO = 'L', then A = L*D*L**T, where */
676 /* > L = P(1)*L(1)* ... *P(k)*L(k)* ..., */
677 /* > i.e., L is a product of terms P(k)*L(k), where k increases from 1 to */
678 /* > n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 */
679 /* > and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as */
680 /* > defined by IPIV(k), and L(k) is a unit lower triangular matrix, such */
681 /* > that if the diagonal block D(k) is of order s (s = 1 or 2), then */
683 /* > ( I 0 0 ) k-1 */
684 /* > L(k) = ( 0 I 0 ) s */
685 /* > ( 0 v I ) n-k-s+1 */
686 /* > k-1 s n-k-s+1 */
688 /* > If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). */
689 /* > If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), */
690 /* > and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1). */
693 /* > \par Contributors: */
694 /* ================== */
698 /* > November 2013, Igor Kozachenko, */
699 /* > Computer Science Division, */
700 /* > University of California, Berkeley */
702 /* > September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, */
703 /* > School of Mathematics, */
704 /* > University of Manchester */
706 /* > 01-01-96 - Based on modifications by */
707 /* > J. Lewis, Boeing Computer Services Company */
708 /* > A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville abd , USA */
711 /* ===================================================================== */
712 /* Subroutine */ int zsytf2_rook_(char *uplo, integer *n, doublecomplex *a,
713 integer *lda, integer *ipiv, integer *info)
715 /* System generated locals */
716 integer a_dim1, a_offset, i__1, i__2, i__3, i__4;
717 doublereal d__1, d__2;
718 doublecomplex z__1, z__2, z__3, z__4, z__5, z__6;
720 /* Local variables */
723 extern /* Subroutine */ int zsyr_(char *, integer *, doublecomplex *,
724 doublecomplex *, integer *, doublecomplex *, integer *);
725 integer i__, j, k, p;
728 extern logical lsame_(char *, char *);
729 doublereal dtemp, sfmin;
730 extern /* Subroutine */ int zscal_(integer *, doublecomplex *,
731 doublecomplex *, integer *);
732 integer itemp, kstep;
734 extern /* Subroutine */ int zswap_(integer *, doublecomplex *, integer *,
735 doublecomplex *, integer *);
736 doublecomplex d11, d12, d21, d22;
738 extern doublereal dlamch_(char *);
742 extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen);
744 extern integer izamax_(integer *, doublecomplex *, integer *);
746 doublecomplex wkm1, wkp1;
749 /* -- LAPACK computational routine (version 3.5.0) -- */
750 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
751 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
755 /* ===================================================================== */
758 /* Test the input parameters. */
760 /* Parameter adjustments */
762 a_offset = 1 + a_dim1 * 1;
768 upper = lsame_(uplo, "U");
769 if (! upper && ! lsame_(uplo, "L")) {
773 } else if (*lda < f2cmax(1,*n)) {
778 xerbla_("ZSYTF2_ROOK", &i__1, (ftnlen)11);
782 /* Initialize ALPHA for use in choosing pivot block size. */
784 alpha = (sqrt(17.) + 1.) / 8.;
786 /* Compute machine safe minimum */
788 sfmin = dlamch_("S");
792 /* Factorize A as U*D*U**T using the upper triangle of A */
794 /* K is the main loop index, decreasing from N to 1 in steps of */
800 /* If K < 1, exit from loop */
808 /* Determine rows and columns to be interchanged and whether */
809 /* a 1-by-1 or 2-by-2 pivot block will be used */
811 i__1 = k + k * a_dim1;
812 absakk = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[k + k *
813 a_dim1]), abs(d__2));
815 /* IMAX is the row-index of the largest off-diagonal element in */
816 /* column K, and COLMAX is its absolute value. */
817 /* Determine both COLMAX and IMAX. */
821 imax = izamax_(&i__1, &a[k * a_dim1 + 1], &c__1);
822 i__1 = imax + k * a_dim1;
823 colmax = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[imax +
824 k * a_dim1]), abs(d__2));
829 if (f2cmax(absakk,colmax) == 0.) {
831 /* Column K is zero or underflow: set INFO and continue */
839 /* Test for interchange */
841 /* Equivalent to testing for (used to handle NaN and Inf) */
842 /* ABSAKK.GE.ALPHA*COLMAX */
844 if (! (absakk < alpha * colmax)) {
846 /* no interchange, */
847 /* use 1-by-1 pivot block */
854 /* Loop until pivot found */
858 /* Begin pivot search loop body */
860 /* JMAX is the column-index of the largest off-diagonal */
861 /* element in row IMAX, and ROWMAX is its absolute value. */
862 /* Determine both ROWMAX and JMAX. */
866 jmax = imax + izamax_(&i__1, &a[imax + (imax + 1) *
868 i__1 = imax + jmax * a_dim1;
869 rowmax = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&
870 a[imax + jmax * a_dim1]), abs(d__2));
877 itemp = izamax_(&i__1, &a[imax * a_dim1 + 1], &c__1);
878 i__1 = itemp + imax * a_dim1;
879 dtemp = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[
880 itemp + imax * a_dim1]), abs(d__2));
881 if (dtemp > rowmax) {
887 /* Equivalent to testing for (used to handle NaN and Inf) */
888 /* CABS1( A( IMAX, IMAX ) ).GE.ALPHA*ROWMAX */
890 i__1 = imax + imax * a_dim1;
891 if (! ((d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[imax
892 + imax * a_dim1]), abs(d__2)) < alpha * rowmax)) {
894 /* interchange rows and columns K and IMAX, */
895 /* use 1-by-1 pivot block */
900 /* Equivalent to testing for ROWMAX .EQ. COLMAX, */
901 /* used to handle NaN and Inf */
903 } else if (p == jmax || rowmax <= colmax) {
905 /* interchange rows and columns K+1 and IMAX, */
906 /* use 2-by-2 pivot block */
913 /* Pivot NOT found, set variables and repeat */
920 /* End pivot search loop body */
928 /* Swap TWO rows and TWO columns */
932 if (kstep == 2 && p != k) {
934 /* Interchange rows and column K and P in the leading */
935 /* submatrix A(1:k,1:k) if we have a 2-by-2 pivot */
939 zswap_(&i__1, &a[k * a_dim1 + 1], &c__1, &a[p * a_dim1 +
944 zswap_(&i__1, &a[p + 1 + k * a_dim1], &c__1, &a[p + (p +
947 i__1 = k + k * a_dim1;
948 t.r = a[i__1].r, t.i = a[i__1].i;
949 i__1 = k + k * a_dim1;
950 i__2 = p + p * a_dim1;
951 a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
952 i__1 = p + p * a_dim1;
953 a[i__1].r = t.r, a[i__1].i = t.i;
961 /* Interchange rows and columns KK and KP in the leading */
962 /* submatrix A(1:k,1:k) */
966 zswap_(&i__1, &a[kk * a_dim1 + 1], &c__1, &a[kp * a_dim1
969 if (kk > 1 && kp < kk - 1) {
971 zswap_(&i__1, &a[kp + 1 + kk * a_dim1], &c__1, &a[kp + (
972 kp + 1) * a_dim1], lda);
974 i__1 = kk + kk * a_dim1;
975 t.r = a[i__1].r, t.i = a[i__1].i;
976 i__1 = kk + kk * a_dim1;
977 i__2 = kp + kp * a_dim1;
978 a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
979 i__1 = kp + kp * a_dim1;
980 a[i__1].r = t.r, a[i__1].i = t.i;
982 i__1 = k - 1 + k * a_dim1;
983 t.r = a[i__1].r, t.i = a[i__1].i;
984 i__1 = k - 1 + k * a_dim1;
985 i__2 = kp + k * a_dim1;
986 a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
987 i__1 = kp + k * a_dim1;
988 a[i__1].r = t.r, a[i__1].i = t.i;
992 /* Update the leading submatrix */
996 /* 1-by-1 pivot block D(k): column k now holds */
998 /* W(k) = U(k)*D(k) */
1000 /* where U(k) is the k-th column of U */
1004 /* Perform a rank-1 update of A(1:k-1,1:k-1) and */
1005 /* store U(k) in column k */
1007 i__1 = k + k * a_dim1;
1008 if ((d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[k +
1009 k * a_dim1]), abs(d__2)) >= sfmin) {
1011 /* Perform a rank-1 update of A(1:k-1,1:k-1) as */
1012 /* A := A - U(k)*D(k)*U(k)**T */
1013 /* = A - W(k)*1/D(k)*W(k)**T */
1015 z_div(&z__1, &c_b1, &a[k + k * a_dim1]);
1016 d11.r = z__1.r, d11.i = z__1.i;
1018 z__1.r = -d11.r, z__1.i = -d11.i;
1019 zsyr_(uplo, &i__1, &z__1, &a[k * a_dim1 + 1], &c__1, &
1022 /* Store U(k) in column k */
1025 zscal_(&i__1, &d11, &a[k * a_dim1 + 1], &c__1);
1028 /* Store L(k) in column K */
1030 i__1 = k + k * a_dim1;
1031 d11.r = a[i__1].r, d11.i = a[i__1].i;
1033 for (ii = 1; ii <= i__1; ++ii) {
1034 i__2 = ii + k * a_dim1;
1035 z_div(&z__1, &a[ii + k * a_dim1], &d11);
1036 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
1040 /* Perform a rank-1 update of A(k+1:n,k+1:n) as */
1041 /* A := A - U(k)*D(k)*U(k)**T */
1042 /* = A - W(k)*(1/D(k))*W(k)**T */
1043 /* = A - (W(k)/D(k))*(D(k))*(W(k)/D(K))**T */
1046 z__1.r = -d11.r, z__1.i = -d11.i;
1047 zsyr_(uplo, &i__1, &z__1, &a[k * a_dim1 + 1], &c__1, &
1054 /* 2-by-2 pivot block D(k): columns k and k-1 now hold */
1056 /* ( W(k-1) W(k) ) = ( U(k-1) U(k) )*D(k) */
1058 /* where U(k) and U(k-1) are the k-th and (k-1)-th columns */
1061 /* Perform a rank-2 update of A(1:k-2,1:k-2) as */
1063 /* A := A - ( U(k-1) U(k) )*D(k)*( U(k-1) U(k) )**T */
1064 /* = A - ( ( A(k-1)A(k) )*inv(D(k)) ) * ( A(k-1)A(k) )**T */
1066 /* and store L(k) and L(k+1) in columns k and k+1 */
1070 i__1 = k - 1 + k * a_dim1;
1071 d12.r = a[i__1].r, d12.i = a[i__1].i;
1072 z_div(&z__1, &a[k - 1 + (k - 1) * a_dim1], &d12);
1073 d22.r = z__1.r, d22.i = z__1.i;
1074 z_div(&z__1, &a[k + k * a_dim1], &d12);
1075 d11.r = z__1.r, d11.i = z__1.i;
1076 z__3.r = d11.r * d22.r - d11.i * d22.i, z__3.i = d11.r *
1077 d22.i + d11.i * d22.r;
1078 z__2.r = z__3.r - 1., z__2.i = z__3.i + 0.;
1079 z_div(&z__1, &c_b1, &z__2);
1080 t.r = z__1.r, t.i = z__1.i;
1082 for (j = k - 2; j >= 1; --j) {
1084 i__1 = j + (k - 1) * a_dim1;
1085 z__3.r = d11.r * a[i__1].r - d11.i * a[i__1].i,
1086 z__3.i = d11.r * a[i__1].i + d11.i * a[i__1]
1088 i__2 = j + k * a_dim1;
1089 z__2.r = z__3.r - a[i__2].r, z__2.i = z__3.i - a[i__2]
1091 z__1.r = t.r * z__2.r - t.i * z__2.i, z__1.i = t.r *
1092 z__2.i + t.i * z__2.r;
1093 wkm1.r = z__1.r, wkm1.i = z__1.i;
1094 i__1 = j + k * a_dim1;
1095 z__3.r = d22.r * a[i__1].r - d22.i * a[i__1].i,
1096 z__3.i = d22.r * a[i__1].i + d22.i * a[i__1]
1098 i__2 = j + (k - 1) * a_dim1;
1099 z__2.r = z__3.r - a[i__2].r, z__2.i = z__3.i - a[i__2]
1101 z__1.r = t.r * z__2.r - t.i * z__2.i, z__1.i = t.r *
1102 z__2.i + t.i * z__2.r;
1103 wk.r = z__1.r, wk.i = z__1.i;
1105 for (i__ = j; i__ >= 1; --i__) {
1106 i__1 = i__ + j * a_dim1;
1107 i__2 = i__ + j * a_dim1;
1108 z_div(&z__4, &a[i__ + k * a_dim1], &d12);
1109 z__3.r = z__4.r * wk.r - z__4.i * wk.i, z__3.i =
1110 z__4.r * wk.i + z__4.i * wk.r;
1111 z__2.r = a[i__2].r - z__3.r, z__2.i = a[i__2].i -
1113 z_div(&z__6, &a[i__ + (k - 1) * a_dim1], &d12);
1114 z__5.r = z__6.r * wkm1.r - z__6.i * wkm1.i,
1115 z__5.i = z__6.r * wkm1.i + z__6.i *
1117 z__1.r = z__2.r - z__5.r, z__1.i = z__2.i -
1119 a[i__1].r = z__1.r, a[i__1].i = z__1.i;
1123 /* Store U(k) and U(k-1) in cols k and k-1 for row J */
1125 i__1 = j + k * a_dim1;
1126 z_div(&z__1, &wk, &d12);
1127 a[i__1].r = z__1.r, a[i__1].i = z__1.i;
1128 i__1 = j + (k - 1) * a_dim1;
1129 z_div(&z__1, &wkm1, &d12);
1130 a[i__1].r = z__1.r, a[i__1].i = z__1.i;
1140 /* Store details of the interchanges in IPIV */
1149 /* Decrease K and return to the start of the main loop */
1156 /* Factorize A as L*D*L**T using the lower triangle of A */
1158 /* K is the main loop index, increasing from 1 to N in steps of */
1164 /* If K > N, exit from loop */
1172 /* Determine rows and columns to be interchanged and whether */
1173 /* a 1-by-1 or 2-by-2 pivot block will be used */
1175 i__1 = k + k * a_dim1;
1176 absakk = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[k + k *
1177 a_dim1]), abs(d__2));
1179 /* IMAX is the row-index of the largest off-diagonal element in */
1180 /* column K, and COLMAX is its absolute value. */
1181 /* Determine both COLMAX and IMAX. */
1185 imax = k + izamax_(&i__1, &a[k + 1 + k * a_dim1], &c__1);
1186 i__1 = imax + k * a_dim1;
1187 colmax = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[imax +
1188 k * a_dim1]), abs(d__2));
1193 if (f2cmax(absakk,colmax) == 0.) {
1195 /* Column K is zero or underflow: set INFO and continue */
1203 /* Test for interchange */
1205 /* Equivalent to testing for (used to handle NaN and Inf) */
1206 /* ABSAKK.GE.ALPHA*COLMAX */
1208 if (! (absakk < alpha * colmax)) {
1210 /* no interchange, use 1-by-1 pivot block */
1217 /* Loop until pivot found */
1221 /* Begin pivot search loop body */
1223 /* JMAX is the column-index of the largest off-diagonal */
1224 /* element in row IMAX, and ROWMAX is its absolute value. */
1225 /* Determine both ROWMAX and JMAX. */
1229 jmax = k - 1 + izamax_(&i__1, &a[imax + k * a_dim1], lda);
1230 i__1 = imax + jmax * a_dim1;
1231 rowmax = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&
1232 a[imax + jmax * a_dim1]), abs(d__2));
1239 itemp = imax + izamax_(&i__1, &a[imax + 1 + imax * a_dim1]
1241 i__1 = itemp + imax * a_dim1;
1242 dtemp = (d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[
1243 itemp + imax * a_dim1]), abs(d__2));
1244 if (dtemp > rowmax) {
1250 /* Equivalent to testing for (used to handle NaN and Inf) */
1251 /* CABS1( A( IMAX, IMAX ) ).GE.ALPHA*ROWMAX */
1253 i__1 = imax + imax * a_dim1;
1254 if (! ((d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[imax
1255 + imax * a_dim1]), abs(d__2)) < alpha * rowmax)) {
1257 /* interchange rows and columns K and IMAX, */
1258 /* use 1-by-1 pivot block */
1263 /* Equivalent to testing for ROWMAX .EQ. COLMAX, */
1264 /* used to handle NaN and Inf */
1266 } else if (p == jmax || rowmax <= colmax) {
1268 /* interchange rows and columns K+1 and IMAX, */
1269 /* use 2-by-2 pivot block */
1276 /* Pivot NOT found, set variables and repeat */
1283 /* End pivot search loop body */
1291 /* Swap TWO rows and TWO columns */
1295 if (kstep == 2 && p != k) {
1297 /* Interchange rows and column K and P in the trailing */
1298 /* submatrix A(k:n,k:n) if we have a 2-by-2 pivot */
1302 zswap_(&i__1, &a[p + 1 + k * a_dim1], &c__1, &a[p + 1 + p
1307 zswap_(&i__1, &a[k + 1 + k * a_dim1], &c__1, &a[p + (k +
1310 i__1 = k + k * a_dim1;
1311 t.r = a[i__1].r, t.i = a[i__1].i;
1312 i__1 = k + k * a_dim1;
1313 i__2 = p + p * a_dim1;
1314 a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
1315 i__1 = p + p * a_dim1;
1316 a[i__1].r = t.r, a[i__1].i = t.i;
1324 /* Interchange rows and columns KK and KP in the trailing */
1325 /* submatrix A(k:n,k:n) */
1329 zswap_(&i__1, &a[kp + 1 + kk * a_dim1], &c__1, &a[kp + 1
1330 + kp * a_dim1], &c__1);
1332 if (kk < *n && kp > kk + 1) {
1334 zswap_(&i__1, &a[kk + 1 + kk * a_dim1], &c__1, &a[kp + (
1335 kk + 1) * a_dim1], lda);
1337 i__1 = kk + kk * a_dim1;
1338 t.r = a[i__1].r, t.i = a[i__1].i;
1339 i__1 = kk + kk * a_dim1;
1340 i__2 = kp + kp * a_dim1;
1341 a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
1342 i__1 = kp + kp * a_dim1;
1343 a[i__1].r = t.r, a[i__1].i = t.i;
1345 i__1 = k + 1 + k * a_dim1;
1346 t.r = a[i__1].r, t.i = a[i__1].i;
1347 i__1 = k + 1 + k * a_dim1;
1348 i__2 = kp + k * a_dim1;
1349 a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
1350 i__1 = kp + k * a_dim1;
1351 a[i__1].r = t.r, a[i__1].i = t.i;
1355 /* Update the trailing submatrix */
1359 /* 1-by-1 pivot block D(k): column k now holds */
1361 /* W(k) = L(k)*D(k) */
1363 /* where L(k) is the k-th column of L */
1367 /* Perform a rank-1 update of A(k+1:n,k+1:n) and */
1368 /* store L(k) in column k */
1370 i__1 = k + k * a_dim1;
1371 if ((d__1 = a[i__1].r, abs(d__1)) + (d__2 = d_imag(&a[k +
1372 k * a_dim1]), abs(d__2)) >= sfmin) {
1374 /* Perform a rank-1 update of A(k+1:n,k+1:n) as */
1375 /* A := A - L(k)*D(k)*L(k)**T */
1376 /* = A - W(k)*(1/D(k))*W(k)**T */
1378 z_div(&z__1, &c_b1, &a[k + k * a_dim1]);
1379 d11.r = z__1.r, d11.i = z__1.i;
1381 z__1.r = -d11.r, z__1.i = -d11.i;
1382 zsyr_(uplo, &i__1, &z__1, &a[k + 1 + k * a_dim1], &
1383 c__1, &a[k + 1 + (k + 1) * a_dim1], lda);
1385 /* Store L(k) in column k */
1388 zscal_(&i__1, &d11, &a[k + 1 + k * a_dim1], &c__1);
1391 /* Store L(k) in column k */
1393 i__1 = k + k * a_dim1;
1394 d11.r = a[i__1].r, d11.i = a[i__1].i;
1396 for (ii = k + 1; ii <= i__1; ++ii) {
1397 i__2 = ii + k * a_dim1;
1398 z_div(&z__1, &a[ii + k * a_dim1], &d11);
1399 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
1403 /* Perform a rank-1 update of A(k+1:n,k+1:n) as */
1404 /* A := A - L(k)*D(k)*L(k)**T */
1405 /* = A - W(k)*(1/D(k))*W(k)**T */
1406 /* = A - (W(k)/D(k))*(D(k))*(W(k)/D(K))**T */
1409 z__1.r = -d11.r, z__1.i = -d11.i;
1410 zsyr_(uplo, &i__1, &z__1, &a[k + 1 + k * a_dim1], &
1411 c__1, &a[k + 1 + (k + 1) * a_dim1], lda);
1417 /* 2-by-2 pivot block D(k): columns k and k+1 now hold */
1419 /* ( W(k) W(k+1) ) = ( L(k) L(k+1) )*D(k) */
1421 /* where L(k) and L(k+1) are the k-th and (k+1)-th columns */
1425 /* Perform a rank-2 update of A(k+2:n,k+2:n) as */
1427 /* A := A - ( L(k) L(k+1) ) * D(k) * ( L(k) L(k+1) )**T */
1428 /* = A - ( ( A(k)A(k+1) )*inv(D(k) ) * ( A(k)A(k+1) )**T */
1430 /* and store L(k) and L(k+1) in columns k and k+1 */
1434 i__1 = k + 1 + k * a_dim1;
1435 d21.r = a[i__1].r, d21.i = a[i__1].i;
1436 z_div(&z__1, &a[k + 1 + (k + 1) * a_dim1], &d21);
1437 d11.r = z__1.r, d11.i = z__1.i;
1438 z_div(&z__1, &a[k + k * a_dim1], &d21);
1439 d22.r = z__1.r, d22.i = z__1.i;
1440 z__3.r = d11.r * d22.r - d11.i * d22.i, z__3.i = d11.r *
1441 d22.i + d11.i * d22.r;
1442 z__2.r = z__3.r - 1., z__2.i = z__3.i + 0.;
1443 z_div(&z__1, &c_b1, &z__2);
1444 t.r = z__1.r, t.i = z__1.i;
1447 for (j = k + 2; j <= i__1; ++j) {
1449 /* Compute D21 * ( W(k)W(k+1) ) * inv(D(k)) for row J */
1451 i__2 = j + k * a_dim1;
1452 z__3.r = d11.r * a[i__2].r - d11.i * a[i__2].i,
1453 z__3.i = d11.r * a[i__2].i + d11.i * a[i__2]
1455 i__3 = j + (k + 1) * a_dim1;
1456 z__2.r = z__3.r - a[i__3].r, z__2.i = z__3.i - a[i__3]
1458 z__1.r = t.r * z__2.r - t.i * z__2.i, z__1.i = t.r *
1459 z__2.i + t.i * z__2.r;
1460 wk.r = z__1.r, wk.i = z__1.i;
1461 i__2 = j + (k + 1) * a_dim1;
1462 z__3.r = d22.r * a[i__2].r - d22.i * a[i__2].i,
1463 z__3.i = d22.r * a[i__2].i + d22.i * a[i__2]
1465 i__3 = j + k * a_dim1;
1466 z__2.r = z__3.r - a[i__3].r, z__2.i = z__3.i - a[i__3]
1468 z__1.r = t.r * z__2.r - t.i * z__2.i, z__1.i = t.r *
1469 z__2.i + t.i * z__2.r;
1470 wkp1.r = z__1.r, wkp1.i = z__1.i;
1472 /* Perform a rank-2 update of A(k+2:n,k+2:n) */
1475 for (i__ = j; i__ <= i__2; ++i__) {
1476 i__3 = i__ + j * a_dim1;
1477 i__4 = i__ + j * a_dim1;
1478 z_div(&z__4, &a[i__ + k * a_dim1], &d21);
1479 z__3.r = z__4.r * wk.r - z__4.i * wk.i, z__3.i =
1480 z__4.r * wk.i + z__4.i * wk.r;
1481 z__2.r = a[i__4].r - z__3.r, z__2.i = a[i__4].i -
1483 z_div(&z__6, &a[i__ + (k + 1) * a_dim1], &d21);
1484 z__5.r = z__6.r * wkp1.r - z__6.i * wkp1.i,
1485 z__5.i = z__6.r * wkp1.i + z__6.i *
1487 z__1.r = z__2.r - z__5.r, z__1.i = z__2.i -
1489 a[i__3].r = z__1.r, a[i__3].i = z__1.i;
1493 /* Store L(k) and L(k+1) in cols k and k+1 for row J */
1495 i__2 = j + k * a_dim1;
1496 z_div(&z__1, &wk, &d21);
1497 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
1498 i__2 = j + (k + 1) * a_dim1;
1499 z_div(&z__1, &wkp1, &d21);
1500 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
1510 /* Store details of the interchanges in IPIV */
1519 /* Increase K and return to the start of the main loop */
1530 /* End of ZSYTF2_ROOK */
1532 } /* zsytf2_rook__ */