LAPACK  3.10.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.

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.```

Definition at line 139 of file zlantb.f.

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