1 *> \brief \b ZLANHF returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hermitian matrix in RFP format.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLANHF + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlanhf.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlanhf.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlanhf.f">
21 * DOUBLE PRECISION FUNCTION ZLANHF( NORM, TRANSR, UPLO, N, A, WORK )
23 * .. Scalar Arguments ..
24 * CHARACTER NORM, TRANSR, UPLO
27 * .. Array Arguments ..
28 * DOUBLE PRECISION WORK( 0: * )
29 * COMPLEX*16 A( 0: * )
38 *> ZLANHF returns the value of the one norm, or the Frobenius norm, or
39 *> the infinity norm, or the element of largest absolute value of a
40 *> complex Hermitian matrix A in RFP format.
46 *> ZLANHF = ( max(abs(A(i,j))), NORM = 'M' or 'm'
48 *> ( norm1(A), NORM = '1', 'O' or 'o'
50 *> ( normI(A), NORM = 'I' or 'i'
52 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
54 *> where norm1 denotes the one norm of a matrix (maximum column sum),
55 *> normI denotes the infinity norm of a matrix (maximum row sum) and
56 *> normF denotes the Frobenius norm of a matrix (square root of sum of
57 *> squares). Note that max(abs(A(i,j))) is not a matrix norm.
66 *> Specifies the value to be returned in ZLANHF as described
72 *> TRANSR is CHARACTER
73 *> Specifies whether the RFP format of A is normal or
74 *> conjugate-transposed format.
75 *> = 'N': RFP format is Normal
76 *> = 'C': RFP format is Conjugate-transposed
82 *> On entry, UPLO specifies whether the RFP matrix A came from
83 *> an upper or lower triangular matrix as follows:
85 *> UPLO = 'U' or 'u' RFP A came from an upper triangular
88 *> UPLO = 'L' or 'l' RFP A came from a lower triangular
95 *> The order of the matrix A. N >= 0. When N = 0, ZLANHF is
101 *> A is COMPLEX*16 array, dimension ( N*(N+1)/2 );
102 *> On entry, the matrix A in RFP Format.
103 *> RFP Format is described by TRANSR, UPLO and N as follows:
104 *> If TRANSR='N' then RFP A is (0:N,0:K-1) when N is even;
105 *> K=N/2. RFP A is (0:N-1,0:K) when N is odd; K=N/2. If
106 *> TRANSR = 'C' then RFP is the Conjugate-transpose of RFP A
107 *> as defined when TRANSR = 'N'. The contents of RFP A are
108 *> defined by UPLO as follows: If UPLO = 'U' the RFP A
109 *> contains the ( N*(N+1)/2 ) elements of upper packed A
110 *> either in normal or conjugate-transpose Format. If
111 *> UPLO = 'L' the RFP A contains the ( N*(N+1) /2 ) elements
112 *> of lower packed A either in normal or conjugate-transpose
113 *> Format. The LDA of RFP A is (N+1)/2 when TRANSR = 'C'. When
114 *> TRANSR is 'N' the LDA is N+1 when N is even and is N when
115 *> is odd. See the Note below for more details.
116 *> Unchanged on exit.
121 *> WORK is DOUBLE PRECISION array, dimension (LWORK),
122 *> where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
123 *> WORK is not referenced.
129 *> \author Univ. of Tennessee
130 *> \author Univ. of California Berkeley
131 *> \author Univ. of Colorado Denver
134 *> \date November 2015
136 *> \ingroup complex16OTHERcomputational
138 *> \par Further Details:
139 * =====================
143 *> We first consider Standard Packed Format when N is even.
144 *> We give an example where N = 6.
146 *> AP is Upper AP is Lower
148 *> 00 01 02 03 04 05 00
149 *> 11 12 13 14 15 10 11
150 *> 22 23 24 25 20 21 22
151 *> 33 34 35 30 31 32 33
152 *> 44 45 40 41 42 43 44
153 *> 55 50 51 52 53 54 55
156 *> Let TRANSR = 'N'. RFP holds AP as follows:
157 *> For UPLO = 'U' the upper trapezoid A(0:5,0:2) consists of the last
158 *> three columns of AP upper. The lower triangle A(4:6,0:2) consists of
159 *> conjugate-transpose of the first three columns of AP upper.
160 *> For UPLO = 'L' the lower trapezoid A(1:6,0:2) consists of the first
161 *> three columns of AP lower. The upper triangle A(0:2,0:2) consists of
162 *> conjugate-transpose of the last three columns of AP lower.
163 *> To denote conjugate we place -- above the element. This covers the
164 *> case N even and TRANSR = 'N'.
183 *> Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate-
184 *> transpose of RFP A above. One therefore gets:
189 *> -- -- -- -- -- -- -- -- -- --
190 *> 03 13 23 33 00 01 02 33 00 10 20 30 40 50
191 *> -- -- -- -- -- -- -- -- -- --
192 *> 04 14 24 34 44 11 12 43 44 11 21 31 41 51
193 *> -- -- -- -- -- -- -- -- -- --
194 *> 05 15 25 35 45 55 22 53 54 55 22 32 42 52
197 *> We next consider Standard Packed Format when N is odd.
198 *> We give an example where N = 5.
200 *> AP is Upper AP is Lower
209 *> Let TRANSR = 'N'. RFP holds AP as follows:
210 *> For UPLO = 'U' the upper trapezoid A(0:4,0:2) consists of the last
211 *> three columns of AP upper. The lower triangle A(3:4,0:1) consists of
212 *> conjugate-transpose of the first two columns of AP upper.
213 *> For UPLO = 'L' the lower trapezoid A(0:4,0:2) consists of the first
214 *> three columns of AP lower. The upper triangle A(0:1,1:2) consists of
215 *> conjugate-transpose of the last two columns of AP lower.
216 *> To denote conjugate we place -- above the element. This covers the
217 *> case N odd and TRANSR = 'N'.
232 *> Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate-
233 *> transpose of RFP A above. One therefore gets:
238 *> -- -- -- -- -- -- -- -- --
239 *> 02 12 22 00 01 00 10 20 30 40 50
240 *> -- -- -- -- -- -- -- -- --
241 *> 03 13 23 33 11 33 11 21 31 41 51
242 *> -- -- -- -- -- -- -- -- --
243 *> 04 14 24 34 44 43 44 22 32 42 52
246 * =====================================================================
247 DOUBLE PRECISION FUNCTION ZLANHF( NORM, TRANSR, UPLO, N, A, WORK )
249 * -- LAPACK computational routine (version 3.6.0) --
250 * -- LAPACK is a software package provided by Univ. of Tennessee, --
251 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
254 * .. Scalar Arguments ..
255 CHARACTER NORM, TRANSR, UPLO
258 * .. Array Arguments ..
259 DOUBLE PRECISION WORK( 0: * )
263 * =====================================================================
266 DOUBLE PRECISION ONE, ZERO
267 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
269 * .. Local Scalars ..
270 INTEGER I, J, IFM, ILU, NOE, N1, K, L, LDA
271 DOUBLE PRECISION SCALE, S, VALUE, AA, TEMP
273 * .. External Functions ..
274 LOGICAL LSAME, DISNAN
275 EXTERNAL LSAME, DISNAN
277 * .. External Subroutines ..
280 * .. Intrinsic Functions ..
281 INTRINSIC ABS, DBLE, SQRT
283 * .. Executable Statements ..
288 ELSE IF( N.EQ.1 ) THEN
289 ZLANHF = ABS(DBLE(A(0)))
293 * set noe = 1 if n is odd. if n is even set noe=0
296 IF( MOD( N, 2 ).EQ.0 )
299 * set ifm = 0 when form='C' or 'c' and 1 otherwise
302 IF( LSAME( TRANSR, 'C' ) )
305 * set ilu = 0 when uplo='U or 'u' and 1 otherwise
308 IF( LSAME( UPLO, 'U' ) )
311 * set lda = (n+1)/2 when ifm = 0
312 * set lda = n when ifm = 1 and noe = 1
313 * set lda = n+1 when ifm = 1 and noe = 0
327 IF( LSAME( NORM, 'M' ) ) THEN
329 * Find max(abs(A(i,j))).
334 * n is odd & n = k + k - 1
341 TEMP = ABS( DBLE( A( J+J*LDA ) ) )
342 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
345 TEMP = ABS( A( I+J*LDA ) )
346 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
351 TEMP = ABS( A( I+J*LDA ) )
352 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
357 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
358 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
362 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
363 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
366 TEMP = ABS( A( I+J*LDA ) )
367 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
375 TEMP = ABS( A( I+J*LDA ) )
376 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
381 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
382 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
386 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
387 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
389 DO I = K + J + 1, N - 1
390 TEMP = ABS( A( I+J*LDA ) )
391 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
396 TEMP = ABS( A( I+J*LDA ) )
397 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
401 * i=n-1 -> U(n-1,n-1)
402 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
403 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
407 * xpose case; A is k by n
412 TEMP = ABS( A( I+J*LDA ) )
413 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
418 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
419 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
423 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
424 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
427 TEMP = ABS( A( I+J*LDA ) )
428 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
434 TEMP = ABS( A( I+J*LDA ) )
435 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
439 * -> L(i,i) is at A(i,j)
440 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
441 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
445 TEMP = ABS( A( I+J*LDA ) )
446 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
454 TEMP = ABS( A( I+J*LDA ) )
455 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
460 * -> U(j,j) is at A(0,j)
461 TEMP = ABS( DBLE( A( 0+J*LDA ) ) )
462 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
465 TEMP = ABS( A( I+J*LDA ) )
466 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
471 TEMP = ABS( A( I+J*LDA ) )
472 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
476 * -> U(i,i) at A(i,j)
477 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
478 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
482 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
483 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
485 DO I = J - K + 2, K - 1
486 TEMP = ABS( A( I+J*LDA ) )
487 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
494 * n is even & k = n/2
500 * -> L(k,k) & j=1 -> L(0,0)
501 TEMP = ABS( DBLE( A( J+J*LDA ) ) )
502 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
504 TEMP = ABS( DBLE( A( J+1+J*LDA ) ) )
505 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
508 TEMP = ABS( A( I+J*LDA ) )
509 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
514 TEMP = ABS( A( I+J*LDA ) )
515 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
520 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
521 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
525 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
526 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
529 TEMP = ABS( A( I+J*LDA ) )
530 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
538 TEMP = ABS( A( I+J*LDA ) )
539 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
544 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
545 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
548 * =k+j+1; i -> U(j,j)
549 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
550 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
553 TEMP = ABS( A( I+J*LDA ) )
554 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
559 TEMP = ABS( A( I+J*LDA ) )
560 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
564 * i=n-1 -> U(n-1,n-1)
565 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
566 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
570 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
571 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
575 * xpose case; A is k by n+1
579 * -> L(k,k) at A(0,0)
580 TEMP = ABS( DBLE( A( J+J*LDA ) ) )
581 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
584 TEMP = ABS( A( I+J*LDA ) )
585 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
590 TEMP = ABS( A( I+J*LDA ) )
591 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
596 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
597 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
601 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
602 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
605 TEMP = ABS( A( I+J*LDA ) )
606 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
612 TEMP = ABS( A( I+J*LDA ) )
613 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
617 * -> L(i,i) is at A(i,j)
618 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
619 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
623 TEMP = ABS( A( I+J*LDA ) )
624 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
632 TEMP = ABS( A( I+J*LDA ) )
633 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
638 * -> U(j,j) is at A(0,j)
639 TEMP = ABS( DBLE( A( 0+J*LDA ) ) )
640 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
643 TEMP = ABS( A( I+J*LDA ) )
644 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
649 TEMP = ABS( A( I+J*LDA ) )
650 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
654 * -> U(i,i) at A(i,j)
655 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
656 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
660 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
661 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
663 DO I = J - K + 1, K - 1
664 TEMP = ABS( A( I+J*LDA ) )
665 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
671 TEMP = ABS( A( I+J*LDA ) )
672 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
677 TEMP = ABS( DBLE( A( I+J*LDA ) ) )
678 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
683 ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR.
684 $ ( NORM.EQ.'1' ) ) THEN
686 * Find normI(A) ( = norm1(A), since A is Hermitian).
692 * n is odd & A is n by (n+1)/2
701 AA = ABS( A( I+J*LDA ) )
704 WORK( I ) = WORK( I ) + AA
706 AA = ABS( DBLE( A( I+J*LDA ) ) )
712 AA = ABS( DBLE( A( I+J*LDA ) ) )
714 WORK( J ) = WORK( J ) + AA
718 AA = ABS( A( I+J*LDA ) )
721 WORK( L ) = WORK( L ) + AA
723 WORK( J ) = WORK( J ) + S
729 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
733 * ilu = 1 & uplo = 'L'
735 * k=(n+1)/2 for n odd and ilu=1
742 AA = ABS( A( I+J*LDA ) )
745 WORK( I+K ) = WORK( I+K ) + AA
748 AA = ABS( DBLE( A( I+J*LDA ) ) )
751 WORK( I+K ) = WORK( I+K ) + S
755 AA = ABS( DBLE( A( I+J*LDA ) ) )
761 AA = ABS( A( I+J*LDA ) )
764 WORK( L ) = WORK( L ) + AA
766 WORK( J ) = WORK( J ) + S
771 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
776 * n is even & A is n+1 by k = n/2
785 AA = ABS( A( I+J*LDA ) )
788 WORK( I ) = WORK( I ) + AA
790 AA = ABS( DBLE( A( I+J*LDA ) ) )
794 AA = ABS( DBLE( A( I+J*LDA ) ) )
796 WORK( J ) = WORK( J ) + AA
800 AA = ABS( A( I+J*LDA ) )
803 WORK( L ) = WORK( L ) + AA
805 WORK( J ) = WORK( J ) + S
810 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
814 * ilu = 1 & uplo = 'L'
821 AA = ABS( A( I+J*LDA ) )
824 WORK( I+K ) = WORK( I+K ) + AA
826 AA = ABS( DBLE( A( I+J*LDA ) ) )
829 WORK( I+K ) = WORK( I+K ) + S
832 AA = ABS( DBLE( A( I+J*LDA ) ) )
838 AA = ABS( A( I+J*LDA ) )
841 WORK( L ) = WORK( L ) + AA
843 WORK( J ) = WORK( J ) + S
848 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
857 * n is odd & A is (n+1)/2 by n
863 * k is the row size and lda
870 AA = ABS( A( I+J*LDA ) )
872 WORK( I+N1 ) = WORK( I+N1 ) + AA
877 * j=n1=k-1 is special
878 S = ABS( DBLE( A( 0+J*LDA ) ) )
881 AA = ABS( A( I+J*LDA ) )
883 WORK( I+N1 ) = WORK( I+N1 ) + AA
886 WORK( J ) = WORK( J ) + S
890 AA = ABS( A( I+J*LDA ) )
892 WORK( I ) = WORK( I ) + AA
896 AA = ABS( DBLE( A( I+J*LDA ) ) )
899 WORK( J-K ) = WORK( J-K ) + S
901 S = ABS( DBLE( A( I+J*LDA ) ) )
905 AA = ABS( A( I+J*LDA ) )
907 WORK( L ) = WORK( L ) + AA
910 WORK( J ) = WORK( J ) + S
915 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
921 * k=(n+1)/2 for n odd and ilu=1
929 AA = ABS( A( I+J*LDA ) )
931 WORK( I ) = WORK( I ) + AA
934 AA = ABS( DBLE( A( I+J*LDA ) ) )
935 * i=j so process of A(j,j)
938 * is initialised here
940 * i=j process A(j+k,j+k)
941 AA = ABS( DBLE( A( I+J*LDA ) ) )
943 DO L = K + J + 1, N - 1
945 AA = ABS( A( I+J*LDA ) )
948 WORK( L ) = WORK( L ) + AA
950 WORK( K+J ) = WORK( K+J ) + S
952 * j=k-1 is special :process col A(k-1,0:k-1)
955 AA = ABS( A( I+J*LDA ) )
957 WORK( I ) = WORK( I ) + AA
961 AA = ABS( DBLE( A( I+J*LDA ) ) )
965 * done with col j=k+1
967 * process col j of A = A(j,0:k-1)
970 AA = ABS( A( I+J*LDA ) )
972 WORK( I ) = WORK( I ) + AA
975 WORK( J ) = WORK( J ) + S
980 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
985 * n is even & A is k=n/2 by n+1
994 AA = ABS( A( I+J*LDA ) )
996 WORK( I+K ) = WORK( I+K ) + AA
1002 AA = ABS( DBLE( A( 0+J*LDA ) ) )
1006 AA = ABS( A( I+J*LDA ) )
1008 WORK( I+K ) = WORK( I+K ) + AA
1011 WORK( J ) = WORK( J ) + S
1015 AA = ABS( A( I+J*LDA ) )
1017 WORK( I ) = WORK( I ) + AA
1021 AA = ABS( DBLE( A( I+J*LDA ) ) )
1024 WORK( J-K-1 ) = WORK( J-K-1 ) + S
1026 AA = ABS( DBLE( A( I+J*LDA ) ) )
1031 AA = ABS( A( I+J*LDA ) )
1033 WORK( L ) = WORK( L ) + AA
1036 WORK( J ) = WORK( J ) + S
1041 AA = ABS( A( I+J*LDA ) )
1043 WORK( I ) = WORK( I ) + AA
1047 AA = ABS( DBLE( A( I+J*LDA ) ) )
1050 WORK( I ) = WORK( I ) + S
1054 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
1058 * ilu=1 & uplo = 'L'
1062 * j=0 is special :process col A(k:n-1,k)
1063 S = ABS( DBLE( A( 0 ) ) )
1068 WORK( I+K ) = WORK( I+K ) + AA
1071 WORK( K ) = WORK( K ) + S
1076 AA = ABS( A( I+J*LDA ) )
1078 WORK( I ) = WORK( I ) + AA
1081 AA = ABS( DBLE( A( I+J*LDA ) ) )
1082 * i=j-1 so process of A(j-1,j-1)
1085 * is initialised here
1087 * i=j process A(j+k,j+k)
1088 AA = ABS( DBLE( A( I+J*LDA ) ) )
1090 DO L = K + J + 1, N - 1
1092 AA = ABS( A( I+J*LDA ) )
1095 WORK( L ) = WORK( L ) + AA
1097 WORK( K+J ) = WORK( K+J ) + S
1099 * j=k is special :process col A(k,0:k-1)
1102 AA = ABS( A( I+J*LDA ) )
1104 WORK( I ) = WORK( I ) + AA
1109 AA = ABS( DBLE( A( I+J*LDA ) ) )
1113 * done with col j=k+1
1116 * process col j-1 of A = A(j-1,0:k-1)
1119 AA = ABS( A( I+J*LDA ) )
1121 WORK( I ) = WORK( I ) + AA
1124 WORK( J-1 ) = WORK( J-1 ) + S
1129 IF( VALUE .LT. TEMP .OR. DISNAN( TEMP ) )
1135 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
1145 * A is normal & A is n by k
1149 CALL ZLASSQ( K-J-2, A( K+J+1+J*LDA ), 1, SCALE, S )
1153 CALL ZLASSQ( K+J-1, A( 0+J*LDA ), 1, SCALE, S )
1157 * double s for the off diagonal elements
1159 * -> U(k,k) at A(k-1,0)
1163 IF( AA.NE.ZERO ) THEN
1164 IF( SCALE.LT.AA ) THEN
1165 S = ONE + S*( SCALE / AA )**2
1168 S = S + ( AA / SCALE )**2
1171 AA = DBLE( A( L+1 ) )
1173 IF( AA.NE.ZERO ) THEN
1174 IF( SCALE.LT.AA ) THEN
1175 S = ONE + S*( SCALE / AA )**2
1178 S = S + ( AA / SCALE )**2
1185 IF( AA.NE.ZERO ) THEN
1186 IF( SCALE.LT.AA ) THEN
1187 S = ONE + S*( SCALE / AA )**2
1190 S = S + ( AA / SCALE )**2
1194 * ilu=1 & A is lower
1196 CALL ZLASSQ( N-J-1, A( J+1+J*LDA ), 1, SCALE, S )
1200 CALL ZLASSQ( J, A( 0+( 1+J )*LDA ), 1, SCALE, S )
1204 * double s for the off diagonal elements
1207 IF( AA.NE.ZERO ) THEN
1208 IF( SCALE.LT.AA ) THEN
1209 S = ONE + S*( SCALE / AA )**2
1212 S = S + ( AA / SCALE )**2
1216 * -> L(k,k) at A(0,1)
1220 IF( AA.NE.ZERO ) THEN
1221 IF( SCALE.LT.AA ) THEN
1222 S = ONE + S*( SCALE / AA )**2
1225 S = S + ( AA / SCALE )**2
1228 AA = DBLE( A( L+1 ) )
1230 IF( AA.NE.ZERO ) THEN
1231 IF( SCALE.LT.AA ) THEN
1232 S = ONE + S*( SCALE / AA )**2
1235 S = S + ( AA / SCALE )**2
1242 * A is xpose & A is k by n
1246 CALL ZLASSQ( J, A( 0+( K+J )*LDA ), 1, SCALE, S )
1250 CALL ZLASSQ( K, A( 0+J*LDA ), 1, SCALE, S )
1251 * k by k-1 rect. at A(0,0)
1254 CALL ZLASSQ( K-J-1, A( J+1+( J+K-1 )*LDA ), 1,
1259 * double s for the off diagonal elements
1261 * -> U(k-1,k-1) at A(0,k-1)
1264 IF( AA.NE.ZERO ) THEN
1265 IF( SCALE.LT.AA ) THEN
1266 S = ONE + S*( SCALE / AA )**2
1269 S = S + ( AA / SCALE )**2
1273 * -> U(0,0) at A(0,k)
1277 IF( AA.NE.ZERO ) THEN
1278 IF( SCALE.LT.AA ) THEN
1279 S = ONE + S*( SCALE / AA )**2
1282 S = S + ( AA / SCALE )**2
1285 AA = DBLE( A( L+1 ) )
1287 IF( AA.NE.ZERO ) THEN
1288 IF( SCALE.LT.AA ) THEN
1289 S = ONE + S*( SCALE / AA )**2
1292 S = S + ( AA / SCALE )**2
1300 CALL ZLASSQ( J, A( 0+J*LDA ), 1, SCALE, S )
1304 CALL ZLASSQ( K, A( 0+J*LDA ), 1, SCALE, S )
1305 * k by k-1 rect. at A(0,k)
1308 CALL ZLASSQ( K-J-2, A( J+2+J*LDA ), 1, SCALE, S )
1312 * double s for the off diagonal elements
1314 * -> L(0,0) at A(0,0)
1318 IF( AA.NE.ZERO ) THEN
1319 IF( SCALE.LT.AA ) THEN
1320 S = ONE + S*( SCALE / AA )**2
1323 S = S + ( AA / SCALE )**2
1326 AA = DBLE( A( L+1 ) )
1328 IF( AA.NE.ZERO ) THEN
1329 IF( SCALE.LT.AA ) THEN
1330 S = ONE + S*( SCALE / AA )**2
1333 S = S + ( AA / SCALE )**2
1338 * L-> k-1 + (k-1)*lda or L(k-1,k-1) at A(k-1,k-1)
1340 * L(k-1,k-1) at A(k-1,k-1)
1341 IF( AA.NE.ZERO ) THEN
1342 IF( SCALE.LT.AA ) THEN
1343 S = ONE + S*( SCALE / AA )**2
1346 S = S + ( AA / SCALE )**2
1358 CALL ZLASSQ( K-J-1, A( K+J+2+J*LDA ), 1, SCALE, S )
1362 CALL ZLASSQ( K+J, A( 0+J*LDA ), 1, SCALE, S )
1366 * double s for the off diagonal elements
1368 * -> U(k,k) at A(k,0)
1372 IF( AA.NE.ZERO ) THEN
1373 IF( SCALE.LT.AA ) THEN
1374 S = ONE + S*( SCALE / AA )**2
1377 S = S + ( AA / SCALE )**2
1380 AA = DBLE( A( L+1 ) )
1382 IF( AA.NE.ZERO ) THEN
1383 IF( SCALE.LT.AA ) THEN
1384 S = ONE + S*( SCALE / AA )**2
1387 S = S + ( AA / SCALE )**2
1393 * ilu=1 & A is lower
1395 CALL ZLASSQ( N-J-1, A( J+2+J*LDA ), 1, SCALE, S )
1399 CALL ZLASSQ( J, A( 0+J*LDA ), 1, SCALE, S )
1403 * double s for the off diagonal elements
1405 * -> L(k,k) at A(0,0)
1409 IF( AA.NE.ZERO ) THEN
1410 IF( SCALE.LT.AA ) THEN
1411 S = ONE + S*( SCALE / AA )**2
1414 S = S + ( AA / SCALE )**2
1417 AA = DBLE( A( L+1 ) )
1419 IF( AA.NE.ZERO ) THEN
1420 IF( SCALE.LT.AA ) THEN
1421 S = ONE + S*( SCALE / AA )**2
1424 S = S + ( AA / SCALE )**2
1435 CALL ZLASSQ( J, A( 0+( K+1+J )*LDA ), 1, SCALE, S )
1439 CALL ZLASSQ( K, A( 0+J*LDA ), 1, SCALE, S )
1440 * k by k rect. at A(0,0)
1443 CALL ZLASSQ( K-J-1, A( J+1+( J+K )*LDA ), 1, SCALE,
1448 * double s for the off diagonal elements
1450 * -> U(k,k) at A(0,k)
1453 IF( AA.NE.ZERO ) THEN
1454 IF( SCALE.LT.AA ) THEN
1455 S = ONE + S*( SCALE / AA )**2
1458 S = S + ( AA / SCALE )**2
1462 * -> U(0,0) at A(0,k+1)
1466 IF( AA.NE.ZERO ) THEN
1467 IF( SCALE.LT.AA ) THEN
1468 S = ONE + S*( SCALE / AA )**2
1471 S = S + ( AA / SCALE )**2
1474 AA = DBLE( A( L+1 ) )
1476 IF( AA.NE.ZERO ) THEN
1477 IF( SCALE.LT.AA ) THEN
1478 S = ONE + S*( SCALE / AA )**2
1481 S = S + ( AA / SCALE )**2
1487 * -> U(k-1,k-1) at A(k-1,n)
1490 IF( AA.NE.ZERO ) THEN
1491 IF( SCALE.LT.AA ) THEN
1492 S = ONE + S*( SCALE / AA )**2
1495 S = S + ( AA / SCALE )**2
1501 CALL ZLASSQ( J, A( 0+( J+1 )*LDA ), 1, SCALE, S )
1505 CALL ZLASSQ( K, A( 0+J*LDA ), 1, SCALE, S )
1506 * k by k rect. at A(0,k+1)
1509 CALL ZLASSQ( K-J-1, A( J+1+J*LDA ), 1, SCALE, S )
1513 * double s for the off diagonal elements
1515 * -> L(k,k) at A(0,0)
1518 IF( AA.NE.ZERO ) THEN
1519 IF( SCALE.LT.AA ) THEN
1520 S = ONE + S*( SCALE / AA )**2
1523 S = S + ( AA / SCALE )**2
1527 * -> L(0,0) at A(0,1)
1531 IF( AA.NE.ZERO ) THEN
1532 IF( SCALE.LT.AA ) THEN
1533 S = ONE + S*( SCALE / AA )**2
1536 S = S + ( AA / SCALE )**2
1539 AA = DBLE( A( L+1 ) )
1541 IF( AA.NE.ZERO ) THEN
1542 IF( SCALE.LT.AA ) THEN
1543 S = ONE + S*( SCALE / AA )**2
1546 S = S + ( AA / SCALE )**2
1551 * L-> k - 1 + k*lda or L(k-1,k-1) at A(k-1,k)
1553 * L(k-1,k-1) at A(k-1,k)
1554 IF( AA.NE.ZERO ) THEN
1555 IF( SCALE.LT.AA ) THEN
1556 S = ONE + S*( SCALE / AA )**2
1559 S = S + ( AA / SCALE )**2
1565 VALUE = SCALE*SQRT( S )