1 *> \brief \b DLANGB returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of general band matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLANGB + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlangb.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlangb.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlangb.f">
21 * DOUBLE PRECISION FUNCTION DLANGB( NORM, N, KL, KU, AB, LDAB,
24 * .. Scalar Arguments ..
26 * INTEGER KL, KU, LDAB, N
28 * .. Array Arguments ..
29 * DOUBLE PRECISION AB( LDAB, * ), WORK( * )
38 *> DLANGB 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 band matrix A, with kl sub-diagonals and ku super-diagonals.
46 *> DLANGB = ( 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 DLANGB as described
73 *> The order of the matrix A. N >= 0. When N = 0, DLANGB is
80 *> The number of sub-diagonals of the matrix A. KL >= 0.
86 *> The number of super-diagonals of the matrix A. KU >= 0.
91 *> AB is DOUBLE PRECISION array, dimension (LDAB,N)
92 *> The band matrix A, stored in rows 1 to KL+KU+1. The j-th
93 *> column of A is stored in the j-th column of the array AB as
95 *> AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
101 *> The leading dimension of the array AB. LDAB >= KL+KU+1.
106 *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
107 *> where LWORK >= N when NORM = 'I'; otherwise, WORK is not
114 *> \author Univ. of Tennessee
115 *> \author Univ. of California Berkeley
116 *> \author Univ. of Colorado Denver
119 *> \date September 2012
121 *> \ingroup doubleGBauxiliary
123 * =====================================================================
124 DOUBLE PRECISION FUNCTION DLANGB( NORM, N, KL, KU, AB, LDAB,
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..--
132 * .. Scalar Arguments ..
134 INTEGER KL, KU, LDAB, N
136 * .. Array Arguments ..
137 DOUBLE PRECISION AB( LDAB, * ), WORK( * )
140 * =====================================================================
144 DOUBLE PRECISION ONE, ZERO
145 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
147 * .. Local Scalars ..
149 DOUBLE PRECISION SCALE, SUM, VALUE, TEMP
151 * .. External Subroutines ..
154 * .. External Functions ..
155 LOGICAL LSAME, DISNAN
156 EXTERNAL LSAME, DISNAN
158 * .. Intrinsic Functions ..
159 INTRINSIC ABS, MAX, MIN, SQRT
161 * .. Executable Statements ..
165 ELSE IF( LSAME( NORM, 'M' ) ) THEN
167 * Find max(abs(A(i,j))).
171 DO 10 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 )
172 TEMP = ABS( AB( I, J ) )
173 IF( VALUE.LT.TEMP .OR. DISNAN( TEMP ) ) VALUE = TEMP
176 ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
183 DO 30 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 )
184 SUM = SUM + ABS( AB( I, J ) )
186 IF( VALUE.LT.SUM .OR. DISNAN( SUM ) ) VALUE = SUM
188 ELSE IF( LSAME( NORM, 'I' ) ) THEN
197 DO 60 I = MAX( 1, J-KU ), MIN( N, J+KL )
198 WORK( I ) = WORK( I ) + ABS( AB( K+I, J ) )
204 IF( VALUE.LT.TEMP .OR. DISNAN( TEMP ) ) VALUE = TEMP
206 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
215 CALL DLASSQ( MIN( N, J+KL )-L+1, AB( K, J ), 1, SCALE, SUM )
217 VALUE = SCALE*SQRT( SUM )