1 *> \brief \b DLANHS returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of an upper Hessenberg matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLANHS + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlanhs.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlanhs.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlanhs.f">
21 * DOUBLE PRECISION FUNCTION DLANHS( NORM, N, A, LDA, WORK )
23 * .. Scalar Arguments ..
27 * .. Array Arguments ..
28 * DOUBLE PRECISION A( LDA, * ), WORK( * )
37 *> DLANHS returns the value of the one norm, or the Frobenius norm, or
38 *> the infinity norm, or the element of largest absolute value of a
39 *> Hessenberg matrix A.
45 *> DLANHS = ( max(abs(A(i,j))), NORM = 'M' or 'm'
47 *> ( norm1(A), NORM = '1', 'O' or 'o'
49 *> ( normI(A), NORM = 'I' or 'i'
51 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
53 *> where norm1 denotes the one norm of a matrix (maximum column sum),
54 *> normI denotes the infinity norm of a matrix (maximum row sum) and
55 *> normF denotes the Frobenius norm of a matrix (square root of sum of
56 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
64 *> NORM is CHARACTER*1
65 *> Specifies the value to be returned in DLANHS as described
72 *> The order of the matrix A. N >= 0. When N = 0, DLANHS is
78 *> A is DOUBLE PRECISION array, dimension (LDA,N)
79 *> The n by n upper Hessenberg matrix A; the part of A below the
80 *> first sub-diagonal is not referenced.
86 *> The leading dimension of the array A. LDA >= max(N,1).
91 *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
92 *> where LWORK >= N when NORM = 'I'; otherwise, WORK is not
99 *> \author Univ. of Tennessee
100 *> \author Univ. of California Berkeley
101 *> \author Univ. of Colorado Denver
104 *> \date September 2012
106 *> \ingroup doubleOTHERauxiliary
108 * =====================================================================
109 DOUBLE PRECISION FUNCTION DLANHS( NORM, N, A, LDA, WORK )
111 * -- LAPACK auxiliary routine (version 3.4.2) --
112 * -- LAPACK is a software package provided by Univ. of Tennessee, --
113 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
116 * .. Scalar Arguments ..
120 * .. Array Arguments ..
121 DOUBLE PRECISION A( LDA, * ), WORK( * )
124 * =====================================================================
127 DOUBLE PRECISION ONE, ZERO
128 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
130 * .. Local Scalars ..
132 DOUBLE PRECISION SCALE, SUM, VALUE
134 * .. External Subroutines ..
137 * .. External Functions ..
138 LOGICAL LSAME, DISNAN
139 EXTERNAL LSAME, DISNAN
141 * .. Intrinsic Functions ..
142 INTRINSIC ABS, MIN, SQRT
144 * .. Executable Statements ..
148 ELSE IF( LSAME( NORM, 'M' ) ) THEN
150 * Find max(abs(A(i,j))).
154 DO 10 I = 1, MIN( N, J+1 )
155 SUM = ABS( A( I, J ) )
156 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
159 ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
166 DO 30 I = 1, MIN( N, J+1 )
167 SUM = SUM + ABS( A( I, J ) )
169 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
171 ELSE IF( LSAME( NORM, 'I' ) ) THEN
179 DO 60 I = 1, MIN( N, J+1 )
180 WORK( I ) = WORK( I ) + ABS( A( I, J ) )
186 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
188 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
195 CALL DLASSQ( MIN( N, J+1 ), A( 1, J ), 1, SCALE, SUM )
197 VALUE = SCALE*SQRT( SUM )