LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
double precision function zlanhb ( character  NORM,
character  UPLO,
integer  N,
integer  K,
complex*16, dimension( ldab, * )  AB,
integer  LDAB,
double precision, dimension( * )  WORK 
)

ZLANHB 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 band matrix.

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

Purpose:
 ZLANHB  returns the value of the one norm,  or the Frobenius norm, or
 the  infinity norm,  or the element of  largest absolute value  of an
 n by n hermitian band matrix A,  with k super-diagonals.
Returns
ZLANHB
    ZLANHB = ( 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 ZLANHB as described
          above.
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          band matrix A is supplied.
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.  When N = 0, ZLANHB is
          set to zero.
[in]K
          K is INTEGER
          The number of super-diagonals or sub-diagonals of the
          band matrix A.  K >= 0.
[in]AB
          AB is COMPLEX*16 array, dimension (LDAB,N)
          The upper or lower triangle of the hermitian band matrix A,
          stored in the first K+1 rows of AB.  The j-th column of A is
          stored in the j-th column of the array AB as follows:
          if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
          if UPLO = 'L', AB(1+i-j,j)   = A(i,j) for j<=i<=min(n,j+k).
          Note that the imaginary parts of the diagonal elements need
          not be set and are assumed to be zero.
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= K+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 134 of file zlanhb.f.

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

Here is the call graph for this function: