clanhf.c
Go to the documentation of this file.
00001 /* clanhf.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static integer c__1 = 1;
00019 
00020 doublereal clanhf_(char *norm, char *transr, char *uplo, integer *n, complex *
00021         a, real *work)
00022 {
00023     /* System generated locals */
00024     integer i__1, i__2;
00025     real ret_val, r__1, r__2, r__3;
00026 
00027     /* Builtin functions */
00028     double c_abs(complex *), sqrt(doublereal);
00029 
00030     /* Local variables */
00031     integer i__, j, k, l;
00032     real s;
00033     integer n1;
00034     real aa;
00035     integer lda, ifm, noe, ilu;
00036     real scale;
00037     extern logical lsame_(char *, char *);
00038     real value;
00039     extern integer isamax_(integer *, real *, integer *);
00040     extern /* Subroutine */ int classq_(integer *, complex *, integer *, real 
00041             *, real *);
00042 
00043 
00044 /*  -- LAPACK routine (version 3.2)                                    -- */
00045 
00046 /*  -- Contributed by Fred Gustavson of the IBM Watson Research Center -- */
00047 /*  -- November 2008                                                   -- */
00048 
00049 /*  -- LAPACK is a software package provided by Univ. of Tennessee,    -- */
00050 /*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
00051 
00052 /*     .. Scalar Arguments .. */
00053 /*     .. */
00054 /*     .. Array Arguments .. */
00055 /*     .. */
00056 
00057 /*  Purpose */
00058 /*  ======= */
00059 
00060 /*  CLANHF  returns the value of the one norm,  or the Frobenius norm, or */
00061 /*  the  infinity norm,  or the  element of  largest absolute value  of a */
00062 /*  complex Hermitian matrix A in RFP format. */
00063 
00064 /*  Description */
00065 /*  =========== */
00066 
00067 /*  CLANHF returns the value */
00068 
00069 /*     CLANHF = ( max(abs(A(i,j))), NORM = 'M' or 'm' */
00070 /*              ( */
00071 /*              ( norm1(A),         NORM = '1', 'O' or 'o' */
00072 /*              ( */
00073 /*              ( normI(A),         NORM = 'I' or 'i' */
00074 /*              ( */
00075 /*              ( normF(A),         NORM = 'F', 'f', 'E' or 'e' */
00076 
00077 /*  where  norm1  denotes the  one norm of a matrix (maximum column sum), */
00078 /*  normI  denotes the  infinity norm  of a matrix  (maximum row sum) and */
00079 /*  normF  denotes the  Frobenius norm of a matrix (square root of sum of */
00080 /*  squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm. */
00081 
00082 /*  Arguments */
00083 /*  ========= */
00084 
00085 /*  NORM      (input) CHARACTER */
00086 /*            Specifies the value to be returned in CLANHF as described */
00087 /*            above. */
00088 
00089 /*  TRANSR    (input) CHARACTER */
00090 /*            Specifies whether the RFP format of A is normal or */
00091 /*            conjugate-transposed format. */
00092 /*            = 'N':  RFP format is Normal */
00093 /*            = 'C':  RFP format is Conjugate-transposed */
00094 
00095 /*  UPLO      (input) CHARACTER */
00096 /*            On entry, UPLO specifies whether the RFP matrix A came from */
00097 /*            an upper or lower triangular matrix as follows: */
00098 
00099 /*            UPLO = 'U' or 'u' RFP A came from an upper triangular */
00100 /*            matrix */
00101 
00102 /*            UPLO = 'L' or 'l' RFP A came from a  lower triangular */
00103 /*            matrix */
00104 
00105 /*  N         (input) INTEGER */
00106 /*            The order of the matrix A.  N >= 0.  When N = 0, CLANHF is */
00107 /*            set to zero. */
00108 
00109 /*   A        (input) COMPLEX*16 array, dimension ( N*(N+1)/2 ); */
00110 /*            On entry, the matrix A in RFP Format. */
00111 /*            RFP Format is described by TRANSR, UPLO and N as follows: */
00112 /*            If TRANSR='N' then RFP A is (0:N,0:K-1) when N is even; */
00113 /*            K=N/2. RFP A is (0:N-1,0:K) when N is odd; K=N/2. If */
00114 /*            TRANSR = 'C' then RFP is the Conjugate-transpose of RFP A */
00115 /*            as defined when TRANSR = 'N'. The contents of RFP A are */
00116 /*            defined by UPLO as follows: If UPLO = 'U' the RFP A */
00117 /*            contains the ( N*(N+1)/2 ) elements of upper packed A */
00118 /*            either in normal or conjugate-transpose Format. If */
00119 /*            UPLO = 'L' the RFP A contains the ( N*(N+1) /2 ) elements */
00120 /*            of lower packed A either in normal or conjugate-transpose */
00121 /*            Format. The LDA of RFP A is (N+1)/2 when TRANSR = 'C'. When */
00122 /*            TRANSR is 'N' the LDA is N+1 when N is even and is N when */
00123 /*            is odd. See the Note below for more details. */
00124 /*            Unchanged on exit. */
00125 
00126 /*  WORK      (workspace) REAL array, dimension (LWORK), */
00127 /*            where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise, */
00128 /*            WORK is not referenced. */
00129 
00130 /*  Note: */
00131 /*  ===== */
00132 
00133 /*  We first consider Standard Packed Format when N is even. */
00134 /*  We give an example where N = 6. */
00135 
00136 /*      AP is Upper             AP is Lower */
00137 
00138 /*   00 01 02 03 04 05       00 */
00139 /*      11 12 13 14 15       10 11 */
00140 /*         22 23 24 25       20 21 22 */
00141 /*            33 34 35       30 31 32 33 */
00142 /*               44 45       40 41 42 43 44 */
00143 /*                  55       50 51 52 53 54 55 */
00144 
00145 
00146 /*  Let TRANSR = 'N'. RFP holds AP as follows: */
00147 /*  For UPLO = 'U' the upper trapezoid A(0:5,0:2) consists of the last */
00148 /*  three columns of AP upper. The lower triangle A(4:6,0:2) consists of */
00149 /*  conjugate-transpose of the first three columns of AP upper. */
00150 /*  For UPLO = 'L' the lower trapezoid A(1:6,0:2) consists of the first */
00151 /*  three columns of AP lower. The upper triangle A(0:2,0:2) consists of */
00152 /*  conjugate-transpose of the last three columns of AP lower. */
00153 /*  To denote conjugate we place -- above the element. This covers the */
00154 /*  case N even and TRANSR = 'N'. */
00155 
00156 /*         RFP A                   RFP A */
00157 
00158 /*                                -- -- -- */
00159 /*        03 04 05                33 43 53 */
00160 /*                                   -- -- */
00161 /*        13 14 15                00 44 54 */
00162 /*                                      -- */
00163 /*        23 24 25                10 11 55 */
00164 
00165 /*        33 34 35                20 21 22 */
00166 /*        -- */
00167 /*        00 44 45                30 31 32 */
00168 /*        -- -- */
00169 /*        01 11 55                40 41 42 */
00170 /*        -- -- -- */
00171 /*        02 12 22                50 51 52 */
00172 
00173 /*  Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate- */
00174 /*  transpose of RFP A above. One therefore gets: */
00175 
00176 
00177 /*           RFP A                   RFP A */
00178 
00179 /*     -- -- -- --                -- -- -- -- -- -- */
00180 /*     03 13 23 33 00 01 02    33 00 10 20 30 40 50 */
00181 /*     -- -- -- -- --                -- -- -- -- -- */
00182 /*     04 14 24 34 44 11 12    43 44 11 21 31 41 51 */
00183 /*     -- -- -- -- -- --                -- -- -- -- */
00184 /*     05 15 25 35 45 55 22    53 54 55 22 32 42 52 */
00185 
00186 
00187 /*  We next  consider Standard Packed Format when N is odd. */
00188 /*  We give an example where N = 5. */
00189 
00190 /*     AP is Upper                 AP is Lower */
00191 
00192 /*   00 01 02 03 04              00 */
00193 /*      11 12 13 14              10 11 */
00194 /*         22 23 24              20 21 22 */
00195 /*            33 34              30 31 32 33 */
00196 /*               44              40 41 42 43 44 */
00197 
00198 
00199 /*  Let TRANSR = 'N'. RFP holds AP as follows: */
00200 /*  For UPLO = 'U' the upper trapezoid A(0:4,0:2) consists of the last */
00201 /*  three columns of AP upper. The lower triangle A(3:4,0:1) consists of */
00202 /*  conjugate-transpose of the first two   columns of AP upper. */
00203 /*  For UPLO = 'L' the lower trapezoid A(0:4,0:2) consists of the first */
00204 /*  three columns of AP lower. The upper triangle A(0:1,1:2) consists of */
00205 /*  conjugate-transpose of the last two   columns of AP lower. */
00206 /*  To denote conjugate we place -- above the element. This covers the */
00207 /*  case N odd  and TRANSR = 'N'. */
00208 
00209 /*         RFP A                   RFP A */
00210 
00211 /*                                   -- -- */
00212 /*        02 03 04                00 33 43 */
00213 /*                                      -- */
00214 /*        12 13 14                10 11 44 */
00215 
00216 /*        22 23 24                20 21 22 */
00217 /*        -- */
00218 /*        00 33 34                30 31 32 */
00219 /*        -- -- */
00220 /*        01 11 44                40 41 42 */
00221 
00222 /*  Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate- */
00223 /*  transpose of RFP A above. One therefore gets: */
00224 
00225 
00226 /*           RFP A                   RFP A */
00227 
00228 /*     -- -- --                   -- -- -- -- -- -- */
00229 /*     02 12 22 00 01             00 10 20 30 40 50 */
00230 /*     -- -- -- --                   -- -- -- -- -- */
00231 /*     03 13 23 33 11             33 11 21 31 41 51 */
00232 /*     -- -- -- -- --                   -- -- -- -- */
00233 /*     04 14 24 34 44             43 44 22 32 42 52 */
00234 
00235 /*  ===================================================================== */
00236 
00237 /*     .. Parameters .. */
00238 /*     .. */
00239 /*     .. Local Scalars .. */
00240 /*     .. */
00241 /*     .. External Functions .. */
00242 /*     .. */
00243 /*     .. External Subroutines .. */
00244 /*     .. */
00245 /*     .. Intrinsic Functions .. */
00246 /*     .. */
00247 /*     .. Executable Statements .. */
00248 
00249     if (*n == 0) {
00250         ret_val = 0.f;
00251         return ret_val;
00252     }
00253 
00254 /*     set noe = 1 if n is odd. if n is even set noe=0 */
00255 
00256     noe = 1;
00257     if (*n % 2 == 0) {
00258         noe = 0;
00259     }
00260 
00261 /*     set ifm = 0 when form='C' or 'c' and 1 otherwise */
00262 
00263     ifm = 1;
00264     if (lsame_(transr, "C")) {
00265         ifm = 0;
00266     }
00267 
00268 /*     set ilu = 0 when uplo='U or 'u' and 1 otherwise */
00269 
00270     ilu = 1;
00271     if (lsame_(uplo, "U")) {
00272         ilu = 0;
00273     }
00274 
00275 /*     set lda = (n+1)/2 when ifm = 0 */
00276 /*     set lda = n when ifm = 1 and noe = 1 */
00277 /*     set lda = n+1 when ifm = 1 and noe = 0 */
00278 
00279     if (ifm == 1) {
00280         if (noe == 1) {
00281             lda = *n;
00282         } else {
00283 /*           noe=0 */
00284             lda = *n + 1;
00285         }
00286     } else {
00287 /*        ifm=0 */
00288         lda = (*n + 1) / 2;
00289     }
00290 
00291     if (lsame_(norm, "M")) {
00292 
00293 /*       Find max(abs(A(i,j))). */
00294 
00295         k = (*n + 1) / 2;
00296         value = 0.f;
00297         if (noe == 1) {
00298 /*           n is odd & n = k + k - 1 */
00299             if (ifm == 1) {
00300 /*              A is n by k */
00301                 if (ilu == 1) {
00302 /*                 uplo ='L' */
00303                     j = 0;
00304 /*                 -> L(0,0) */
00305 /* Computing MAX */
00306                     i__1 = j + j * lda;
00307                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00308                     value = dmax(r__2,r__3);
00309                     i__1 = *n - 1;
00310                     for (i__ = 1; i__ <= i__1; ++i__) {
00311 /* Computing MAX */
00312                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00313                         value = dmax(r__1,r__2);
00314                     }
00315                     i__1 = k - 1;
00316                     for (j = 1; j <= i__1; ++j) {
00317                         i__2 = j - 2;
00318                         for (i__ = 0; i__ <= i__2; ++i__) {
00319 /* Computing MAX */
00320                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00321                             value = dmax(r__1,r__2);
00322                         }
00323                         i__ = j - 1;
00324 /*                    L(k+j,k+j) */
00325 /* Computing MAX */
00326                         i__2 = i__ + j * lda;
00327                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00328                         value = dmax(r__2,r__3);
00329                         i__ = j;
00330 /*                    -> L(j,j) */
00331 /* Computing MAX */
00332                         i__2 = i__ + j * lda;
00333                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00334                         value = dmax(r__2,r__3);
00335                         i__2 = *n - 1;
00336                         for (i__ = j + 1; i__ <= i__2; ++i__) {
00337 /* Computing MAX */
00338                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00339                             value = dmax(r__1,r__2);
00340                         }
00341                     }
00342                 } else {
00343 /*                 uplo = 'U' */
00344                     i__1 = k - 2;
00345                     for (j = 0; j <= i__1; ++j) {
00346                         i__2 = k + j - 2;
00347                         for (i__ = 0; i__ <= i__2; ++i__) {
00348 /* Computing MAX */
00349                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00350                             value = dmax(r__1,r__2);
00351                         }
00352                         i__ = k + j - 1;
00353 /*                    -> U(i,i) */
00354 /* Computing MAX */
00355                         i__2 = i__ + j * lda;
00356                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00357                         value = dmax(r__2,r__3);
00358                         ++i__;
00359 /*                    =k+j; i -> U(j,j) */
00360 /* Computing MAX */
00361                         i__2 = i__ + j * lda;
00362                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00363                         value = dmax(r__2,r__3);
00364                         i__2 = *n - 1;
00365                         for (i__ = k + j + 1; i__ <= i__2; ++i__) {
00366 /* Computing MAX */
00367                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00368                             value = dmax(r__1,r__2);
00369                         }
00370                     }
00371                     i__1 = *n - 2;
00372                     for (i__ = 0; i__ <= i__1; ++i__) {
00373 /* Computing MAX */
00374                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00375                         value = dmax(r__1,r__2);
00376 /*                    j=k-1 */
00377                     }
00378 /*                 i=n-1 -> U(n-1,n-1) */
00379 /* Computing MAX */
00380                     i__1 = i__ + j * lda;
00381                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00382                     value = dmax(r__2,r__3);
00383                 }
00384             } else {
00385 /*              xpose case; A is k by n */
00386                 if (ilu == 1) {
00387 /*                 uplo ='L' */
00388                     i__1 = k - 2;
00389                     for (j = 0; j <= i__1; ++j) {
00390                         i__2 = j - 1;
00391                         for (i__ = 0; i__ <= i__2; ++i__) {
00392 /* Computing MAX */
00393                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00394                             value = dmax(r__1,r__2);
00395                         }
00396                         i__ = j;
00397 /*                    L(i,i) */
00398 /* Computing MAX */
00399                         i__2 = i__ + j * lda;
00400                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00401                         value = dmax(r__2,r__3);
00402                         i__ = j + 1;
00403 /*                    L(j+k,j+k) */
00404 /* Computing MAX */
00405                         i__2 = i__ + j * lda;
00406                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00407                         value = dmax(r__2,r__3);
00408                         i__2 = k - 1;
00409                         for (i__ = j + 2; i__ <= i__2; ++i__) {
00410 /* Computing MAX */
00411                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00412                             value = dmax(r__1,r__2);
00413                         }
00414                     }
00415                     j = k - 1;
00416                     i__1 = k - 2;
00417                     for (i__ = 0; i__ <= i__1; ++i__) {
00418 /* Computing MAX */
00419                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00420                         value = dmax(r__1,r__2);
00421                     }
00422                     i__ = k - 1;
00423 /*                 -> L(i,i) is at A(i,j) */
00424 /* Computing MAX */
00425                     i__1 = i__ + j * lda;
00426                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00427                     value = dmax(r__2,r__3);
00428                     i__1 = *n - 1;
00429                     for (j = k; j <= i__1; ++j) {
00430                         i__2 = k - 1;
00431                         for (i__ = 0; i__ <= i__2; ++i__) {
00432 /* Computing MAX */
00433                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00434                             value = dmax(r__1,r__2);
00435                         }
00436                     }
00437                 } else {
00438 /*                 uplo = 'U' */
00439                     i__1 = k - 2;
00440                     for (j = 0; j <= i__1; ++j) {
00441                         i__2 = k - 1;
00442                         for (i__ = 0; i__ <= i__2; ++i__) {
00443 /* Computing MAX */
00444                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00445                             value = dmax(r__1,r__2);
00446                         }
00447                     }
00448                     j = k - 1;
00449 /*                 -> U(j,j) is at A(0,j) */
00450 /* Computing MAX */
00451                     i__1 = j * lda;
00452                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00453                     value = dmax(r__2,r__3);
00454                     i__1 = k - 1;
00455                     for (i__ = 1; i__ <= i__1; ++i__) {
00456 /* Computing MAX */
00457                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00458                         value = dmax(r__1,r__2);
00459                     }
00460                     i__1 = *n - 1;
00461                     for (j = k; j <= i__1; ++j) {
00462                         i__2 = j - k - 1;
00463                         for (i__ = 0; i__ <= i__2; ++i__) {
00464 /* Computing MAX */
00465                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00466                             value = dmax(r__1,r__2);
00467                         }
00468                         i__ = j - k;
00469 /*                    -> U(i,i) at A(i,j) */
00470 /* Computing MAX */
00471                         i__2 = i__ + j * lda;
00472                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00473                         value = dmax(r__2,r__3);
00474                         i__ = j - k + 1;
00475 /*                    U(j,j) */
00476 /* Computing MAX */
00477                         i__2 = i__ + j * lda;
00478                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00479                         value = dmax(r__2,r__3);
00480                         i__2 = k - 1;
00481                         for (i__ = j - k + 2; i__ <= i__2; ++i__) {
00482 /* Computing MAX */
00483                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00484                             value = dmax(r__1,r__2);
00485                         }
00486                     }
00487                 }
00488             }
00489         } else {
00490 /*           n is even & k = n/2 */
00491             if (ifm == 1) {
00492 /*              A is n+1 by k */
00493                 if (ilu == 1) {
00494 /*                 uplo ='L' */
00495                     j = 0;
00496 /*                 -> L(k,k) & j=1 -> L(0,0) */
00497 /* Computing MAX */
00498                     i__1 = j + j * lda;
00499                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00500                     value = dmax(r__2,r__3);
00501 /* Computing MAX */
00502                     i__1 = j + 1 + j * lda;
00503                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00504                     value = dmax(r__2,r__3);
00505                     i__1 = *n;
00506                     for (i__ = 2; i__ <= i__1; ++i__) {
00507 /* Computing MAX */
00508                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00509                         value = dmax(r__1,r__2);
00510                     }
00511                     i__1 = k - 1;
00512                     for (j = 1; j <= i__1; ++j) {
00513                         i__2 = j - 1;
00514                         for (i__ = 0; i__ <= i__2; ++i__) {
00515 /* Computing MAX */
00516                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00517                             value = dmax(r__1,r__2);
00518                         }
00519                         i__ = j;
00520 /*                    L(k+j,k+j) */
00521 /* Computing MAX */
00522                         i__2 = i__ + j * lda;
00523                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00524                         value = dmax(r__2,r__3);
00525                         i__ = j + 1;
00526 /*                    -> L(j,j) */
00527 /* Computing MAX */
00528                         i__2 = i__ + j * lda;
00529                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00530                         value = dmax(r__2,r__3);
00531                         i__2 = *n;
00532                         for (i__ = j + 2; i__ <= i__2; ++i__) {
00533 /* Computing MAX */
00534                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00535                             value = dmax(r__1,r__2);
00536                         }
00537                     }
00538                 } else {
00539 /*                 uplo = 'U' */
00540                     i__1 = k - 2;
00541                     for (j = 0; j <= i__1; ++j) {
00542                         i__2 = k + j - 1;
00543                         for (i__ = 0; i__ <= i__2; ++i__) {
00544 /* Computing MAX */
00545                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00546                             value = dmax(r__1,r__2);
00547                         }
00548                         i__ = k + j;
00549 /*                    -> U(i,i) */
00550 /* Computing MAX */
00551                         i__2 = i__ + j * lda;
00552                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00553                         value = dmax(r__2,r__3);
00554                         ++i__;
00555 /*                    =k+j+1; i -> U(j,j) */
00556 /* Computing MAX */
00557                         i__2 = i__ + j * lda;
00558                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00559                         value = dmax(r__2,r__3);
00560                         i__2 = *n;
00561                         for (i__ = k + j + 2; i__ <= i__2; ++i__) {
00562 /* Computing MAX */
00563                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00564                             value = dmax(r__1,r__2);
00565                         }
00566                     }
00567                     i__1 = *n - 2;
00568                     for (i__ = 0; i__ <= i__1; ++i__) {
00569 /* Computing MAX */
00570                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00571                         value = dmax(r__1,r__2);
00572 /*                    j=k-1 */
00573                     }
00574 /*                 i=n-1 -> U(n-1,n-1) */
00575 /* Computing MAX */
00576                     i__1 = i__ + j * lda;
00577                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00578                     value = dmax(r__2,r__3);
00579                     i__ = *n;
00580 /*                 -> U(k-1,k-1) */
00581 /* Computing MAX */
00582                     i__1 = i__ + j * lda;
00583                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00584                     value = dmax(r__2,r__3);
00585                 }
00586             } else {
00587 /*              xpose case; A is k by n+1 */
00588                 if (ilu == 1) {
00589 /*                 uplo ='L' */
00590                     j = 0;
00591 /*                 -> L(k,k) at A(0,0) */
00592 /* Computing MAX */
00593                     i__1 = j + j * lda;
00594                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00595                     value = dmax(r__2,r__3);
00596                     i__1 = k - 1;
00597                     for (i__ = 1; i__ <= i__1; ++i__) {
00598 /* Computing MAX */
00599                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00600                         value = dmax(r__1,r__2);
00601                     }
00602                     i__1 = k - 1;
00603                     for (j = 1; j <= i__1; ++j) {
00604                         i__2 = j - 2;
00605                         for (i__ = 0; i__ <= i__2; ++i__) {
00606 /* Computing MAX */
00607                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00608                             value = dmax(r__1,r__2);
00609                         }
00610                         i__ = j - 1;
00611 /*                    L(i,i) */
00612 /* Computing MAX */
00613                         i__2 = i__ + j * lda;
00614                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00615                         value = dmax(r__2,r__3);
00616                         i__ = j;
00617 /*                    L(j+k,j+k) */
00618 /* Computing MAX */
00619                         i__2 = i__ + j * lda;
00620                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00621                         value = dmax(r__2,r__3);
00622                         i__2 = k - 1;
00623                         for (i__ = j + 1; i__ <= i__2; ++i__) {
00624 /* Computing MAX */
00625                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00626                             value = dmax(r__1,r__2);
00627                         }
00628                     }
00629                     j = k;
00630                     i__1 = k - 2;
00631                     for (i__ = 0; i__ <= i__1; ++i__) {
00632 /* Computing MAX */
00633                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00634                         value = dmax(r__1,r__2);
00635                     }
00636                     i__ = k - 1;
00637 /*                 -> L(i,i) is at A(i,j) */
00638 /* Computing MAX */
00639                     i__1 = i__ + j * lda;
00640                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00641                     value = dmax(r__2,r__3);
00642                     i__1 = *n;
00643                     for (j = k + 1; j <= i__1; ++j) {
00644                         i__2 = k - 1;
00645                         for (i__ = 0; i__ <= i__2; ++i__) {
00646 /* Computing MAX */
00647                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00648                             value = dmax(r__1,r__2);
00649                         }
00650                     }
00651                 } else {
00652 /*                 uplo = 'U' */
00653                     i__1 = k - 1;
00654                     for (j = 0; j <= i__1; ++j) {
00655                         i__2 = k - 1;
00656                         for (i__ = 0; i__ <= i__2; ++i__) {
00657 /* Computing MAX */
00658                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00659                             value = dmax(r__1,r__2);
00660                         }
00661                     }
00662                     j = k;
00663 /*                 -> U(j,j) is at A(0,j) */
00664 /* Computing MAX */
00665                     i__1 = j * lda;
00666                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00667                     value = dmax(r__2,r__3);
00668                     i__1 = k - 1;
00669                     for (i__ = 1; i__ <= i__1; ++i__) {
00670 /* Computing MAX */
00671                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00672                         value = dmax(r__1,r__2);
00673                     }
00674                     i__1 = *n - 1;
00675                     for (j = k + 1; j <= i__1; ++j) {
00676                         i__2 = j - k - 2;
00677                         for (i__ = 0; i__ <= i__2; ++i__) {
00678 /* Computing MAX */
00679                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00680                             value = dmax(r__1,r__2);
00681                         }
00682                         i__ = j - k - 1;
00683 /*                    -> U(i,i) at A(i,j) */
00684 /* Computing MAX */
00685                         i__2 = i__ + j * lda;
00686                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00687                         value = dmax(r__2,r__3);
00688                         i__ = j - k;
00689 /*                    U(j,j) */
00690 /* Computing MAX */
00691                         i__2 = i__ + j * lda;
00692                         r__2 = value, r__3 = (r__1 = a[i__2].r, dabs(r__1));
00693                         value = dmax(r__2,r__3);
00694                         i__2 = k - 1;
00695                         for (i__ = j - k + 1; i__ <= i__2; ++i__) {
00696 /* Computing MAX */
00697                             r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00698                             value = dmax(r__1,r__2);
00699                         }
00700                     }
00701                     j = *n;
00702                     i__1 = k - 2;
00703                     for (i__ = 0; i__ <= i__1; ++i__) {
00704 /* Computing MAX */
00705                         r__1 = value, r__2 = c_abs(&a[i__ + j * lda]);
00706                         value = dmax(r__1,r__2);
00707                     }
00708                     i__ = k - 1;
00709 /*                 U(k,k) at A(i,j) */
00710 /* Computing MAX */
00711                     i__1 = i__ + j * lda;
00712                     r__2 = value, r__3 = (r__1 = a[i__1].r, dabs(r__1));
00713                     value = dmax(r__2,r__3);
00714                 }
00715             }
00716         }
00717     } else if (lsame_(norm, "I") || lsame_(norm, "O") || *(unsigned char *)norm == '1') {
00718 
00719 /*       Find normI(A) ( = norm1(A), since A is Hermitian). */
00720 
00721         if (ifm == 1) {
00722 /*           A is 'N' */
00723             k = *n / 2;
00724             if (noe == 1) {
00725 /*              n is odd & A is n by (n+1)/2 */
00726                 if (ilu == 0) {
00727 /*                 uplo = 'U' */
00728                     i__1 = k - 1;
00729                     for (i__ = 0; i__ <= i__1; ++i__) {
00730                         work[i__] = 0.f;
00731                     }
00732                     i__1 = k;
00733                     for (j = 0; j <= i__1; ++j) {
00734                         s = 0.f;
00735                         i__2 = k + j - 1;
00736                         for (i__ = 0; i__ <= i__2; ++i__) {
00737                             aa = c_abs(&a[i__ + j * lda]);
00738 /*                       -> A(i,j+k) */
00739                             s += aa;
00740                             work[i__] += aa;
00741                         }
00742                         i__2 = i__ + j * lda;
00743                         aa = (r__1 = a[i__2].r, dabs(r__1));
00744 /*                    -> A(j+k,j+k) */
00745                         work[j + k] = s + aa;
00746                         if (i__ == k + k) {
00747                             goto L10;
00748                         }
00749                         ++i__;
00750                         i__2 = i__ + j * lda;
00751                         aa = (r__1 = a[i__2].r, dabs(r__1));
00752 /*                    -> A(j,j) */
00753                         work[j] += aa;
00754                         s = 0.f;
00755                         i__2 = k - 1;
00756                         for (l = j + 1; l <= i__2; ++l) {
00757                             ++i__;
00758                             aa = c_abs(&a[i__ + j * lda]);
00759 /*                       -> A(l,j) */
00760                             s += aa;
00761                             work[l] += aa;
00762                         }
00763                         work[j] += s;
00764                     }
00765 L10:
00766                     i__ = isamax_(n, work, &c__1);
00767                     value = work[i__ - 1];
00768                 } else {
00769 /*                 ilu = 1 & uplo = 'L' */
00770                     ++k;
00771 /*                 k=(n+1)/2 for n odd and ilu=1 */
00772                     i__1 = *n - 1;
00773                     for (i__ = k; i__ <= i__1; ++i__) {
00774                         work[i__] = 0.f;
00775                     }
00776                     for (j = k - 1; j >= 0; --j) {
00777                         s = 0.f;
00778                         i__1 = j - 2;
00779                         for (i__ = 0; i__ <= i__1; ++i__) {
00780                             aa = c_abs(&a[i__ + j * lda]);
00781 /*                       -> A(j+k,i+k) */
00782                             s += aa;
00783                             work[i__ + k] += aa;
00784                         }
00785                         if (j > 0) {
00786                             i__1 = i__ + j * lda;
00787                             aa = (r__1 = a[i__1].r, dabs(r__1));
00788 /*                       -> A(j+k,j+k) */
00789                             s += aa;
00790                             work[i__ + k] += s;
00791 /*                       i=j */
00792                             ++i__;
00793                         }
00794                         i__1 = i__ + j * lda;
00795                         aa = (r__1 = a[i__1].r, dabs(r__1));
00796 /*                    -> A(j,j) */
00797                         work[j] = aa;
00798                         s = 0.f;
00799                         i__1 = *n - 1;
00800                         for (l = j + 1; l <= i__1; ++l) {
00801                             ++i__;
00802                             aa = c_abs(&a[i__ + j * lda]);
00803 /*                       -> A(l,j) */
00804                             s += aa;
00805                             work[l] += aa;
00806                         }
00807                         work[j] += s;
00808                     }
00809                     i__ = isamax_(n, work, &c__1);
00810                     value = work[i__ - 1];
00811                 }
00812             } else {
00813 /*              n is even & A is n+1 by k = n/2 */
00814                 if (ilu == 0) {
00815 /*                 uplo = 'U' */
00816                     i__1 = k - 1;
00817                     for (i__ = 0; i__ <= i__1; ++i__) {
00818                         work[i__] = 0.f;
00819                     }
00820                     i__1 = k - 1;
00821                     for (j = 0; j <= i__1; ++j) {
00822                         s = 0.f;
00823                         i__2 = k + j - 1;
00824                         for (i__ = 0; i__ <= i__2; ++i__) {
00825                             aa = c_abs(&a[i__ + j * lda]);
00826 /*                       -> A(i,j+k) */
00827                             s += aa;
00828                             work[i__] += aa;
00829                         }
00830                         i__2 = i__ + j * lda;
00831                         aa = (r__1 = a[i__2].r, dabs(r__1));
00832 /*                    -> A(j+k,j+k) */
00833                         work[j + k] = s + aa;
00834                         ++i__;
00835                         i__2 = i__ + j * lda;
00836                         aa = (r__1 = a[i__2].r, dabs(r__1));
00837 /*                    -> A(j,j) */
00838                         work[j] += aa;
00839                         s = 0.f;
00840                         i__2 = k - 1;
00841                         for (l = j + 1; l <= i__2; ++l) {
00842                             ++i__;
00843                             aa = c_abs(&a[i__ + j * lda]);
00844 /*                       -> A(l,j) */
00845                             s += aa;
00846                             work[l] += aa;
00847                         }
00848                         work[j] += s;
00849                     }
00850                     i__ = isamax_(n, work, &c__1);
00851                     value = work[i__ - 1];
00852                 } else {
00853 /*                 ilu = 1 & uplo = 'L' */
00854                     i__1 = *n - 1;
00855                     for (i__ = k; i__ <= i__1; ++i__) {
00856                         work[i__] = 0.f;
00857                     }
00858                     for (j = k - 1; j >= 0; --j) {
00859                         s = 0.f;
00860                         i__1 = j - 1;
00861                         for (i__ = 0; i__ <= i__1; ++i__) {
00862                             aa = c_abs(&a[i__ + j * lda]);
00863 /*                       -> A(j+k,i+k) */
00864                             s += aa;
00865                             work[i__ + k] += aa;
00866                         }
00867                         i__1 = i__ + j * lda;
00868                         aa = (r__1 = a[i__1].r, dabs(r__1));
00869 /*                    -> A(j+k,j+k) */
00870                         s += aa;
00871                         work[i__ + k] += s;
00872 /*                    i=j */
00873                         ++i__;
00874                         i__1 = i__ + j * lda;
00875                         aa = (r__1 = a[i__1].r, dabs(r__1));
00876 /*                    -> A(j,j) */
00877                         work[j] = aa;
00878                         s = 0.f;
00879                         i__1 = *n - 1;
00880                         for (l = j + 1; l <= i__1; ++l) {
00881                             ++i__;
00882                             aa = c_abs(&a[i__ + j * lda]);
00883 /*                       -> A(l,j) */
00884                             s += aa;
00885                             work[l] += aa;
00886                         }
00887                         work[j] += s;
00888                     }
00889                     i__ = isamax_(n, work, &c__1);
00890                     value = work[i__ - 1];
00891                 }
00892             }
00893         } else {
00894 /*           ifm=0 */
00895             k = *n / 2;
00896             if (noe == 1) {
00897 /*              n is odd & A is (n+1)/2 by n */
00898                 if (ilu == 0) {
00899 /*                 uplo = 'U' */
00900                     n1 = k;
00901 /*                 n/2 */
00902                     ++k;
00903 /*                 k is the row size and lda */
00904                     i__1 = *n - 1;
00905                     for (i__ = n1; i__ <= i__1; ++i__) {
00906                         work[i__] = 0.f;
00907                     }
00908                     i__1 = n1 - 1;
00909                     for (j = 0; j <= i__1; ++j) {
00910                         s = 0.f;
00911                         i__2 = k - 1;
00912                         for (i__ = 0; i__ <= i__2; ++i__) {
00913                             aa = c_abs(&a[i__ + j * lda]);
00914 /*                       A(j,n1+i) */
00915                             work[i__ + n1] += aa;
00916                             s += aa;
00917                         }
00918                         work[j] = s;
00919                     }
00920 /*                 j=n1=k-1 is special */
00921                     i__1 = j * lda;
00922                     s = (r__1 = a[i__1].r, dabs(r__1));
00923 /*                 A(k-1,k-1) */
00924                     i__1 = k - 1;
00925                     for (i__ = 1; i__ <= i__1; ++i__) {
00926                         aa = c_abs(&a[i__ + j * lda]);
00927 /*                    A(k-1,i+n1) */
00928                         work[i__ + n1] += aa;
00929                         s += aa;
00930                     }
00931                     work[j] += s;
00932                     i__1 = *n - 1;
00933                     for (j = k; j <= i__1; ++j) {
00934                         s = 0.f;
00935                         i__2 = j - k - 1;
00936                         for (i__ = 0; i__ <= i__2; ++i__) {
00937                             aa = c_abs(&a[i__ + j * lda]);
00938 /*                       A(i,j-k) */
00939                             work[i__] += aa;
00940                             s += aa;
00941                         }
00942 /*                    i=j-k */
00943                         i__2 = i__ + j * lda;
00944                         aa = (r__1 = a[i__2].r, dabs(r__1));
00945 /*                    A(j-k,j-k) */
00946                         s += aa;
00947                         work[j - k] += s;
00948                         ++i__;
00949                         i__2 = i__ + j * lda;
00950                         s = (r__1 = a[i__2].r, dabs(r__1));
00951 /*                    A(j,j) */
00952                         i__2 = *n - 1;
00953                         for (l = j + 1; l <= i__2; ++l) {
00954                             ++i__;
00955                             aa = c_abs(&a[i__ + j * lda]);
00956 /*                       A(j,l) */
00957                             work[l] += aa;
00958                             s += aa;
00959                         }
00960                         work[j] += s;
00961                     }
00962                     i__ = isamax_(n, work, &c__1);
00963                     value = work[i__ - 1];
00964                 } else {
00965 /*                 ilu=1 & uplo = 'L' */
00966                     ++k;
00967 /*                 k=(n+1)/2 for n odd and ilu=1 */
00968                     i__1 = *n - 1;
00969                     for (i__ = k; i__ <= i__1; ++i__) {
00970                         work[i__] = 0.f;
00971                     }
00972                     i__1 = k - 2;
00973                     for (j = 0; j <= i__1; ++j) {
00974 /*                    process */
00975                         s = 0.f;
00976                         i__2 = j - 1;
00977                         for (i__ = 0; i__ <= i__2; ++i__) {
00978                             aa = c_abs(&a[i__ + j * lda]);
00979 /*                       A(j,i) */
00980                             work[i__] += aa;
00981                             s += aa;
00982                         }
00983                         i__2 = i__ + j * lda;
00984                         aa = (r__1 = a[i__2].r, dabs(r__1));
00985 /*                    i=j so process of A(j,j) */
00986                         s += aa;
00987                         work[j] = s;
00988 /*                    is initialised here */
00989                         ++i__;
00990 /*                    i=j process A(j+k,j+k) */
00991                         i__2 = i__ + j * lda;
00992                         aa = (r__1 = a[i__2].r, dabs(r__1));
00993                         s = aa;
00994                         i__2 = *n - 1;
00995                         for (l = k + j + 1; l <= i__2; ++l) {
00996                             ++i__;
00997                             aa = c_abs(&a[i__ + j * lda]);
00998 /*                       A(l,k+j) */
00999                             s += aa;
01000                             work[l] += aa;
01001                         }
01002                         work[k + j] += s;
01003                     }
01004 /*                 j=k-1 is special :process col A(k-1,0:k-1) */
01005                     s = 0.f;
01006                     i__1 = k - 2;
01007                     for (i__ = 0; i__ <= i__1; ++i__) {
01008                         aa = c_abs(&a[i__ + j * lda]);
01009 /*                    A(k,i) */
01010                         work[i__] += aa;
01011                         s += aa;
01012                     }
01013 /*                 i=k-1 */
01014                     i__1 = i__ + j * lda;
01015                     aa = (r__1 = a[i__1].r, dabs(r__1));
01016 /*                 A(k-1,k-1) */
01017                     s += aa;
01018                     work[i__] = s;
01019 /*                 done with col j=k+1 */
01020                     i__1 = *n - 1;
01021                     for (j = k; j <= i__1; ++j) {
01022 /*                    process col j of A = A(j,0:k-1) */
01023                         s = 0.f;
01024                         i__2 = k - 1;
01025                         for (i__ = 0; i__ <= i__2; ++i__) {
01026                             aa = c_abs(&a[i__ + j * lda]);
01027 /*                       A(j,i) */
01028                             work[i__] += aa;
01029                             s += aa;
01030                         }
01031                         work[j] += s;
01032                     }
01033                     i__ = isamax_(n, work, &c__1);
01034                     value = work[i__ - 1];
01035                 }
01036             } else {
01037 /*              n is even & A is k=n/2 by n+1 */
01038                 if (ilu == 0) {
01039 /*                 uplo = 'U' */
01040                     i__1 = *n - 1;
01041                     for (i__ = k; i__ <= i__1; ++i__) {
01042                         work[i__] = 0.f;
01043                     }
01044                     i__1 = k - 1;
01045                     for (j = 0; j <= i__1; ++j) {
01046                         s = 0.f;
01047                         i__2 = k - 1;
01048                         for (i__ = 0; i__ <= i__2; ++i__) {
01049                             aa = c_abs(&a[i__ + j * lda]);
01050 /*                       A(j,i+k) */
01051                             work[i__ + k] += aa;
01052                             s += aa;
01053                         }
01054                         work[j] = s;
01055                     }
01056 /*                 j=k */
01057                     i__1 = j * lda;
01058                     aa = (r__1 = a[i__1].r, dabs(r__1));
01059 /*                 A(k,k) */
01060                     s = aa;
01061                     i__1 = k - 1;
01062                     for (i__ = 1; i__ <= i__1; ++i__) {
01063                         aa = c_abs(&a[i__ + j * lda]);
01064 /*                    A(k,k+i) */
01065                         work[i__ + k] += aa;
01066                         s += aa;
01067                     }
01068                     work[j] += s;
01069                     i__1 = *n - 1;
01070                     for (j = k + 1; j <= i__1; ++j) {
01071                         s = 0.f;
01072                         i__2 = j - 2 - k;
01073                         for (i__ = 0; i__ <= i__2; ++i__) {
01074                             aa = c_abs(&a[i__ + j * lda]);
01075 /*                       A(i,j-k-1) */
01076                             work[i__] += aa;
01077                             s += aa;
01078                         }
01079 /*                    i=j-1-k */
01080                         i__2 = i__ + j * lda;
01081                         aa = (r__1 = a[i__2].r, dabs(r__1));
01082 /*                    A(j-k-1,j-k-1) */
01083                         s += aa;
01084                         work[j - k - 1] += s;
01085                         ++i__;
01086                         i__2 = i__ + j * lda;
01087                         aa = (r__1 = a[i__2].r, dabs(r__1));
01088 /*                    A(j,j) */
01089                         s = aa;
01090                         i__2 = *n - 1;
01091                         for (l = j + 1; l <= i__2; ++l) {
01092                             ++i__;
01093                             aa = c_abs(&a[i__ + j * lda]);
01094 /*                       A(j,l) */
01095                             work[l] += aa;
01096                             s += aa;
01097                         }
01098                         work[j] += s;
01099                     }
01100 /*                 j=n */
01101                     s = 0.f;
01102                     i__1 = k - 2;
01103                     for (i__ = 0; i__ <= i__1; ++i__) {
01104                         aa = c_abs(&a[i__ + j * lda]);
01105 /*                    A(i,k-1) */
01106                         work[i__] += aa;
01107                         s += aa;
01108                     }
01109 /*                 i=k-1 */
01110                     i__1 = i__ + j * lda;
01111                     aa = (r__1 = a[i__1].r, dabs(r__1));
01112 /*                 A(k-1,k-1) */
01113                     s += aa;
01114                     work[i__] += s;
01115                     i__ = isamax_(n, work, &c__1);
01116                     value = work[i__ - 1];
01117                 } else {
01118 /*                 ilu=1 & uplo = 'L' */
01119                     i__1 = *n - 1;
01120                     for (i__ = k; i__ <= i__1; ++i__) {
01121                         work[i__] = 0.f;
01122                     }
01123 /*                 j=0 is special :process col A(k:n-1,k) */
01124                     s = (r__1 = a[0].r, dabs(r__1));
01125 /*                 A(k,k) */
01126                     i__1 = k - 1;
01127                     for (i__ = 1; i__ <= i__1; ++i__) {
01128                         aa = c_abs(&a[i__]);
01129 /*                    A(k+i,k) */
01130                         work[i__ + k] += aa;
01131                         s += aa;
01132                     }
01133                     work[k] += s;
01134                     i__1 = k - 1;
01135                     for (j = 1; j <= i__1; ++j) {
01136 /*                    process */
01137                         s = 0.f;
01138                         i__2 = j - 2;
01139                         for (i__ = 0; i__ <= i__2; ++i__) {
01140                             aa = c_abs(&a[i__ + j * lda]);
01141 /*                       A(j-1,i) */
01142                             work[i__] += aa;
01143                             s += aa;
01144                         }
01145                         i__2 = i__ + j * lda;
01146                         aa = (r__1 = a[i__2].r, dabs(r__1));
01147 /*                    i=j-1 so process of A(j-1,j-1) */
01148                         s += aa;
01149                         work[j - 1] = s;
01150 /*                    is initialised here */
01151                         ++i__;
01152 /*                    i=j process A(j+k,j+k) */
01153                         i__2 = i__ + j * lda;
01154                         aa = (r__1 = a[i__2].r, dabs(r__1));
01155                         s = aa;
01156                         i__2 = *n - 1;
01157                         for (l = k + j + 1; l <= i__2; ++l) {
01158                             ++i__;
01159                             aa = c_abs(&a[i__ + j * lda]);
01160 /*                       A(l,k+j) */
01161                             s += aa;
01162                             work[l] += aa;
01163                         }
01164                         work[k + j] += s;
01165                     }
01166 /*                 j=k is special :process col A(k,0:k-1) */
01167                     s = 0.f;
01168                     i__1 = k - 2;
01169                     for (i__ = 0; i__ <= i__1; ++i__) {
01170                         aa = c_abs(&a[i__ + j * lda]);
01171 /*                    A(k,i) */
01172                         work[i__] += aa;
01173                         s += aa;
01174                     }
01175 
01176 /*                 i=k-1 */
01177                     i__1 = i__ + j * lda;
01178                     aa = (r__1 = a[i__1].r, dabs(r__1));
01179 /*                 A(k-1,k-1) */
01180                     s += aa;
01181                     work[i__] = s;
01182 /*                 done with col j=k+1 */
01183                     i__1 = *n;
01184                     for (j = k + 1; j <= i__1; ++j) {
01185 
01186 /*                    process col j-1 of A = A(j-1,0:k-1) */
01187                         s = 0.f;
01188                         i__2 = k - 1;
01189                         for (i__ = 0; i__ <= i__2; ++i__) {
01190                             aa = c_abs(&a[i__ + j * lda]);
01191 /*                       A(j-1,i) */
01192                             work[i__] += aa;
01193                             s += aa;
01194                         }
01195                         work[j - 1] += s;
01196                     }
01197                     i__ = isamax_(n, work, &c__1);
01198                     value = work[i__ - 1];
01199                 }
01200             }
01201         }
01202     } else if (lsame_(norm, "F") || lsame_(norm, "E")) {
01203 
01204 /*       Find normF(A). */
01205 
01206         k = (*n + 1) / 2;
01207         scale = 0.f;
01208         s = 1.f;
01209         if (noe == 1) {
01210 /*           n is odd */
01211             if (ifm == 1) {
01212 /*              A is normal & A is n by k */
01213                 if (ilu == 0) {
01214 /*                 A is upper */
01215                     i__1 = k - 3;
01216                     for (j = 0; j <= i__1; ++j) {
01217                         i__2 = k - j - 2;
01218                         classq_(&i__2, &a[k + j + 1 + j * lda], &c__1, &scale, 
01219                                  &s);
01220 /*                    L at A(k,0) */
01221                     }
01222                     i__1 = k - 1;
01223                     for (j = 0; j <= i__1; ++j) {
01224                         i__2 = k + j - 1;
01225                         classq_(&i__2, &a[j * lda], &c__1, &scale, &s);
01226 /*                    trap U at A(0,0) */
01227                     }
01228                     s += s;
01229 /*                 double s for the off diagonal elements */
01230                     l = k - 1;
01231 /*                 -> U(k,k) at A(k-1,0) */
01232                     i__1 = k - 2;
01233                     for (i__ = 0; i__ <= i__1; ++i__) {
01234                         i__2 = l;
01235                         aa = a[i__2].r;
01236 /*                    U(k+i,k+i) */
01237                         if (aa != 0.f) {
01238                             if (scale < aa) {
01239 /* Computing 2nd power */
01240                                 r__1 = scale / aa;
01241                                 s = s * (r__1 * r__1) + 1.f;
01242                                 scale = aa;
01243                             } else {
01244 /* Computing 2nd power */
01245                                 r__1 = aa / scale;
01246                                 s += r__1 * r__1;
01247                             }
01248                         }
01249                         i__2 = l + 1;
01250                         aa = a[i__2].r;
01251 /*                    U(i,i) */
01252                         if (aa != 0.f) {
01253                             if (scale < aa) {
01254 /* Computing 2nd power */
01255                                 r__1 = scale / aa;
01256                                 s = s * (r__1 * r__1) + 1.f;
01257                                 scale = aa;
01258                             } else {
01259 /* Computing 2nd power */
01260                                 r__1 = aa / scale;
01261                                 s += r__1 * r__1;
01262                             }
01263                         }
01264                         l = l + lda + 1;
01265                     }
01266                     i__1 = l;
01267                     aa = a[i__1].r;
01268 /*                 U(n-1,n-1) */
01269                     if (aa != 0.f) {
01270                         if (scale < aa) {
01271 /* Computing 2nd power */
01272                             r__1 = scale / aa;
01273                             s = s * (r__1 * r__1) + 1.f;
01274                             scale = aa;
01275                         } else {
01276 /* Computing 2nd power */
01277                             r__1 = aa / scale;
01278                             s += r__1 * r__1;
01279                         }
01280                     }
01281                 } else {
01282 /*                 ilu=1 & A is lower */
01283                     i__1 = k - 1;
01284                     for (j = 0; j <= i__1; ++j) {
01285                         i__2 = *n - j - 1;
01286                         classq_(&i__2, &a[j + 1 + j * lda], &c__1, &scale, &s)
01287                                 ;
01288 /*                    trap L at A(0,0) */
01289                     }
01290                     i__1 = k - 2;
01291                     for (j = 1; j <= i__1; ++j) {
01292                         classq_(&j, &a[(j + 1) * lda], &c__1, &scale, &s);
01293 /*                    U at A(0,1) */
01294                     }
01295                     s += s;
01296 /*                 double s for the off diagonal elements */
01297                     aa = a[0].r;
01298 /*                 L(0,0) at A(0,0) */
01299                     if (aa != 0.f) {
01300                         if (scale < aa) {
01301 /* Computing 2nd power */
01302                             r__1 = scale / aa;
01303                             s = s * (r__1 * r__1) + 1.f;
01304                             scale = aa;
01305                         } else {
01306 /* Computing 2nd power */
01307                             r__1 = aa / scale;
01308                             s += r__1 * r__1;
01309                         }
01310                     }
01311                     l = lda;
01312 /*                 -> L(k,k) at A(0,1) */
01313                     i__1 = k - 1;
01314                     for (i__ = 1; i__ <= i__1; ++i__) {
01315                         i__2 = l;
01316                         aa = a[i__2].r;
01317 /*                    L(k-1+i,k-1+i) */
01318                         if (aa != 0.f) {
01319                             if (scale < aa) {
01320 /* Computing 2nd power */
01321                                 r__1 = scale / aa;
01322                                 s = s * (r__1 * r__1) + 1.f;
01323                                 scale = aa;
01324                             } else {
01325 /* Computing 2nd power */
01326                                 r__1 = aa / scale;
01327                                 s += r__1 * r__1;
01328                             }
01329                         }
01330                         i__2 = l + 1;
01331                         aa = a[i__2].r;
01332 /*                    L(i,i) */
01333                         if (aa != 0.f) {
01334                             if (scale < aa) {
01335 /* Computing 2nd power */
01336                                 r__1 = scale / aa;
01337                                 s = s * (r__1 * r__1) + 1.f;
01338                                 scale = aa;
01339                             } else {
01340 /* Computing 2nd power */
01341                                 r__1 = aa / scale;
01342                                 s += r__1 * r__1;
01343                             }
01344                         }
01345                         l = l + lda + 1;
01346                     }
01347                 }
01348             } else {
01349 /*              A is xpose & A is k by n */
01350                 if (ilu == 0) {
01351 /*                 A' is upper */
01352                     i__1 = k - 2;
01353                     for (j = 1; j <= i__1; ++j) {
01354                         classq_(&j, &a[(k + j) * lda], &c__1, &scale, &s);
01355 /*                    U at A(0,k) */
01356                     }
01357                     i__1 = k - 2;
01358                     for (j = 0; j <= i__1; ++j) {
01359                         classq_(&k, &a[j * lda], &c__1, &scale, &s);
01360 /*                    k by k-1 rect. at A(0,0) */
01361                     }
01362                     i__1 = k - 2;
01363                     for (j = 0; j <= i__1; ++j) {
01364                         i__2 = k - j - 1;
01365                         classq_(&i__2, &a[j + 1 + (j + k - 1) * lda], &c__1, &
01366                                 scale, &s);
01367 /*                    L at A(0,k-1) */
01368                     }
01369                     s += s;
01370 /*                 double s for the off diagonal elements */
01371                     l = k * lda - lda;
01372 /*                 -> U(k-1,k-1) at A(0,k-1) */
01373                     i__1 = l;
01374                     aa = a[i__1].r;
01375 /*                 U(k-1,k-1) */
01376                     if (aa != 0.f) {
01377                         if (scale < aa) {
01378 /* Computing 2nd power */
01379                             r__1 = scale / aa;
01380                             s = s * (r__1 * r__1) + 1.f;
01381                             scale = aa;
01382                         } else {
01383 /* Computing 2nd power */
01384                             r__1 = aa / scale;
01385                             s += r__1 * r__1;
01386                         }
01387                     }
01388                     l += lda;
01389 /*                 -> U(0,0) at A(0,k) */
01390                     i__1 = *n - 1;
01391                     for (j = k; j <= i__1; ++j) {
01392                         i__2 = l;
01393                         aa = a[i__2].r;
01394 /*                    -> U(j-k,j-k) */
01395                         if (aa != 0.f) {
01396                             if (scale < aa) {
01397 /* Computing 2nd power */
01398                                 r__1 = scale / aa;
01399                                 s = s * (r__1 * r__1) + 1.f;
01400                                 scale = aa;
01401                             } else {
01402 /* Computing 2nd power */
01403                                 r__1 = aa / scale;
01404                                 s += r__1 * r__1;
01405                             }
01406                         }
01407                         i__2 = l + 1;
01408                         aa = a[i__2].r;
01409 /*                    -> U(j,j) */
01410                         if (aa != 0.f) {
01411                             if (scale < aa) {
01412 /* Computing 2nd power */
01413                                 r__1 = scale / aa;
01414                                 s = s * (r__1 * r__1) + 1.f;
01415                                 scale = aa;
01416                             } else {
01417 /* Computing 2nd power */
01418                                 r__1 = aa / scale;
01419                                 s += r__1 * r__1;
01420                             }
01421                         }
01422                         l = l + lda + 1;
01423                     }
01424                 } else {
01425 /*                 A' is lower */
01426                     i__1 = k - 1;
01427                     for (j = 1; j <= i__1; ++j) {
01428                         classq_(&j, &a[j * lda], &c__1, &scale, &s);
01429 /*                    U at A(0,0) */
01430                     }
01431                     i__1 = *n - 1;
01432                     for (j = k; j <= i__1; ++j) {
01433                         classq_(&k, &a[j * lda], &c__1, &scale, &s);
01434 /*                    k by k-1 rect. at A(0,k) */
01435                     }
01436                     i__1 = k - 3;
01437                     for (j = 0; j <= i__1; ++j) {
01438                         i__2 = k - j - 2;
01439                         classq_(&i__2, &a[j + 2 + j * lda], &c__1, &scale, &s)
01440                                 ;
01441 /*                    L at A(1,0) */
01442                     }
01443                     s += s;
01444 /*                 double s for the off diagonal elements */
01445                     l = 0;
01446 /*                 -> L(0,0) at A(0,0) */
01447                     i__1 = k - 2;
01448                     for (i__ = 0; i__ <= i__1; ++i__) {
01449                         i__2 = l;
01450                         aa = a[i__2].r;
01451 /*                    L(i,i) */
01452                         if (aa != 0.f) {
01453                             if (scale < aa) {
01454 /* Computing 2nd power */
01455                                 r__1 = scale / aa;
01456                                 s = s * (r__1 * r__1) + 1.f;
01457                                 scale = aa;
01458                             } else {
01459 /* Computing 2nd power */
01460                                 r__1 = aa / scale;
01461                                 s += r__1 * r__1;
01462                             }
01463                         }
01464                         i__2 = l + 1;
01465                         aa = a[i__2].r;
01466 /*                    L(k+i,k+i) */
01467                         if (aa != 0.f) {
01468                             if (scale < aa) {
01469 /* Computing 2nd power */
01470                                 r__1 = scale / aa;
01471                                 s = s * (r__1 * r__1) + 1.f;
01472                                 scale = aa;
01473                             } else {
01474 /* Computing 2nd power */
01475                                 r__1 = aa / scale;
01476                                 s += r__1 * r__1;
01477                             }
01478                         }
01479                         l = l + lda + 1;
01480                     }
01481 /*                 L-> k-1 + (k-1)*lda or L(k-1,k-1) at A(k-1,k-1) */
01482                     i__1 = l;
01483                     aa = a[i__1].r;
01484 /*                 L(k-1,k-1) at A(k-1,k-1) */
01485                     if (aa != 0.f) {
01486                         if (scale < aa) {
01487 /* Computing 2nd power */
01488                             r__1 = scale / aa;
01489                             s = s * (r__1 * r__1) + 1.f;
01490                             scale = aa;
01491                         } else {
01492 /* Computing 2nd power */
01493                             r__1 = aa / scale;
01494                             s += r__1 * r__1;
01495                         }
01496                     }
01497                 }
01498             }
01499         } else {
01500 /*           n is even */
01501             if (ifm == 1) {
01502 /*              A is normal */
01503                 if (ilu == 0) {
01504 /*                 A is upper */
01505                     i__1 = k - 2;
01506                     for (j = 0; j <= i__1; ++j) {
01507                         i__2 = k - j - 1;
01508                         classq_(&i__2, &a[k + j + 2 + j * lda], &c__1, &scale, 
01509                                  &s);
01510 /*                 L at A(k+1,0) */
01511                     }
01512                     i__1 = k - 1;
01513                     for (j = 0; j <= i__1; ++j) {
01514                         i__2 = k + j;
01515                         classq_(&i__2, &a[j * lda], &c__1, &scale, &s);
01516 /*                 trap U at A(0,0) */
01517                     }
01518                     s += s;
01519 /*                 double s for the off diagonal elements */
01520                     l = k;
01521 /*                 -> U(k,k) at A(k,0) */
01522                     i__1 = k - 1;
01523                     for (i__ = 0; i__ <= i__1; ++i__) {
01524                         i__2 = l;
01525                         aa = a[i__2].r;
01526 /*                    U(k+i,k+i) */
01527                         if (aa != 0.f) {
01528                             if (scale < aa) {
01529 /* Computing 2nd power */
01530                                 r__1 = scale / aa;
01531                                 s = s * (r__1 * r__1) + 1.f;
01532                                 scale = aa;
01533                             } else {
01534 /* Computing 2nd power */
01535                                 r__1 = aa / scale;
01536                                 s += r__1 * r__1;
01537                             }
01538                         }
01539                         i__2 = l + 1;
01540                         aa = a[i__2].r;
01541 /*                    U(i,i) */
01542                         if (aa != 0.f) {
01543                             if (scale < aa) {
01544 /* Computing 2nd power */
01545                                 r__1 = scale / aa;
01546                                 s = s * (r__1 * r__1) + 1.f;
01547                                 scale = aa;
01548                             } else {
01549 /* Computing 2nd power */
01550                                 r__1 = aa / scale;
01551                                 s += r__1 * r__1;
01552                             }
01553                         }
01554                         l = l + lda + 1;
01555                     }
01556                 } else {
01557 /*                 ilu=1 & A is lower */
01558                     i__1 = k - 1;
01559                     for (j = 0; j <= i__1; ++j) {
01560                         i__2 = *n - j - 1;
01561                         classq_(&i__2, &a[j + 2 + j * lda], &c__1, &scale, &s)
01562                                 ;
01563 /*                    trap L at A(1,0) */
01564                     }
01565                     i__1 = k - 1;
01566                     for (j = 1; j <= i__1; ++j) {
01567                         classq_(&j, &a[j * lda], &c__1, &scale, &s);
01568 /*                    U at A(0,0) */
01569                     }
01570                     s += s;
01571 /*                 double s for the off diagonal elements */
01572                     l = 0;
01573 /*                 -> L(k,k) at A(0,0) */
01574                     i__1 = k - 1;
01575                     for (i__ = 0; i__ <= i__1; ++i__) {
01576                         i__2 = l;
01577                         aa = a[i__2].r;
01578 /*                    L(k-1+i,k-1+i) */
01579                         if (aa != 0.f) {
01580                             if (scale < aa) {
01581 /* Computing 2nd power */
01582                                 r__1 = scale / aa;
01583                                 s = s * (r__1 * r__1) + 1.f;
01584                                 scale = aa;
01585                             } else {
01586 /* Computing 2nd power */
01587                                 r__1 = aa / scale;
01588                                 s += r__1 * r__1;
01589                             }
01590                         }
01591                         i__2 = l + 1;
01592                         aa = a[i__2].r;
01593 /*                    L(i,i) */
01594                         if (aa != 0.f) {
01595                             if (scale < aa) {
01596 /* Computing 2nd power */
01597                                 r__1 = scale / aa;
01598                                 s = s * (r__1 * r__1) + 1.f;
01599                                 scale = aa;
01600                             } else {
01601 /* Computing 2nd power */
01602                                 r__1 = aa / scale;
01603                                 s += r__1 * r__1;
01604                             }
01605                         }
01606                         l = l + lda + 1;
01607                     }
01608                 }
01609             } else {
01610 /*              A is xpose */
01611                 if (ilu == 0) {
01612 /*                 A' is upper */
01613                     i__1 = k - 1;
01614                     for (j = 1; j <= i__1; ++j) {
01615                         classq_(&j, &a[(k + 1 + j) * lda], &c__1, &scale, &s);
01616 /*                 U at A(0,k+1) */
01617                     }
01618                     i__1 = k - 1;
01619                     for (j = 0; j <= i__1; ++j) {
01620                         classq_(&k, &a[j * lda], &c__1, &scale, &s);
01621 /*                 k by k rect. at A(0,0) */
01622                     }
01623                     i__1 = k - 2;
01624                     for (j = 0; j <= i__1; ++j) {
01625                         i__2 = k - j - 1;
01626                         classq_(&i__2, &a[j + 1 + (j + k) * lda], &c__1, &
01627                                 scale, &s);
01628 /*                 L at A(0,k) */
01629                     }
01630                     s += s;
01631 /*                 double s for the off diagonal elements */
01632                     l = k * lda;
01633 /*                 -> U(k,k) at A(0,k) */
01634                     i__1 = l;
01635                     aa = a[i__1].r;
01636 /*                 U(k,k) */
01637                     if (aa != 0.f) {
01638                         if (scale < aa) {
01639 /* Computing 2nd power */
01640                             r__1 = scale / aa;
01641                             s = s * (r__1 * r__1) + 1.f;
01642                             scale = aa;
01643                         } else {
01644 /* Computing 2nd power */
01645                             r__1 = aa / scale;
01646                             s += r__1 * r__1;
01647                         }
01648                     }
01649                     l += lda;
01650 /*                 -> U(0,0) at A(0,k+1) */
01651                     i__1 = *n - 1;
01652                     for (j = k + 1; j <= i__1; ++j) {
01653                         i__2 = l;
01654                         aa = a[i__2].r;
01655 /*                    -> U(j-k-1,j-k-1) */
01656                         if (aa != 0.f) {
01657                             if (scale < aa) {
01658 /* Computing 2nd power */
01659                                 r__1 = scale / aa;
01660                                 s = s * (r__1 * r__1) + 1.f;
01661                                 scale = aa;
01662                             } else {
01663 /* Computing 2nd power */
01664                                 r__1 = aa / scale;
01665                                 s += r__1 * r__1;
01666                             }
01667                         }
01668                         i__2 = l + 1;
01669                         aa = a[i__2].r;
01670 /*                    -> U(j,j) */
01671                         if (aa != 0.f) {
01672                             if (scale < aa) {
01673 /* Computing 2nd power */
01674                                 r__1 = scale / aa;
01675                                 s = s * (r__1 * r__1) + 1.f;
01676                                 scale = aa;
01677                             } else {
01678 /* Computing 2nd power */
01679                                 r__1 = aa / scale;
01680                                 s += r__1 * r__1;
01681                             }
01682                         }
01683                         l = l + lda + 1;
01684                     }
01685 /*                 L=k-1+n*lda */
01686 /*                 -> U(k-1,k-1) at A(k-1,n) */
01687                     i__1 = l;
01688                     aa = a[i__1].r;
01689 /*                 U(k,k) */
01690                     if (aa != 0.f) {
01691                         if (scale < aa) {
01692 /* Computing 2nd power */
01693                             r__1 = scale / aa;
01694                             s = s * (r__1 * r__1) + 1.f;
01695                             scale = aa;
01696                         } else {
01697 /* Computing 2nd power */
01698                             r__1 = aa / scale;
01699                             s += r__1 * r__1;
01700                         }
01701                     }
01702                 } else {
01703 /*                 A' is lower */
01704                     i__1 = k - 1;
01705                     for (j = 1; j <= i__1; ++j) {
01706                         classq_(&j, &a[(j + 1) * lda], &c__1, &scale, &s);
01707 /*                 U at A(0,1) */
01708                     }
01709                     i__1 = *n;
01710                     for (j = k + 1; j <= i__1; ++j) {
01711                         classq_(&k, &a[j * lda], &c__1, &scale, &s);
01712 /*                 k by k rect. at A(0,k+1) */
01713                     }
01714                     i__1 = k - 2;
01715                     for (j = 0; j <= i__1; ++j) {
01716                         i__2 = k - j - 1;
01717                         classq_(&i__2, &a[j + 1 + j * lda], &c__1, &scale, &s)
01718                                 ;
01719 /*                 L at A(0,0) */
01720                     }
01721                     s += s;
01722 /*                 double s for the off diagonal elements */
01723                     l = 0;
01724 /*                 -> L(k,k) at A(0,0) */
01725                     i__1 = l;
01726                     aa = a[i__1].r;
01727 /*                 L(k,k) at A(0,0) */
01728                     if (aa != 0.f) {
01729                         if (scale < aa) {
01730 /* Computing 2nd power */
01731                             r__1 = scale / aa;
01732                             s = s * (r__1 * r__1) + 1.f;
01733                             scale = aa;
01734                         } else {
01735 /* Computing 2nd power */
01736                             r__1 = aa / scale;
01737                             s += r__1 * r__1;
01738                         }
01739                     }
01740                     l = lda;
01741 /*                 -> L(0,0) at A(0,1) */
01742                     i__1 = k - 2;
01743                     for (i__ = 0; i__ <= i__1; ++i__) {
01744                         i__2 = l;
01745                         aa = a[i__2].r;
01746 /*                    L(i,i) */
01747                         if (aa != 0.f) {
01748                             if (scale < aa) {
01749 /* Computing 2nd power */
01750                                 r__1 = scale / aa;
01751                                 s = s * (r__1 * r__1) + 1.f;
01752                                 scale = aa;
01753                             } else {
01754 /* Computing 2nd power */
01755                                 r__1 = aa / scale;
01756                                 s += r__1 * r__1;
01757                             }
01758                         }
01759                         i__2 = l + 1;
01760                         aa = a[i__2].r;
01761 /*                    L(k+i+1,k+i+1) */
01762                         if (aa != 0.f) {
01763                             if (scale < aa) {
01764 /* Computing 2nd power */
01765                                 r__1 = scale / aa;
01766                                 s = s * (r__1 * r__1) + 1.f;
01767                                 scale = aa;
01768                             } else {
01769 /* Computing 2nd power */
01770                                 r__1 = aa / scale;
01771                                 s += r__1 * r__1;
01772                             }
01773                         }
01774                         l = l + lda + 1;
01775                     }
01776 /*                 L-> k - 1 + k*lda or L(k-1,k-1) at A(k-1,k) */
01777                     i__1 = l;
01778                     aa = a[i__1].r;
01779 /*                 L(k-1,k-1) at A(k-1,k) */
01780                     if (aa != 0.f) {
01781                         if (scale < aa) {
01782 /* Computing 2nd power */
01783                             r__1 = scale / aa;
01784                             s = s * (r__1 * r__1) + 1.f;
01785                             scale = aa;
01786                         } else {
01787 /* Computing 2nd power */
01788                             r__1 = aa / scale;
01789                             s += r__1 * r__1;
01790                         }
01791                     }
01792                 }
01793             }
01794         }
01795         value = scale * sqrt(s);
01796     }
01797 
01798     ret_val = value;
01799     return ret_val;
01800 
01801 /*     End of CLANHF */
01802 
01803 } /* clanhf_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:30