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 integer c__1 = 1;
517 /* > \brief \b CLANHF returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the ele
518 ment of largest absolute value of a Hermitian matrix in RFP format. */
520 /* =========== DOCUMENTATION =========== */
522 /* Online html documentation available at */
523 /* http://www.netlib.org/lapack/explore-html/ */
526 /* > Download CLANHF + dependencies */
527 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clanhf.
530 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clanhf.
533 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clanhf.
541 /* REAL FUNCTION CLANHF( NORM, TRANSR, UPLO, N, A, WORK ) */
543 /* CHARACTER NORM, TRANSR, UPLO */
545 /* REAL WORK( 0: * ) */
546 /* COMPLEX A( 0: * ) */
549 /* > \par Purpose: */
554 /* > CLANHF returns the value of the one norm, or the Frobenius norm, or */
555 /* > the infinity norm, or the element of largest absolute value of a */
556 /* > complex Hermitian matrix A in RFP format. */
559 /* > \return CLANHF */
562 /* > CLANHF = ( f2cmax(abs(A(i,j))), NORM = 'M' or 'm' */
564 /* > ( norm1(A), NORM = '1', 'O' or 'o' */
566 /* > ( normI(A), NORM = 'I' or 'i' */
568 /* > ( normF(A), NORM = 'F', 'f', 'E' or 'e' */
570 /* > where norm1 denotes the one norm of a matrix (maximum column sum), */
571 /* > normI denotes the infinity norm of a matrix (maximum row sum) and */
572 /* > normF denotes the Frobenius norm of a matrix (square root of sum of */
573 /* > squares). Note that f2cmax(abs(A(i,j))) is not a matrix norm. */
579 /* > \param[in] NORM */
581 /* > NORM is CHARACTER */
582 /* > Specifies the value to be returned in CLANHF as described */
586 /* > \param[in] TRANSR */
588 /* > TRANSR is CHARACTER */
589 /* > Specifies whether the RFP format of A is normal or */
590 /* > conjugate-transposed format. */
591 /* > = 'N': RFP format is Normal */
592 /* > = 'C': RFP format is Conjugate-transposed */
595 /* > \param[in] UPLO */
597 /* > UPLO is CHARACTER */
598 /* > On entry, UPLO specifies whether the RFP matrix A came from */
599 /* > an upper or lower triangular matrix as follows: */
601 /* > UPLO = 'U' or 'u' RFP A came from an upper triangular */
604 /* > UPLO = 'L' or 'l' RFP A came from a lower triangular */
611 /* > The order of the matrix A. N >= 0. When N = 0, CLANHF is */
617 /* > A is COMPLEX array, dimension ( N*(N+1)/2 ); */
618 /* > On entry, the matrix A in RFP Format. */
619 /* > RFP Format is described by TRANSR, UPLO and N as follows: */
620 /* > If TRANSR='N' then RFP A is (0:N,0:K-1) when N is even; */
621 /* > K=N/2. RFP A is (0:N-1,0:K) when N is odd; K=N/2. If */
622 /* > TRANSR = 'C' then RFP is the Conjugate-transpose of RFP A */
623 /* > as defined when TRANSR = 'N'. The contents of RFP A are */
624 /* > defined by UPLO as follows: If UPLO = 'U' the RFP A */
625 /* > contains the ( N*(N+1)/2 ) elements of upper packed A */
626 /* > either in normal or conjugate-transpose Format. If */
627 /* > UPLO = 'L' the RFP A contains the ( N*(N+1) /2 ) elements */
628 /* > of lower packed A either in normal or conjugate-transpose */
629 /* > Format. The LDA of RFP A is (N+1)/2 when TRANSR = 'C'. When */
630 /* > TRANSR is 'N' the LDA is N+1 when N is even and is N when */
631 /* > is odd. See the Note below for more details. */
632 /* > Unchanged on exit. */
635 /* > \param[out] WORK */
637 /* > WORK is REAL array, dimension (LWORK), */
638 /* > where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise, */
639 /* > WORK is not referenced. */
645 /* > \author Univ. of Tennessee */
646 /* > \author Univ. of California Berkeley */
647 /* > \author Univ. of Colorado Denver */
648 /* > \author NAG Ltd. */
650 /* > \date December 2016 */
652 /* > \ingroup complexOTHERcomputational */
654 /* > \par Further Details: */
655 /* ===================== */
659 /* > We first consider Standard Packed Format when N is even. */
660 /* > We give an example where N = 6. */
662 /* > AP is Upper AP is Lower */
664 /* > 00 01 02 03 04 05 00 */
665 /* > 11 12 13 14 15 10 11 */
666 /* > 22 23 24 25 20 21 22 */
667 /* > 33 34 35 30 31 32 33 */
668 /* > 44 45 40 41 42 43 44 */
669 /* > 55 50 51 52 53 54 55 */
672 /* > Let TRANSR = 'N'. RFP holds AP as follows: */
673 /* > For UPLO = 'U' the upper trapezoid A(0:5,0:2) consists of the last */
674 /* > three columns of AP upper. The lower triangle A(4:6,0:2) consists of */
675 /* > conjugate-transpose of the first three columns of AP upper. */
676 /* > For UPLO = 'L' the lower trapezoid A(1:6,0:2) consists of the first */
677 /* > three columns of AP lower. The upper triangle A(0:2,0:2) consists of */
678 /* > conjugate-transpose of the last three columns of AP lower. */
679 /* > To denote conjugate we place -- above the element. This covers the */
680 /* > case N even and TRANSR = 'N'. */
685 /* > 03 04 05 33 43 53 */
687 /* > 13 14 15 00 44 54 */
689 /* > 23 24 25 10 11 55 */
691 /* > 33 34 35 20 21 22 */
693 /* > 00 44 45 30 31 32 */
695 /* > 01 11 55 40 41 42 */
697 /* > 02 12 22 50 51 52 */
699 /* > Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate- */
700 /* > transpose of RFP A above. One therefore gets: */
705 /* > -- -- -- -- -- -- -- -- -- -- */
706 /* > 03 13 23 33 00 01 02 33 00 10 20 30 40 50 */
707 /* > -- -- -- -- -- -- -- -- -- -- */
708 /* > 04 14 24 34 44 11 12 43 44 11 21 31 41 51 */
709 /* > -- -- -- -- -- -- -- -- -- -- */
710 /* > 05 15 25 35 45 55 22 53 54 55 22 32 42 52 */
713 /* > We next consider Standard Packed Format when N is odd. */
714 /* > We give an example where N = 5. */
716 /* > AP is Upper AP is Lower */
718 /* > 00 01 02 03 04 00 */
719 /* > 11 12 13 14 10 11 */
720 /* > 22 23 24 20 21 22 */
721 /* > 33 34 30 31 32 33 */
722 /* > 44 40 41 42 43 44 */
725 /* > Let TRANSR = 'N'. RFP holds AP as follows: */
726 /* > For UPLO = 'U' the upper trapezoid A(0:4,0:2) consists of the last */
727 /* > three columns of AP upper. The lower triangle A(3:4,0:1) consists of */
728 /* > conjugate-transpose of the first two columns of AP upper. */
729 /* > For UPLO = 'L' the lower trapezoid A(0:4,0:2) consists of the first */
730 /* > three columns of AP lower. The upper triangle A(0:1,1:2) consists of */
731 /* > conjugate-transpose of the last two columns of AP lower. */
732 /* > To denote conjugate we place -- above the element. This covers the */
733 /* > case N odd and TRANSR = 'N'. */
738 /* > 02 03 04 00 33 43 */
740 /* > 12 13 14 10 11 44 */
742 /* > 22 23 24 20 21 22 */
744 /* > 00 33 34 30 31 32 */
746 /* > 01 11 44 40 41 42 */
748 /* > Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate- */
749 /* > transpose of RFP A above. One therefore gets: */
754 /* > -- -- -- -- -- -- -- -- -- */
755 /* > 02 12 22 00 01 00 10 20 30 40 50 */
756 /* > -- -- -- -- -- -- -- -- -- */
757 /* > 03 13 23 33 11 33 11 21 31 41 51 */
758 /* > -- -- -- -- -- -- -- -- -- */
759 /* > 04 14 24 34 44 43 44 22 32 42 52 */
762 /* ===================================================================== */
763 real clanhf_(char *norm, char *transr, char *uplo, integer *n, complex *a,
766 /* System generated locals */
770 /* Local variables */
772 integer i__, j, k, l;
774 extern logical lsame_(char *, char *);
778 extern /* Subroutine */ int classq_(integer *, complex *, integer *, real
780 extern logical sisnan_(real *);
781 integer lda, ifm, noe, ilu;
784 /* -- LAPACK computational routine (version 3.7.0) -- */
785 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
786 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
790 /* ===================================================================== */
796 } else if (*n == 1) {
797 ret_val = (r__1 = a[0].r, abs(r__1));
801 /* set noe = 1 if n is odd. if n is even set noe=0 */
808 /* set ifm = 0 when form='C' or 'c' and 1 otherwise */
811 if (lsame_(transr, "C")) {
815 /* set ilu = 0 when uplo='U or 'u' and 1 otherwise */
818 if (lsame_(uplo, "U")) {
822 /* set lda = (n+1)/2 when ifm = 0 */
823 /* set lda = n when ifm = 1 and noe = 1 */
824 /* set lda = n+1 when ifm = 1 and noe = 0 */
838 if (lsame_(norm, "M")) {
840 /* Find f2cmax(abs(A(i,j))). */
845 /* n is odd & n = k + k - 1 */
853 temp = (r__1 = a[i__1].r, abs(r__1));
854 if (value < temp || sisnan_(&temp)) {
858 for (i__ = 1; i__ <= i__1; ++i__) {
859 temp = c_abs(&a[i__ + j * lda]);
860 if (value < temp || sisnan_(&temp)) {
865 for (j = 1; j <= i__1; ++j) {
867 for (i__ = 0; i__ <= i__2; ++i__) {
868 temp = c_abs(&a[i__ + j * lda]);
869 if (value < temp || sisnan_(&temp)) {
875 i__2 = i__ + j * lda;
876 temp = (r__1 = a[i__2].r, abs(r__1));
877 if (value < temp || sisnan_(&temp)) {
882 i__2 = i__ + j * lda;
883 temp = (r__1 = a[i__2].r, abs(r__1));
884 if (value < temp || sisnan_(&temp)) {
888 for (i__ = j + 1; i__ <= i__2; ++i__) {
889 temp = c_abs(&a[i__ + j * lda]);
890 if (value < temp || sisnan_(&temp)) {
898 for (j = 0; j <= i__1; ++j) {
900 for (i__ = 0; i__ <= i__2; ++i__) {
901 temp = c_abs(&a[i__ + j * lda]);
902 if (value < temp || sisnan_(&temp)) {
908 i__2 = i__ + j * lda;
909 temp = (r__1 = a[i__2].r, abs(r__1));
910 if (value < temp || sisnan_(&temp)) {
914 /* =k+j; i -> U(j,j) */
915 i__2 = i__ + j * lda;
916 temp = (r__1 = a[i__2].r, abs(r__1));
917 if (value < temp || sisnan_(&temp)) {
921 for (i__ = k + j + 1; i__ <= i__2; ++i__) {
922 temp = c_abs(&a[i__ + j * lda]);
923 if (value < temp || sisnan_(&temp)) {
929 for (i__ = 0; i__ <= i__1; ++i__) {
930 temp = c_abs(&a[i__ + j * lda]);
931 if (value < temp || sisnan_(&temp)) {
936 /* i=n-1 -> U(n-1,n-1) */
937 i__1 = i__ + j * lda;
938 temp = (r__1 = a[i__1].r, abs(r__1));
939 if (value < temp || sisnan_(&temp)) {
944 /* xpose case; A is k by n */
948 for (j = 0; j <= i__1; ++j) {
950 for (i__ = 0; i__ <= i__2; ++i__) {
951 temp = c_abs(&a[i__ + j * lda]);
952 if (value < temp || sisnan_(&temp)) {
958 i__2 = i__ + j * lda;
959 temp = (r__1 = a[i__2].r, abs(r__1));
960 if (value < temp || sisnan_(&temp)) {
965 i__2 = i__ + j * lda;
966 temp = (r__1 = a[i__2].r, abs(r__1));
967 if (value < temp || sisnan_(&temp)) {
971 for (i__ = j + 2; i__ <= i__2; ++i__) {
972 temp = c_abs(&a[i__ + j * lda]);
973 if (value < temp || sisnan_(&temp)) {
980 for (i__ = 0; i__ <= i__1; ++i__) {
981 temp = c_abs(&a[i__ + j * lda]);
982 if (value < temp || sisnan_(&temp)) {
987 /* -> L(i,i) is at A(i,j) */
988 i__1 = i__ + j * lda;
989 temp = (r__1 = a[i__1].r, abs(r__1));
990 if (value < temp || sisnan_(&temp)) {
994 for (j = k; j <= i__1; ++j) {
996 for (i__ = 0; i__ <= i__2; ++i__) {
997 temp = c_abs(&a[i__ + j * lda]);
998 if (value < temp || sisnan_(&temp)) {
1006 for (j = 0; j <= i__1; ++j) {
1008 for (i__ = 0; i__ <= i__2; ++i__) {
1009 temp = c_abs(&a[i__ + j * lda]);
1010 if (value < temp || sisnan_(&temp)) {
1016 /* -> U(j,j) is at A(0,j) */
1018 temp = (r__1 = a[i__1].r, abs(r__1));
1019 if (value < temp || sisnan_(&temp)) {
1023 for (i__ = 1; i__ <= i__1; ++i__) {
1024 temp = c_abs(&a[i__ + j * lda]);
1025 if (value < temp || sisnan_(&temp)) {
1030 for (j = k; j <= i__1; ++j) {
1032 for (i__ = 0; i__ <= i__2; ++i__) {
1033 temp = c_abs(&a[i__ + j * lda]);
1034 if (value < temp || sisnan_(&temp)) {
1039 /* -> U(i,i) at A(i,j) */
1040 i__2 = i__ + j * lda;
1041 temp = (r__1 = a[i__2].r, abs(r__1));
1042 if (value < temp || sisnan_(&temp)) {
1047 i__2 = i__ + j * lda;
1048 temp = (r__1 = a[i__2].r, abs(r__1));
1049 if (value < temp || sisnan_(&temp)) {
1053 for (i__ = j - k + 2; i__ <= i__2; ++i__) {
1054 temp = c_abs(&a[i__ + j * lda]);
1055 if (value < temp || sisnan_(&temp)) {
1063 /* n is even & k = n/2 */
1069 /* -> L(k,k) & j=1 -> L(0,0) */
1071 temp = (r__1 = a[i__1].r, abs(r__1));
1072 if (value < temp || sisnan_(&temp)) {
1075 i__1 = j + 1 + j * lda;
1076 temp = (r__1 = a[i__1].r, abs(r__1));
1077 if (value < temp || sisnan_(&temp)) {
1081 for (i__ = 2; i__ <= i__1; ++i__) {
1082 temp = c_abs(&a[i__ + j * lda]);
1083 if (value < temp || sisnan_(&temp)) {
1088 for (j = 1; j <= i__1; ++j) {
1090 for (i__ = 0; i__ <= i__2; ++i__) {
1091 temp = c_abs(&a[i__ + j * lda]);
1092 if (value < temp || sisnan_(&temp)) {
1098 i__2 = i__ + j * lda;
1099 temp = (r__1 = a[i__2].r, abs(r__1));
1100 if (value < temp || sisnan_(&temp)) {
1105 i__2 = i__ + j * lda;
1106 temp = (r__1 = a[i__2].r, abs(r__1));
1107 if (value < temp || sisnan_(&temp)) {
1111 for (i__ = j + 2; i__ <= i__2; ++i__) {
1112 temp = c_abs(&a[i__ + j * lda]);
1113 if (value < temp || sisnan_(&temp)) {
1121 for (j = 0; j <= i__1; ++j) {
1123 for (i__ = 0; i__ <= i__2; ++i__) {
1124 temp = c_abs(&a[i__ + j * lda]);
1125 if (value < temp || sisnan_(&temp)) {
1131 i__2 = i__ + j * lda;
1132 temp = (r__1 = a[i__2].r, abs(r__1));
1133 if (value < temp || sisnan_(&temp)) {
1137 /* =k+j+1; i -> U(j,j) */
1138 i__2 = i__ + j * lda;
1139 temp = (r__1 = a[i__2].r, abs(r__1));
1140 if (value < temp || sisnan_(&temp)) {
1144 for (i__ = k + j + 2; i__ <= i__2; ++i__) {
1145 temp = c_abs(&a[i__ + j * lda]);
1146 if (value < temp || sisnan_(&temp)) {
1152 for (i__ = 0; i__ <= i__1; ++i__) {
1153 temp = c_abs(&a[i__ + j * lda]);
1154 if (value < temp || sisnan_(&temp)) {
1159 /* i=n-1 -> U(n-1,n-1) */
1160 i__1 = i__ + j * lda;
1161 temp = (r__1 = a[i__1].r, abs(r__1));
1162 if (value < temp || sisnan_(&temp)) {
1167 i__1 = i__ + j * lda;
1168 temp = (r__1 = a[i__1].r, abs(r__1));
1169 if (value < temp || sisnan_(&temp)) {
1174 /* xpose case; A is k by n+1 */
1178 /* -> L(k,k) at A(0,0) */
1180 temp = (r__1 = a[i__1].r, abs(r__1));
1181 if (value < temp || sisnan_(&temp)) {
1185 for (i__ = 1; i__ <= i__1; ++i__) {
1186 temp = c_abs(&a[i__ + j * lda]);
1187 if (value < temp || sisnan_(&temp)) {
1192 for (j = 1; j <= i__1; ++j) {
1194 for (i__ = 0; i__ <= i__2; ++i__) {
1195 temp = c_abs(&a[i__ + j * lda]);
1196 if (value < temp || sisnan_(&temp)) {
1202 i__2 = i__ + j * lda;
1203 temp = (r__1 = a[i__2].r, abs(r__1));
1204 if (value < temp || sisnan_(&temp)) {
1209 i__2 = i__ + j * lda;
1210 temp = (r__1 = a[i__2].r, abs(r__1));
1211 if (value < temp || sisnan_(&temp)) {
1215 for (i__ = j + 1; i__ <= i__2; ++i__) {
1216 temp = c_abs(&a[i__ + j * lda]);
1217 if (value < temp || sisnan_(&temp)) {
1224 for (i__ = 0; i__ <= i__1; ++i__) {
1225 temp = c_abs(&a[i__ + j * lda]);
1226 if (value < temp || sisnan_(&temp)) {
1231 /* -> L(i,i) is at A(i,j) */
1232 i__1 = i__ + j * lda;
1233 temp = (r__1 = a[i__1].r, abs(r__1));
1234 if (value < temp || sisnan_(&temp)) {
1238 for (j = k + 1; j <= i__1; ++j) {
1240 for (i__ = 0; i__ <= i__2; ++i__) {
1241 temp = c_abs(&a[i__ + j * lda]);
1242 if (value < temp || sisnan_(&temp)) {
1250 for (j = 0; j <= i__1; ++j) {
1252 for (i__ = 0; i__ <= i__2; ++i__) {
1253 temp = c_abs(&a[i__ + j * lda]);
1254 if (value < temp || sisnan_(&temp)) {
1260 /* -> U(j,j) is at A(0,j) */
1262 temp = (r__1 = a[i__1].r, abs(r__1));
1263 if (value < temp || sisnan_(&temp)) {
1267 for (i__ = 1; i__ <= i__1; ++i__) {
1268 temp = c_abs(&a[i__ + j * lda]);
1269 if (value < temp || sisnan_(&temp)) {
1274 for (j = k + 1; j <= i__1; ++j) {
1276 for (i__ = 0; i__ <= i__2; ++i__) {
1277 temp = c_abs(&a[i__ + j * lda]);
1278 if (value < temp || sisnan_(&temp)) {
1283 /* -> U(i,i) at A(i,j) */
1284 i__2 = i__ + j * lda;
1285 temp = (r__1 = a[i__2].r, abs(r__1));
1286 if (value < temp || sisnan_(&temp)) {
1291 i__2 = i__ + j * lda;
1292 temp = (r__1 = a[i__2].r, abs(r__1));
1293 if (value < temp || sisnan_(&temp)) {
1297 for (i__ = j - k + 1; i__ <= i__2; ++i__) {
1298 temp = c_abs(&a[i__ + j * lda]);
1299 if (value < temp || sisnan_(&temp)) {
1306 for (i__ = 0; i__ <= i__1; ++i__) {
1307 temp = c_abs(&a[i__ + j * lda]);
1308 if (value < temp || sisnan_(&temp)) {
1313 /* U(k,k) at A(i,j) */
1314 i__1 = i__ + j * lda;
1315 temp = (r__1 = a[i__1].r, abs(r__1));
1316 if (value < temp || sisnan_(&temp)) {
1322 } else if (lsame_(norm, "I") || lsame_(norm, "O") || *(unsigned char *)norm == '1') {
1324 /* Find normI(A) ( = norm1(A), since A is Hermitian). */
1330 /* n is odd & A is n by (n+1)/2 */
1334 for (i__ = 0; i__ <= i__1; ++i__) {
1338 for (j = 0; j <= i__1; ++j) {
1341 for (i__ = 0; i__ <= i__2; ++i__) {
1342 aa = c_abs(&a[i__ + j * lda]);
1347 i__2 = i__ + j * lda;
1348 aa = (r__1 = a[i__2].r, abs(r__1));
1350 work[j + k] = s + aa;
1355 i__2 = i__ + j * lda;
1356 aa = (r__1 = a[i__2].r, abs(r__1));
1361 for (l = j + 1; l <= i__2; ++l) {
1363 aa = c_abs(&a[i__ + j * lda]);
1373 for (i__ = 1; i__ <= i__1; ++i__) {
1375 if (value < temp || sisnan_(&temp)) {
1380 /* ilu = 1 & uplo = 'L' */
1382 /* k=(n+1)/2 for n odd and ilu=1 */
1384 for (i__ = k; i__ <= i__1; ++i__) {
1387 for (j = k - 1; j >= 0; --j) {
1390 for (i__ = 0; i__ <= i__1; ++i__) {
1391 aa = c_abs(&a[i__ + j * lda]);
1394 work[i__ + k] += aa;
1397 i__1 = i__ + j * lda;
1398 aa = (r__1 = a[i__1].r, abs(r__1));
1405 i__1 = i__ + j * lda;
1406 aa = (r__1 = a[i__1].r, abs(r__1));
1411 for (l = j + 1; l <= i__1; ++l) {
1413 aa = c_abs(&a[i__ + j * lda]);
1422 for (i__ = 1; i__ <= i__1; ++i__) {
1424 if (value < temp || sisnan_(&temp)) {
1430 /* n is even & A is n+1 by k = n/2 */
1434 for (i__ = 0; i__ <= i__1; ++i__) {
1438 for (j = 0; j <= i__1; ++j) {
1441 for (i__ = 0; i__ <= i__2; ++i__) {
1442 aa = c_abs(&a[i__ + j * lda]);
1447 i__2 = i__ + j * lda;
1448 aa = (r__1 = a[i__2].r, abs(r__1));
1450 work[j + k] = s + aa;
1452 i__2 = i__ + j * lda;
1453 aa = (r__1 = a[i__2].r, abs(r__1));
1458 for (l = j + 1; l <= i__2; ++l) {
1460 aa = c_abs(&a[i__ + j * lda]);
1469 for (i__ = 1; i__ <= i__1; ++i__) {
1471 if (value < temp || sisnan_(&temp)) {
1476 /* ilu = 1 & uplo = 'L' */
1478 for (i__ = k; i__ <= i__1; ++i__) {
1481 for (j = k - 1; j >= 0; --j) {
1484 for (i__ = 0; i__ <= i__1; ++i__) {
1485 aa = c_abs(&a[i__ + j * lda]);
1488 work[i__ + k] += aa;
1490 i__1 = i__ + j * lda;
1491 aa = (r__1 = a[i__1].r, abs(r__1));
1497 i__1 = i__ + j * lda;
1498 aa = (r__1 = a[i__1].r, abs(r__1));
1503 for (l = j + 1; l <= i__1; ++l) {
1505 aa = c_abs(&a[i__ + j * lda]);
1514 for (i__ = 1; i__ <= i__1; ++i__) {
1516 if (value < temp || sisnan_(&temp)) {
1526 /* n is odd & A is (n+1)/2 by n */
1532 /* k is the row size and lda */
1534 for (i__ = n1; i__ <= i__1; ++i__) {
1538 for (j = 0; j <= i__1; ++j) {
1541 for (i__ = 0; i__ <= i__2; ++i__) {
1542 aa = c_abs(&a[i__ + j * lda]);
1544 work[i__ + n1] += aa;
1549 /* j=n1=k-1 is special */
1551 s = (r__1 = a[i__1].r, abs(r__1));
1554 for (i__ = 1; i__ <= i__1; ++i__) {
1555 aa = c_abs(&a[i__ + j * lda]);
1557 work[i__ + n1] += aa;
1562 for (j = k; j <= i__1; ++j) {
1565 for (i__ = 0; i__ <= i__2; ++i__) {
1566 aa = c_abs(&a[i__ + j * lda]);
1572 i__2 = i__ + j * lda;
1573 aa = (r__1 = a[i__2].r, abs(r__1));
1578 i__2 = i__ + j * lda;
1579 s = (r__1 = a[i__2].r, abs(r__1));
1582 for (l = j + 1; l <= i__2; ++l) {
1584 aa = c_abs(&a[i__ + j * lda]);
1593 for (i__ = 1; i__ <= i__1; ++i__) {
1595 if (value < temp || sisnan_(&temp)) {
1600 /* ilu=1 & uplo = 'L' */
1602 /* k=(n+1)/2 for n odd and ilu=1 */
1604 for (i__ = k; i__ <= i__1; ++i__) {
1608 for (j = 0; j <= i__1; ++j) {
1612 for (i__ = 0; i__ <= i__2; ++i__) {
1613 aa = c_abs(&a[i__ + j * lda]);
1618 i__2 = i__ + j * lda;
1619 aa = (r__1 = a[i__2].r, abs(r__1));
1620 /* i=j so process of A(j,j) */
1623 /* is initialised here */
1625 /* i=j process A(j+k,j+k) */
1626 i__2 = i__ + j * lda;
1627 aa = (r__1 = a[i__2].r, abs(r__1));
1630 for (l = k + j + 1; l <= i__2; ++l) {
1632 aa = c_abs(&a[i__ + j * lda]);
1639 /* j=k-1 is special :process col A(k-1,0:k-1) */
1642 for (i__ = 0; i__ <= i__1; ++i__) {
1643 aa = c_abs(&a[i__ + j * lda]);
1649 i__1 = i__ + j * lda;
1650 aa = (r__1 = a[i__1].r, abs(r__1));
1654 /* done with col j=k+1 */
1656 for (j = k; j <= i__1; ++j) {
1657 /* process col j of A = A(j,0:k-1) */
1660 for (i__ = 0; i__ <= i__2; ++i__) {
1661 aa = c_abs(&a[i__ + j * lda]);
1670 for (i__ = 1; i__ <= i__1; ++i__) {
1672 if (value < temp || sisnan_(&temp)) {
1678 /* n is even & A is k=n/2 by n+1 */
1682 for (i__ = k; i__ <= i__1; ++i__) {
1686 for (j = 0; j <= i__1; ++j) {
1689 for (i__ = 0; i__ <= i__2; ++i__) {
1690 aa = c_abs(&a[i__ + j * lda]);
1692 work[i__ + k] += aa;
1699 aa = (r__1 = a[i__1].r, abs(r__1));
1703 for (i__ = 1; i__ <= i__1; ++i__) {
1704 aa = c_abs(&a[i__ + j * lda]);
1706 work[i__ + k] += aa;
1711 for (j = k + 1; j <= i__1; ++j) {
1714 for (i__ = 0; i__ <= i__2; ++i__) {
1715 aa = c_abs(&a[i__ + j * lda]);
1721 i__2 = i__ + j * lda;
1722 aa = (r__1 = a[i__2].r, abs(r__1));
1723 /* A(j-k-1,j-k-1) */
1725 work[j - k - 1] += s;
1727 i__2 = i__ + j * lda;
1728 aa = (r__1 = a[i__2].r, abs(r__1));
1732 for (l = j + 1; l <= i__2; ++l) {
1734 aa = c_abs(&a[i__ + j * lda]);
1744 for (i__ = 0; i__ <= i__1; ++i__) {
1745 aa = c_abs(&a[i__ + j * lda]);
1751 i__1 = i__ + j * lda;
1752 aa = (r__1 = a[i__1].r, abs(r__1));
1758 for (i__ = 1; i__ <= i__1; ++i__) {
1760 if (value < temp || sisnan_(&temp)) {
1765 /* ilu=1 & uplo = 'L' */
1767 for (i__ = k; i__ <= i__1; ++i__) {
1770 /* j=0 is special :process col A(k:n-1,k) */
1771 s = (r__1 = a[0].r, abs(r__1));
1774 for (i__ = 1; i__ <= i__1; ++i__) {
1775 aa = c_abs(&a[i__]);
1777 work[i__ + k] += aa;
1782 for (j = 1; j <= i__1; ++j) {
1786 for (i__ = 0; i__ <= i__2; ++i__) {
1787 aa = c_abs(&a[i__ + j * lda]);
1792 i__2 = i__ + j * lda;
1793 aa = (r__1 = a[i__2].r, abs(r__1));
1794 /* i=j-1 so process of A(j-1,j-1) */
1797 /* is initialised here */
1799 /* i=j process A(j+k,j+k) */
1800 i__2 = i__ + j * lda;
1801 aa = (r__1 = a[i__2].r, abs(r__1));
1804 for (l = k + j + 1; l <= i__2; ++l) {
1806 aa = c_abs(&a[i__ + j * lda]);
1813 /* j=k is special :process col A(k,0:k-1) */
1816 for (i__ = 0; i__ <= i__1; ++i__) {
1817 aa = c_abs(&a[i__ + j * lda]);
1824 i__1 = i__ + j * lda;
1825 aa = (r__1 = a[i__1].r, abs(r__1));
1829 /* done with col j=k+1 */
1831 for (j = k + 1; j <= i__1; ++j) {
1833 /* process col j-1 of A = A(j-1,0:k-1) */
1836 for (i__ = 0; i__ <= i__2; ++i__) {
1837 aa = c_abs(&a[i__ + j * lda]);
1846 for (i__ = 1; i__ <= i__1; ++i__) {
1848 if (value < temp || sisnan_(&temp)) {
1855 } else if (lsame_(norm, "F") || lsame_(norm, "E")) {
1857 /* Find normF(A). */
1865 /* A is normal & A is n by k */
1869 for (j = 0; j <= i__1; ++j) {
1871 classq_(&i__2, &a[k + j + 1 + j * lda], &c__1, &scale,
1876 for (j = 0; j <= i__1; ++j) {
1878 classq_(&i__2, &a[j * lda], &c__1, &scale, &s);
1879 /* trap U at A(0,0) */
1882 /* double s for the off diagonal elements */
1884 /* -> U(k,k) at A(k-1,0) */
1886 for (i__ = 0; i__ <= i__1; ++i__) {
1892 /* Computing 2nd power */
1894 s = s * (r__1 * r__1) + 1.f;
1897 /* Computing 2nd power */
1907 /* Computing 2nd power */
1909 s = s * (r__1 * r__1) + 1.f;
1912 /* Computing 2nd power */
1924 /* Computing 2nd power */
1926 s = s * (r__1 * r__1) + 1.f;
1929 /* Computing 2nd power */
1935 /* ilu=1 & A is lower */
1937 for (j = 0; j <= i__1; ++j) {
1939 classq_(&i__2, &a[j + 1 + j * lda], &c__1, &scale, &s)
1941 /* trap L at A(0,0) */
1944 for (j = 1; j <= i__1; ++j) {
1945 classq_(&j, &a[(j + 1) * lda], &c__1, &scale, &s);
1949 /* double s for the off diagonal elements */
1951 /* L(0,0) at A(0,0) */
1954 /* Computing 2nd power */
1956 s = s * (r__1 * r__1) + 1.f;
1959 /* Computing 2nd power */
1965 /* -> L(k,k) at A(0,1) */
1967 for (i__ = 1; i__ <= i__1; ++i__) {
1970 /* L(k-1+i,k-1+i) */
1973 /* Computing 2nd power */
1975 s = s * (r__1 * r__1) + 1.f;
1978 /* Computing 2nd power */
1988 /* Computing 2nd power */
1990 s = s * (r__1 * r__1) + 1.f;
1993 /* Computing 2nd power */
2002 /* A is xpose & A is k by n */
2006 for (j = 1; j <= i__1; ++j) {
2007 classq_(&j, &a[(k + j) * lda], &c__1, &scale, &s);
2011 for (j = 0; j <= i__1; ++j) {
2012 classq_(&k, &a[j * lda], &c__1, &scale, &s);
2013 /* k by k-1 rect. at A(0,0) */
2016 for (j = 0; j <= i__1; ++j) {
2018 classq_(&i__2, &a[j + 1 + (j + k - 1) * lda], &c__1, &
2023 /* double s for the off diagonal elements */
2025 /* -> U(k-1,k-1) at A(0,k-1) */
2031 /* Computing 2nd power */
2033 s = s * (r__1 * r__1) + 1.f;
2036 /* Computing 2nd power */
2042 /* -> U(0,0) at A(0,k) */
2044 for (j = k; j <= i__1; ++j) {
2050 /* Computing 2nd power */
2052 s = s * (r__1 * r__1) + 1.f;
2055 /* Computing 2nd power */
2065 /* Computing 2nd power */
2067 s = s * (r__1 * r__1) + 1.f;
2070 /* Computing 2nd power */
2080 for (j = 1; j <= i__1; ++j) {
2081 classq_(&j, &a[j * lda], &c__1, &scale, &s);
2085 for (j = k; j <= i__1; ++j) {
2086 classq_(&k, &a[j * lda], &c__1, &scale, &s);
2087 /* k by k-1 rect. at A(0,k) */
2090 for (j = 0; j <= i__1; ++j) {
2092 classq_(&i__2, &a[j + 2 + j * lda], &c__1, &scale, &s)
2097 /* double s for the off diagonal elements */
2099 /* -> L(0,0) at A(0,0) */
2101 for (i__ = 0; i__ <= i__1; ++i__) {
2107 /* Computing 2nd power */
2109 s = s * (r__1 * r__1) + 1.f;
2112 /* Computing 2nd power */
2122 /* Computing 2nd power */
2124 s = s * (r__1 * r__1) + 1.f;
2127 /* Computing 2nd power */
2134 /* L-> k-1 + (k-1)*lda or L(k-1,k-1) at A(k-1,k-1) */
2137 /* L(k-1,k-1) at A(k-1,k-1) */
2140 /* Computing 2nd power */
2142 s = s * (r__1 * r__1) + 1.f;
2145 /* Computing 2nd power */
2159 for (j = 0; j <= i__1; ++j) {
2161 classq_(&i__2, &a[k + j + 2 + j * lda], &c__1, &scale,
2166 for (j = 0; j <= i__1; ++j) {
2168 classq_(&i__2, &a[j * lda], &c__1, &scale, &s);
2169 /* trap U at A(0,0) */
2172 /* double s for the off diagonal elements */
2174 /* -> U(k,k) at A(k,0) */
2176 for (i__ = 0; i__ <= i__1; ++i__) {
2182 /* Computing 2nd power */
2184 s = s * (r__1 * r__1) + 1.f;
2187 /* Computing 2nd power */
2197 /* Computing 2nd power */
2199 s = s * (r__1 * r__1) + 1.f;
2202 /* Computing 2nd power */
2210 /* ilu=1 & A is lower */
2212 for (j = 0; j <= i__1; ++j) {
2214 classq_(&i__2, &a[j + 2 + j * lda], &c__1, &scale, &s)
2216 /* trap L at A(1,0) */
2219 for (j = 1; j <= i__1; ++j) {
2220 classq_(&j, &a[j * lda], &c__1, &scale, &s);
2224 /* double s for the off diagonal elements */
2226 /* -> L(k,k) at A(0,0) */
2228 for (i__ = 0; i__ <= i__1; ++i__) {
2231 /* L(k-1+i,k-1+i) */
2234 /* Computing 2nd power */
2236 s = s * (r__1 * r__1) + 1.f;
2239 /* Computing 2nd power */
2249 /* Computing 2nd power */
2251 s = s * (r__1 * r__1) + 1.f;
2254 /* Computing 2nd power */
2267 for (j = 1; j <= i__1; ++j) {
2268 classq_(&j, &a[(k + 1 + j) * lda], &c__1, &scale, &s);
2272 for (j = 0; j <= i__1; ++j) {
2273 classq_(&k, &a[j * lda], &c__1, &scale, &s);
2274 /* k by k rect. at A(0,0) */
2277 for (j = 0; j <= i__1; ++j) {
2279 classq_(&i__2, &a[j + 1 + (j + k) * lda], &c__1, &
2284 /* double s for the off diagonal elements */
2286 /* -> U(k,k) at A(0,k) */
2292 /* Computing 2nd power */
2294 s = s * (r__1 * r__1) + 1.f;
2297 /* Computing 2nd power */
2303 /* -> U(0,0) at A(0,k+1) */
2305 for (j = k + 1; j <= i__1; ++j) {
2308 /* -> U(j-k-1,j-k-1) */
2311 /* Computing 2nd power */
2313 s = s * (r__1 * r__1) + 1.f;
2316 /* Computing 2nd power */
2326 /* Computing 2nd power */
2328 s = s * (r__1 * r__1) + 1.f;
2331 /* Computing 2nd power */
2339 /* -> U(k-1,k-1) at A(k-1,n) */
2345 /* Computing 2nd power */
2347 s = s * (r__1 * r__1) + 1.f;
2350 /* Computing 2nd power */
2358 for (j = 1; j <= i__1; ++j) {
2359 classq_(&j, &a[(j + 1) * lda], &c__1, &scale, &s);
2363 for (j = k + 1; j <= i__1; ++j) {
2364 classq_(&k, &a[j * lda], &c__1, &scale, &s);
2365 /* k by k rect. at A(0,k+1) */
2368 for (j = 0; j <= i__1; ++j) {
2370 classq_(&i__2, &a[j + 1 + j * lda], &c__1, &scale, &s)
2375 /* double s for the off diagonal elements */
2377 /* -> L(k,k) at A(0,0) */
2380 /* L(k,k) at A(0,0) */
2383 /* Computing 2nd power */
2385 s = s * (r__1 * r__1) + 1.f;
2388 /* Computing 2nd power */
2394 /* -> L(0,0) at A(0,1) */
2396 for (i__ = 0; i__ <= i__1; ++i__) {
2402 /* Computing 2nd power */
2404 s = s * (r__1 * r__1) + 1.f;
2407 /* Computing 2nd power */
2414 /* L(k+i+1,k+i+1) */
2417 /* Computing 2nd power */
2419 s = s * (r__1 * r__1) + 1.f;
2422 /* Computing 2nd power */
2429 /* L-> k - 1 + k*lda or L(k-1,k-1) at A(k-1,k) */
2432 /* L(k-1,k-1) at A(k-1,k) */
2435 /* Computing 2nd power */
2437 s = s * (r__1 * r__1) + 1.f;
2440 /* Computing 2nd power */
2448 value = scale * sqrt(s);