1 *> \brief \b ZLANSB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric band matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLANSB + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlansb.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlansb.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlansb.f">
21 * DOUBLE PRECISION FUNCTION ZLANSB( NORM, UPLO, N, K, AB, LDAB,
24 * .. Scalar Arguments ..
25 * CHARACTER NORM, UPLO
28 * .. Array Arguments ..
29 * DOUBLE PRECISION WORK( * )
30 * COMPLEX*16 AB( LDAB, * )
39 *> ZLANSB returns the value of the one norm, or the Frobenius norm, or
40 *> the infinity norm, or the element of largest absolute value of an
41 *> n by n symmetric band matrix A, with k super-diagonals.
47 *> ZLANSB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
49 *> ( norm1(A), NORM = '1', 'O' or 'o'
51 *> ( normI(A), NORM = 'I' or 'i'
53 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
55 *> where norm1 denotes the one norm of a matrix (maximum column sum),
56 *> normI denotes the infinity norm of a matrix (maximum row sum) and
57 *> normF denotes the Frobenius norm of a matrix (square root of sum of
58 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
66 *> NORM is CHARACTER*1
67 *> Specifies the value to be returned in ZLANSB as described
73 *> UPLO is CHARACTER*1
74 *> Specifies whether the upper or lower triangular part of the
75 *> band matrix A is supplied.
76 *> = 'U': Upper triangular part is supplied
77 *> = 'L': Lower triangular part is supplied
83 *> The order of the matrix A. N >= 0. When N = 0, ZLANSB is
90 *> The number of super-diagonals or sub-diagonals of the
91 *> band matrix A. K >= 0.
96 *> AB is COMPLEX*16 array, dimension (LDAB,N)
97 *> The upper or lower triangle of the symmetric band matrix A,
98 *> stored in the first K+1 rows of AB. The j-th column of A is
99 *> stored in the j-th column of the array AB as follows:
100 *> if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
101 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k).
107 *> The leading dimension of the array AB. LDAB >= K+1.
112 *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
113 *> where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
114 *> WORK is not referenced.
120 *> \author Univ. of Tennessee
121 *> \author Univ. of California Berkeley
122 *> \author Univ. of Colorado Denver
125 *> \date September 2012
127 *> \ingroup complex16OTHERauxiliary
129 * =====================================================================
130 DOUBLE PRECISION FUNCTION ZLANSB( NORM, UPLO, N, K, AB, LDAB,
133 * -- LAPACK auxiliary routine (version 3.4.2) --
134 * -- LAPACK is a software package provided by Univ. of Tennessee, --
135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
138 * .. Scalar Arguments ..
142 * .. Array Arguments ..
143 DOUBLE PRECISION WORK( * )
144 COMPLEX*16 AB( LDAB, * )
147 * =====================================================================
150 DOUBLE PRECISION ONE, ZERO
151 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
153 * .. Local Scalars ..
155 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
157 * .. External Functions ..
158 LOGICAL LSAME, DISNAN
159 EXTERNAL LSAME, DISNAN
161 * .. External Subroutines ..
164 * .. Intrinsic Functions ..
165 INTRINSIC ABS, MAX, MIN, SQRT
167 * .. Executable Statements ..
171 ELSE IF( LSAME( NORM, 'M' ) ) THEN
173 * Find max(abs(A(i,j))).
176 IF( LSAME( UPLO, 'U' ) ) THEN
178 DO 10 I = MAX( K+2-J, 1 ), K + 1
179 SUM = ABS( AB( I, J ) )
180 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
185 DO 30 I = 1, MIN( N+1-J, K+1 )
186 SUM = ABS( AB( I, J ) )
187 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
191 ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR.
192 $ ( NORM.EQ.'1' ) ) THEN
194 * Find normI(A) ( = norm1(A), since A is symmetric).
197 IF( LSAME( UPLO, 'U' ) ) THEN
201 DO 50 I = MAX( 1, J-K ), J - 1
202 ABSA = ABS( AB( L+I, J ) )
204 WORK( I ) = WORK( I ) + ABSA
206 WORK( J ) = SUM + ABS( AB( K+1, J ) )
210 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
217 SUM = WORK( J ) + ABS( AB( 1, J ) )
219 DO 90 I = J + 1, MIN( N, J+K )
220 ABSA = ABS( AB( L+I, J ) )
222 WORK( I ) = WORK( I ) + ABSA
224 IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
227 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
234 IF( LSAME( UPLO, 'U' ) ) THEN
236 CALL ZLASSQ( MIN( J-1, K ), AB( MAX( K+2-J, 1 ), J ),
242 CALL ZLASSQ( MIN( N-J, K ), AB( 2, J ), 1, SCALE,
251 CALL ZLASSQ( N, AB( L, 1 ), LDAB, SCALE, SUM )
252 VALUE = SCALE*SQRT( SUM )