1 *> \brief \b DLANTB 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.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLANTB + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlantb.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlantb.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlantb.f">
21 * DOUBLE PRECISION FUNCTION DLANTB( NORM, UPLO, DIAG, N, K, AB,
24 * .. Scalar Arguments ..
25 * CHARACTER DIAG, NORM, UPLO
28 * .. Array Arguments ..
29 * DOUBLE PRECISION AB( LDAB, * ), WORK( * )
38 *> DLANTB returns the value of the one norm, or the Frobenius norm, or
39 *> the infinity norm, or the element of largest absolute value of an
40 *> n by n triangular band matrix A, with ( k + 1 ) diagonals.
46 *> DLANTB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
48 *> ( norm1(A), NORM = '1', 'O' or 'o'
50 *> ( normI(A), NORM = 'I' or 'i'
52 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
54 *> where norm1 denotes the one norm of a matrix (maximum column sum),
55 *> normI denotes the infinity norm of a matrix (maximum row sum) and
56 *> normF denotes the Frobenius norm of a matrix (square root of sum of
57 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
65 *> NORM is CHARACTER*1
66 *> Specifies the value to be returned in DLANTB as described
72 *> UPLO is CHARACTER*1
73 *> Specifies whether the matrix A is upper or lower triangular.
74 *> = 'U': Upper triangular
75 *> = 'L': Lower triangular
80 *> DIAG is CHARACTER*1
81 *> Specifies whether or not the matrix A is unit triangular.
82 *> = 'N': Non-unit triangular
83 *> = 'U': Unit triangular
89 *> The order of the matrix A. N >= 0. When N = 0, DLANTB is
96 *> The number of super-diagonals of the matrix A if UPLO = 'U',
97 *> or the number of sub-diagonals of the matrix A if UPLO = 'L'.
103 *> AB is DOUBLE PRECISION array, dimension (LDAB,N)
104 *> The upper or lower triangular band matrix A, stored in the
105 *> first k+1 rows of AB. The j-th column of A is stored
106 *> in the j-th column of the array AB as follows:
107 *> if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
108 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k).
109 *> Note that when DIAG = 'U', the elements of the array AB
110 *> corresponding to the diagonal elements of the matrix A are
111 *> not referenced, but are assumed to be one.
117 *> The leading dimension of the array AB. LDAB >= K+1.
122 *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
123 *> where LWORK >= N when NORM = 'I'; otherwise, WORK is not
130 *> \author Univ. of Tennessee
131 *> \author Univ. of California Berkeley
132 *> \author Univ. of Colorado Denver
135 *> \date September 2012
137 *> \ingroup doubleOTHERauxiliary
139 * =====================================================================
140 DOUBLE PRECISION FUNCTION DLANTB( NORM, UPLO, DIAG, N, K, AB,
143 * -- LAPACK auxiliary routine (version 3.4.2) --
144 * -- LAPACK is a software package provided by Univ. of Tennessee, --
145 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
148 * .. Scalar Arguments ..
149 CHARACTER DIAG, NORM, UPLO
152 * .. Array Arguments ..
153 DOUBLE PRECISION AB( LDAB, * ), WORK( * )
156 * =====================================================================
159 DOUBLE PRECISION ONE, ZERO
160 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
162 * .. Local Scalars ..
165 DOUBLE PRECISION SCALE, SUM, VALUE
167 * .. External Subroutines ..
170 * .. External Functions ..
171 LOGICAL LSAME, DISNAN
172 EXTERNAL LSAME, DISNAN
174 * .. Intrinsic Functions ..
175 INTRINSIC ABS, MAX, MIN, SQRT
177 * .. Executable Statements ..
181 ELSE IF( LSAME( NORM, 'M' ) ) THEN
183 * Find max(abs(A(i,j))).
185 IF( LSAME( DIAG, 'U' ) ) THEN
187 IF( LSAME( UPLO, 'U' ) ) THEN
189 DO 10 I = MAX( K+2-J, 1 ), K
190 SUM = ABS( AB( I, J ) )
191 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
196 DO 30 I = 2, MIN( N+1-J, K+1 )
197 SUM = ABS( AB( I, J ) )
198 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
204 IF( LSAME( UPLO, 'U' ) ) THEN
206 DO 50 I = MAX( K+2-J, 1 ), K + 1
207 SUM = ABS( AB( I, J ) )
208 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
213 DO 70 I = 1, MIN( N+1-J, K+1 )
214 SUM = ABS( AB( I, J ) )
215 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
220 ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
225 UDIAG = LSAME( DIAG, 'U' )
226 IF( LSAME( UPLO, 'U' ) ) THEN
230 DO 90 I = MAX( K+2-J, 1 ), K
231 SUM = SUM + ABS( AB( I, J ) )
235 DO 100 I = MAX( K+2-J, 1 ), K + 1
236 SUM = SUM + ABS( AB( I, J ) )
239 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
245 DO 120 I = 2, MIN( N+1-J, K+1 )
246 SUM = SUM + ABS( AB( I, J ) )
250 DO 130 I = 1, MIN( N+1-J, K+1 )
251 SUM = SUM + ABS( AB( I, J ) )
254 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
257 ELSE IF( LSAME( NORM, 'I' ) ) THEN
262 IF( LSAME( UPLO, 'U' ) ) THEN
263 IF( LSAME( DIAG, 'U' ) ) THEN
269 DO 160 I = MAX( 1, J-K ), J - 1
270 WORK( I ) = WORK( I ) + ABS( AB( L+I, J ) )
279 DO 190 I = MAX( 1, J-K ), J
280 WORK( I ) = WORK( I ) + ABS( AB( L+I, J ) )
285 IF( LSAME( DIAG, 'U' ) ) THEN
291 DO 220 I = J + 1, MIN( N, J+K )
292 WORK( I ) = WORK( I ) + ABS( AB( L+I, J ) )
301 DO 250 I = J, MIN( N, J+K )
302 WORK( I ) = WORK( I ) + ABS( AB( L+I, J ) )
309 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
311 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
315 IF( LSAME( UPLO, 'U' ) ) THEN
316 IF( LSAME( DIAG, 'U' ) ) THEN
321 CALL DLASSQ( MIN( J-1, K ),
322 $ AB( MAX( K+2-J, 1 ), J ), 1, SCALE,
330 CALL DLASSQ( MIN( J, K+1 ), AB( MAX( K+2-J, 1 ), J ),
335 IF( LSAME( DIAG, 'U' ) ) THEN
340 CALL DLASSQ( MIN( N-J, K ), AB( 2, J ), 1, SCALE,
348 CALL DLASSQ( MIN( N-J+1, K+1 ), AB( 1, J ), 1, SCALE,
353 VALUE = SCALE*SQRT( SUM )