LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
double precision function zlanhe ( character  NORM,
character  UPLO,
integer  N,
complex*16, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( * )  WORK 
)

ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix.

Download ZLANHE + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ZLANHE  returns the value of the one norm,  or the Frobenius norm, or
 the  infinity norm,  or the  element of  largest absolute value  of a
 complex hermitian matrix A.
Returns
ZLANHE
    ZLANHE = ( max(abs(A(i,j))), NORM = 'M' or 'm'
             (
             ( norm1(A),         NORM = '1', 'O' or 'o'
             (
             ( normI(A),         NORM = 'I' or 'i'
             (
             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'

 where  norm1  denotes the  one norm of a matrix (maximum column sum),
 normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
 normF  denotes the  Frobenius norm of a matrix (square root of sum of
 squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
Parameters
[in]NORM
          NORM is CHARACTER*1
          Specifies the value to be returned in ZLANHE as described
          above.
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          hermitian matrix A is to be referenced.
          = 'U':  Upper triangular part of A is referenced
          = 'L':  Lower triangular part of A is referenced
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.  When N = 0, ZLANHE is
          set to zero.
[in]A
          A is COMPLEX*16 array, dimension (LDA,N)
          The hermitian matrix A.  If UPLO = 'U', the leading n by n
          upper triangular part of A contains the upper triangular part
          of the matrix A, and the strictly lower triangular part of A
          is not referenced.  If UPLO = 'L', the leading n by n lower
          triangular part of A contains the lower triangular part of
          the matrix A, and the strictly upper triangular part of A is
          not referenced. Note that the imaginary parts of the diagonal
          elements need not be set and are assumed to be zero.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(N,1).
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
          where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
          WORK is not referenced.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012

Definition at line 126 of file zlanhe.f.

126 *
127 * -- LAPACK auxiliary routine (version 3.4.2) --
128 * -- LAPACK is a software package provided by Univ. of Tennessee, --
129 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
130 * September 2012
131 *
132 * .. Scalar Arguments ..
133  CHARACTER norm, uplo
134  INTEGER lda, n
135 * ..
136 * .. Array Arguments ..
137  DOUBLE PRECISION work( * )
138  COMPLEX*16 a( lda, * )
139 * ..
140 *
141 * =====================================================================
142 *
143 * .. Parameters ..
144  DOUBLE PRECISION one, zero
145  parameter ( one = 1.0d+0, zero = 0.0d+0 )
146 * ..
147 * .. Local Scalars ..
148  INTEGER i, j
149  DOUBLE PRECISION absa, scale, sum, value
150 * ..
151 * .. External Functions ..
152  LOGICAL lsame, disnan
153  EXTERNAL lsame, disnan
154 * ..
155 * .. External Subroutines ..
156  EXTERNAL zlassq
157 * ..
158 * .. Intrinsic Functions ..
159  INTRINSIC abs, dble, sqrt
160 * ..
161 * .. Executable Statements ..
162 *
163  IF( n.EQ.0 ) THEN
164  VALUE = zero
165  ELSE IF( lsame( norm, 'M' ) ) THEN
166 *
167 * Find max(abs(A(i,j))).
168 *
169  VALUE = zero
170  IF( lsame( uplo, 'U' ) ) THEN
171  DO 20 j = 1, n
172  DO 10 i = 1, j - 1
173  sum = abs( a( i, j ) )
174  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
175  10 CONTINUE
176  sum = abs( dble( a( j, j ) ) )
177  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
178  20 CONTINUE
179  ELSE
180  DO 40 j = 1, n
181  sum = abs( dble( a( j, j ) ) )
182  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
183  DO 30 i = j + 1, n
184  sum = abs( a( i, j ) )
185  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
186  30 CONTINUE
187  40 CONTINUE
188  END IF
189  ELSE IF( ( lsame( norm, 'I' ) ) .OR. ( lsame( norm, 'O' ) ) .OR.
190  $ ( norm.EQ.'1' ) ) THEN
191 *
192 * Find normI(A) ( = norm1(A), since A is hermitian).
193 *
194  VALUE = zero
195  IF( lsame( uplo, 'U' ) ) THEN
196  DO 60 j = 1, n
197  sum = zero
198  DO 50 i = 1, j - 1
199  absa = abs( a( i, j ) )
200  sum = sum + absa
201  work( i ) = work( i ) + absa
202  50 CONTINUE
203  work( j ) = sum + abs( dble( a( j, j ) ) )
204  60 CONTINUE
205  DO 70 i = 1, n
206  sum = work( i )
207  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
208  70 CONTINUE
209  ELSE
210  DO 80 i = 1, n
211  work( i ) = zero
212  80 CONTINUE
213  DO 100 j = 1, n
214  sum = work( j ) + abs( dble( a( j, j ) ) )
215  DO 90 i = j + 1, n
216  absa = abs( a( i, j ) )
217  sum = sum + absa
218  work( i ) = work( i ) + absa
219  90 CONTINUE
220  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
221  100 CONTINUE
222  END IF
223  ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
224 *
225 * Find normF(A).
226 *
227  scale = zero
228  sum = one
229  IF( lsame( uplo, 'U' ) ) THEN
230  DO 110 j = 2, n
231  CALL zlassq( j-1, a( 1, j ), 1, scale, sum )
232  110 CONTINUE
233  ELSE
234  DO 120 j = 1, n - 1
235  CALL zlassq( n-j, a( j+1, j ), 1, scale, sum )
236  120 CONTINUE
237  END IF
238  sum = 2*sum
239  DO 130 i = 1, n
240  IF( dble( a( i, i ) ).NE.zero ) THEN
241  absa = abs( dble( a( i, i ) ) )
242  IF( scale.LT.absa ) THEN
243  sum = one + sum*( scale / absa )**2
244  scale = absa
245  ELSE
246  sum = sum + ( absa / scale )**2
247  END IF
248  END IF
249  130 CONTINUE
250  VALUE = scale*sqrt( sum )
251  END IF
252 *
253  zlanhe = VALUE
254  RETURN
255 *
256 * End of ZLANHE
257 *
logical function disnan(DIN)
DISNAN tests input for NaN.
Definition: disnan.f:61
double precision function zlanhe(NORM, UPLO, N, A, LDA, WORK)
ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix.
Definition: zlanhe.f:126
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
Definition: zlassq.f:108
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: