1
DOUBLE PRECISION FUNCTION ZLANHS( NORM, N, A, LDA, WORK )
3
* -- LAPACK auxiliary routine (version 3.1) --
4
* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
7
* .. Scalar Arguments ..
11
* .. Array Arguments ..
12
DOUBLE PRECISION WORK( * )
13
COMPLEX*16 A( LDA, * )
19
* ZLANHS returns the value of the one norm, or the Frobenius norm, or
20
* the infinity norm, or the element of largest absolute value of a
21
* Hessenberg matrix A.
26
* ZLANHS returns the value
28
* ZLANHS = ( max(abs(A(i,j))), NORM = 'M' or 'm'
30
* ( norm1(A), NORM = '1', 'O' or 'o'
32
* ( normI(A), NORM = 'I' or 'i'
34
* ( normF(A), NORM = 'F', 'f', 'E' or 'e'
36
* where norm1 denotes the one norm of a matrix (maximum column sum),
37
* normI denotes the infinity norm of a matrix (maximum row sum) and
38
* normF denotes the Frobenius norm of a matrix (square root of sum of
39
* squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
44
* NORM (input) CHARACTER*1
45
* Specifies the value to be returned in ZLANHS as described
49
* The order of the matrix A. N >= 0. When N = 0, ZLANHS is
52
* A (input) COMPLEX*16 array, dimension (LDA,N)
53
* The n by n upper Hessenberg matrix A; the part of A below the
54
* first sub-diagonal is not referenced.
57
* The leading dimension of the array A. LDA >= max(N,1).
59
* WORK (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
60
* where LWORK >= N when NORM = 'I'; otherwise, WORK is not
63
* =====================================================================
66
DOUBLE PRECISION ONE, ZERO
67
PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
71
DOUBLE PRECISION SCALE, SUM, VALUE
73
* .. External Functions ..
77
* .. External Subroutines ..
80
* .. Intrinsic Functions ..
81
INTRINSIC ABS, MAX, MIN, SQRT
83
* .. Executable Statements ..
87
ELSE IF( LSAME( NORM, 'M' ) ) THEN
89
* Find max(abs(A(i,j))).
93
DO 10 I = 1, MIN( N, J+1 )
94
VALUE = MAX( VALUE, ABS( A( I, J ) ) )
97
ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
104
DO 30 I = 1, MIN( N, J+1 )
105
SUM = SUM + ABS( A( I, J ) )
107
VALUE = MAX( VALUE, SUM )
109
ELSE IF( LSAME( NORM, 'I' ) ) THEN
117
DO 60 I = 1, MIN( N, J+1 )
118
WORK( I ) = WORK( I ) + ABS( A( I, J ) )
123
VALUE = MAX( VALUE, WORK( I ) )
125
ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
132
CALL ZLASSQ( MIN( N, J+1 ), A( 1, J ), 1, SCALE, SUM )
134
VALUE = SCALE*SQRT( SUM )