1
REAL FUNCTION CLANHS( NORM, N, A, LDA, WORK )
3
* -- LAPACK auxiliary routine (version 2.0) --
4
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5
* Courant Institute, Argonne National Lab, and Rice University
8
* .. Scalar Arguments ..
12
* .. Array Arguments ..
20
* CLANHS returns the value of the one norm, or the Frobenius norm, or
21
* the infinity norm, or the element of largest absolute value of a
22
* Hessenberg matrix A.
27
* CLANHS returns the value
29
* CLANHS = ( max(abs(A(i,j))), NORM = 'M' or 'm'
31
* ( norm1(A), NORM = '1', 'O' or 'o'
33
* ( normI(A), NORM = 'I' or 'i'
35
* ( normF(A), NORM = 'F', 'f', 'E' or 'e'
37
* where norm1 denotes the one norm of a matrix (maximum column sum),
38
* normI denotes the infinity norm of a matrix (maximum row sum) and
39
* normF denotes the Frobenius norm of a matrix (square root of sum of
40
* squares). Note that max(abs(A(i,j))) is not a matrix norm.
45
* NORM (input) CHARACTER*1
46
* Specifies the value to be returned in CLANHS as described
50
* The order of the matrix A. N >= 0. When N = 0, CLANHS is
53
* A (input) COMPLEX array, dimension (LDA,N)
54
* The n by n upper Hessenberg matrix A; the part of A below the
55
* first sub-diagonal is not referenced.
58
* The leading dimension of the array A. LDA >= max(N,1).
60
* WORK (workspace) REAL array, dimension (LWORK),
61
* where LWORK >= N when NORM = 'I'; otherwise, WORK is not
64
* =====================================================================
68
PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
72
REAL SCALE, SUM, VALUE
74
* .. External Functions ..
78
* .. External Subroutines ..
81
* .. Intrinsic Functions ..
82
INTRINSIC ABS, MAX, MIN, SQRT
84
* .. Executable Statements ..
88
ELSE IF( LSAME( NORM, 'M' ) ) THEN
90
* Find max(abs(A(i,j))).
94
DO 10 I = 1, MIN( N, J+1 )
95
VALUE = MAX( VALUE, ABS( A( I, J ) ) )
98
ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
105
DO 30 I = 1, MIN( N, J+1 )
106
SUM = SUM + ABS( A( I, J ) )
108
VALUE = MAX( VALUE, SUM )
110
ELSE IF( LSAME( NORM, 'I' ) ) THEN
118
DO 60 I = 1, MIN( N, J+1 )
119
WORK( I ) = WORK( I ) + ABS( A( I, J ) )
124
VALUE = MAX( VALUE, WORK( I ) )
126
ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
133
CALL CLASSQ( MIN( N, J+1 ), A( 1, J ), 1, SCALE, SUM )
135
VALUE = SCALE*SQRT( SUM )