LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zlantb()

double precision function zlantb ( character  NORM,
character  UPLO,
character  DIAG,
integer  N,
integer  K,
complex*16, dimension( ldab, * )  AB,
integer  LDAB,
double precision, dimension( * )  WORK 
)

ZLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular band matrix.

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

Purpose:
 ZLANTB  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 triangular band matrix A,  with ( k + 1 ) diagonals.
Returns
ZLANTB
    ZLANTB = ( 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 ZLANTB as described
          above.
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the matrix A is upper or lower triangular.
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]DIAG
          DIAG is CHARACTER*1
          Specifies whether or not the matrix A is unit triangular.
          = 'N':  Non-unit triangular
          = 'U':  Unit triangular
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.  When N = 0, ZLANTB is
          set to zero.
[in]K
          K is INTEGER
          The number of super-diagonals of the matrix A if UPLO = 'U',
          or the number of sub-diagonals of the matrix A if UPLO = 'L'.
          K >= 0.
[in]AB
          AB is COMPLEX*16 array, dimension (LDAB,N)
          The upper or lower triangular 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 when DIAG = 'U', the elements of the array AB
          corresponding to the diagonal elements of the matrix A are
          not referenced, but are assumed to be one.
[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'; otherwise, WORK is not
          referenced.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 143 of file zlantb.f.

143 *
144 * -- LAPACK auxiliary routine (version 3.7.0) --
145 * -- LAPACK is a software package provided by Univ. of Tennessee, --
146 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147 * December 2016
148 *
149 * .. Scalar Arguments ..
150  CHARACTER diag, norm, uplo
151  INTEGER k, ldab, n
152 * ..
153 * .. Array Arguments ..
154  DOUBLE PRECISION work( * )
155  COMPLEX*16 ab( ldab, * )
156 * ..
157 *
158 * =====================================================================
159 *
160 * .. Parameters ..
161  DOUBLE PRECISION one, zero
162  parameter( one = 1.0d+0, zero = 0.0d+0 )
163 * ..
164 * .. Local Scalars ..
165  LOGICAL udiag
166  INTEGER i, j, l
167  DOUBLE PRECISION scale, sum, value
168 * ..
169 * .. External Functions ..
170  LOGICAL lsame, disnan
171  EXTERNAL lsame, disnan
172 * ..
173 * .. External Subroutines ..
174  EXTERNAL zlassq
175 * ..
176 * .. Intrinsic Functions ..
177  INTRINSIC abs, max, min, sqrt
178 * ..
179 * .. Executable Statements ..
180 *
181  IF( n.EQ.0 ) THEN
182  VALUE = zero
183  ELSE IF( lsame( norm, 'M' ) ) THEN
184 *
185 * Find max(abs(A(i,j))).
186 *
187  IF( lsame( diag, 'U' ) ) THEN
188  VALUE = one
189  IF( lsame( uplo, 'U' ) ) THEN
190  DO 20 j = 1, n
191  DO 10 i = max( k+2-j, 1 ), k
192  sum = abs( ab( i, j ) )
193  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
194  10 CONTINUE
195  20 CONTINUE
196  ELSE
197  DO 40 j = 1, n
198  DO 30 i = 2, min( n+1-j, k+1 )
199  sum = abs( ab( i, j ) )
200  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
201  30 CONTINUE
202  40 CONTINUE
203  END IF
204  ELSE
205  VALUE = zero
206  IF( lsame( uplo, 'U' ) ) THEN
207  DO 60 j = 1, n
208  DO 50 i = max( k+2-j, 1 ), k + 1
209  sum = abs( ab( i, j ) )
210  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
211  50 CONTINUE
212  60 CONTINUE
213  ELSE
214  DO 80 j = 1, n
215  DO 70 i = 1, min( n+1-j, k+1 )
216  sum = abs( ab( i, j ) )
217  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
218  70 CONTINUE
219  80 CONTINUE
220  END IF
221  END IF
222  ELSE IF( ( lsame( norm, 'O' ) ) .OR. ( norm.EQ.'1' ) ) THEN
223 *
224 * Find norm1(A).
225 *
226  VALUE = zero
227  udiag = lsame( diag, 'U' )
228  IF( lsame( uplo, 'U' ) ) THEN
229  DO 110 j = 1, n
230  IF( udiag ) THEN
231  sum = one
232  DO 90 i = max( k+2-j, 1 ), k
233  sum = sum + abs( ab( i, j ) )
234  90 CONTINUE
235  ELSE
236  sum = zero
237  DO 100 i = max( k+2-j, 1 ), k + 1
238  sum = sum + abs( ab( i, j ) )
239  100 CONTINUE
240  END IF
241  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
242  110 CONTINUE
243  ELSE
244  DO 140 j = 1, n
245  IF( udiag ) THEN
246  sum = one
247  DO 120 i = 2, min( n+1-j, k+1 )
248  sum = sum + abs( ab( i, j ) )
249  120 CONTINUE
250  ELSE
251  sum = zero
252  DO 130 i = 1, min( n+1-j, k+1 )
253  sum = sum + abs( ab( i, j ) )
254  130 CONTINUE
255  END IF
256  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
257  140 CONTINUE
258  END IF
259  ELSE IF( lsame( norm, 'I' ) ) THEN
260 *
261 * Find normI(A).
262 *
263  VALUE = zero
264  IF( lsame( uplo, 'U' ) ) THEN
265  IF( lsame( diag, 'U' ) ) THEN
266  DO 150 i = 1, n
267  work( i ) = one
268  150 CONTINUE
269  DO 170 j = 1, n
270  l = k + 1 - j
271  DO 160 i = max( 1, j-k ), j - 1
272  work( i ) = work( i ) + abs( ab( l+i, j ) )
273  160 CONTINUE
274  170 CONTINUE
275  ELSE
276  DO 180 i = 1, n
277  work( i ) = zero
278  180 CONTINUE
279  DO 200 j = 1, n
280  l = k + 1 - j
281  DO 190 i = max( 1, j-k ), j
282  work( i ) = work( i ) + abs( ab( l+i, j ) )
283  190 CONTINUE
284  200 CONTINUE
285  END IF
286  ELSE
287  IF( lsame( diag, 'U' ) ) THEN
288  DO 210 i = 1, n
289  work( i ) = one
290  210 CONTINUE
291  DO 230 j = 1, n
292  l = 1 - j
293  DO 220 i = j + 1, min( n, j+k )
294  work( i ) = work( i ) + abs( ab( l+i, j ) )
295  220 CONTINUE
296  230 CONTINUE
297  ELSE
298  DO 240 i = 1, n
299  work( i ) = zero
300  240 CONTINUE
301  DO 260 j = 1, n
302  l = 1 - j
303  DO 250 i = j, min( n, j+k )
304  work( i ) = work( i ) + abs( ab( l+i, j ) )
305  250 CONTINUE
306  260 CONTINUE
307  END IF
308  END IF
309  DO 270 i = 1, n
310  sum = work( i )
311  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
312  270 CONTINUE
313  ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
314 *
315 * Find normF(A).
316 *
317  IF( lsame( uplo, 'U' ) ) THEN
318  IF( lsame( diag, 'U' ) ) THEN
319  scale = one
320  sum = n
321  IF( k.GT.0 ) THEN
322  DO 280 j = 2, n
323  CALL zlassq( min( j-1, k ),
324  $ ab( max( k+2-j, 1 ), j ), 1, scale,
325  $ sum )
326  280 CONTINUE
327  END IF
328  ELSE
329  scale = zero
330  sum = one
331  DO 290 j = 1, n
332  CALL zlassq( min( j, k+1 ), ab( max( k+2-j, 1 ), j ),
333  $ 1, scale, sum )
334  290 CONTINUE
335  END IF
336  ELSE
337  IF( lsame( diag, 'U' ) ) THEN
338  scale = one
339  sum = n
340  IF( k.GT.0 ) THEN
341  DO 300 j = 1, n - 1
342  CALL zlassq( min( n-j, k ), ab( 2, j ), 1, scale,
343  $ sum )
344  300 CONTINUE
345  END IF
346  ELSE
347  scale = zero
348  sum = one
349  DO 310 j = 1, n
350  CALL zlassq( min( n-j+1, k+1 ), ab( 1, j ), 1, scale,
351  $ sum )
352  310 CONTINUE
353  END IF
354  END IF
355  VALUE = scale*sqrt( sum )
356  END IF
357 *
358  zlantb = VALUE
359  RETURN
360 *
361 * End of ZLANTB
362 *
double precision function zlantb(NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)
ZLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular band matrix.
Definition: zlantb.f:143
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
Definition: zlassq.f:108
logical function disnan(DIN)
DISNAN tests input for NaN.
Definition: disnan.f:61
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
Here is the call graph for this function: