![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b ZLANSB 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download ZLANSB + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlansb.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlansb.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlansb.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * DOUBLE PRECISION FUNCTION ZLANSB( NORM, UPLO, N, K, AB, LDAB, 00022 * WORK ) 00023 * 00024 * .. Scalar Arguments .. 00025 * CHARACTER NORM, UPLO 00026 * INTEGER K, LDAB, N 00027 * .. 00028 * .. Array Arguments .. 00029 * DOUBLE PRECISION WORK( * ) 00030 * COMPLEX*16 AB( LDAB, * ) 00031 * .. 00032 * 00033 * 00034 *> \par Purpose: 00035 * ============= 00036 *> 00037 *> \verbatim 00038 *> 00039 *> ZLANSB returns the value of the one norm, or the Frobenius norm, or 00040 *> the infinity norm, or the element of largest absolute value of an 00041 *> n by n symmetric band matrix A, with k super-diagonals. 00042 *> \endverbatim 00043 *> 00044 *> \return ZLANSB 00045 *> \verbatim 00046 *> 00047 *> ZLANSB = ( max(abs(A(i,j))), NORM = 'M' or 'm' 00048 *> ( 00049 *> ( norm1(A), NORM = '1', 'O' or 'o' 00050 *> ( 00051 *> ( normI(A), NORM = 'I' or 'i' 00052 *> ( 00053 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e' 00054 *> 00055 *> where norm1 denotes the one norm of a matrix (maximum column sum), 00056 *> normI denotes the infinity norm of a matrix (maximum row sum) and 00057 *> normF denotes the Frobenius norm of a matrix (square root of sum of 00058 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. 00059 *> \endverbatim 00060 * 00061 * Arguments: 00062 * ========== 00063 * 00064 *> \param[in] NORM 00065 *> \verbatim 00066 *> NORM is CHARACTER*1 00067 *> Specifies the value to be returned in ZLANSB as described 00068 *> above. 00069 *> \endverbatim 00070 *> 00071 *> \param[in] UPLO 00072 *> \verbatim 00073 *> UPLO is CHARACTER*1 00074 *> Specifies whether the upper or lower triangular part of the 00075 *> band matrix A is supplied. 00076 *> = 'U': Upper triangular part is supplied 00077 *> = 'L': Lower triangular part is supplied 00078 *> \endverbatim 00079 *> 00080 *> \param[in] N 00081 *> \verbatim 00082 *> N is INTEGER 00083 *> The order of the matrix A. N >= 0. When N = 0, ZLANSB is 00084 *> set to zero. 00085 *> \endverbatim 00086 *> 00087 *> \param[in] K 00088 *> \verbatim 00089 *> K is INTEGER 00090 *> The number of super-diagonals or sub-diagonals of the 00091 *> band matrix A. K >= 0. 00092 *> \endverbatim 00093 *> 00094 *> \param[in] AB 00095 *> \verbatim 00096 *> AB is COMPLEX*16 array, dimension (LDAB,N) 00097 *> The upper or lower triangle of the symmetric band matrix A, 00098 *> stored in the first K+1 rows of AB. The j-th column of A is 00099 *> stored in the j-th column of the array AB as follows: 00100 *> if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j; 00101 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k). 00102 *> \endverbatim 00103 *> 00104 *> \param[in] LDAB 00105 *> \verbatim 00106 *> LDAB is INTEGER 00107 *> The leading dimension of the array AB. LDAB >= K+1. 00108 *> \endverbatim 00109 *> 00110 *> \param[out] WORK 00111 *> \verbatim 00112 *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)), 00113 *> where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise, 00114 *> WORK is not referenced. 00115 *> \endverbatim 00116 * 00117 * Authors: 00118 * ======== 00119 * 00120 *> \author Univ. of Tennessee 00121 *> \author Univ. of California Berkeley 00122 *> \author Univ. of Colorado Denver 00123 *> \author NAG Ltd. 00124 * 00125 *> \date November 2011 00126 * 00127 *> \ingroup complex16OTHERauxiliary 00128 * 00129 * ===================================================================== 00130 DOUBLE PRECISION FUNCTION ZLANSB( NORM, UPLO, N, K, AB, LDAB, 00131 $ WORK ) 00132 * 00133 * -- LAPACK auxiliary routine (version 3.4.0) -- 00134 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00136 * November 2011 00137 * 00138 * .. Scalar Arguments .. 00139 CHARACTER NORM, UPLO 00140 INTEGER K, LDAB, N 00141 * .. 00142 * .. Array Arguments .. 00143 DOUBLE PRECISION WORK( * ) 00144 COMPLEX*16 AB( LDAB, * ) 00145 * .. 00146 * 00147 * ===================================================================== 00148 * 00149 * .. Parameters .. 00150 DOUBLE PRECISION ONE, ZERO 00151 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 ) 00152 * .. 00153 * .. Local Scalars .. 00154 INTEGER I, J, L 00155 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE 00156 * .. 00157 * .. External Functions .. 00158 LOGICAL LSAME 00159 EXTERNAL LSAME 00160 * .. 00161 * .. External Subroutines .. 00162 EXTERNAL ZLASSQ 00163 * .. 00164 * .. Intrinsic Functions .. 00165 INTRINSIC ABS, MAX, MIN, SQRT 00166 * .. 00167 * .. Executable Statements .. 00168 * 00169 IF( N.EQ.0 ) THEN 00170 VALUE = ZERO 00171 ELSE IF( LSAME( NORM, 'M' ) ) THEN 00172 * 00173 * Find max(abs(A(i,j))). 00174 * 00175 VALUE = ZERO 00176 IF( LSAME( UPLO, 'U' ) ) THEN 00177 DO 20 J = 1, N 00178 DO 10 I = MAX( K+2-J, 1 ), K + 1 00179 VALUE = MAX( VALUE, ABS( AB( I, J ) ) ) 00180 10 CONTINUE 00181 20 CONTINUE 00182 ELSE 00183 DO 40 J = 1, N 00184 DO 30 I = 1, MIN( N+1-J, K+1 ) 00185 VALUE = MAX( VALUE, ABS( AB( I, J ) ) ) 00186 30 CONTINUE 00187 40 CONTINUE 00188 END IF 00189 ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR. 00190 $ ( NORM.EQ.'1' ) ) THEN 00191 * 00192 * Find normI(A) ( = norm1(A), since A is symmetric). 00193 * 00194 VALUE = ZERO 00195 IF( LSAME( UPLO, 'U' ) ) THEN 00196 DO 60 J = 1, N 00197 SUM = ZERO 00198 L = K + 1 - J 00199 DO 50 I = MAX( 1, J-K ), J - 1 00200 ABSA = ABS( AB( L+I, J ) ) 00201 SUM = SUM + ABSA 00202 WORK( I ) = WORK( I ) + ABSA 00203 50 CONTINUE 00204 WORK( J ) = SUM + ABS( AB( K+1, J ) ) 00205 60 CONTINUE 00206 DO 70 I = 1, N 00207 VALUE = MAX( VALUE, WORK( I ) ) 00208 70 CONTINUE 00209 ELSE 00210 DO 80 I = 1, N 00211 WORK( I ) = ZERO 00212 80 CONTINUE 00213 DO 100 J = 1, N 00214 SUM = WORK( J ) + ABS( AB( 1, J ) ) 00215 L = 1 - J 00216 DO 90 I = J + 1, MIN( N, J+K ) 00217 ABSA = ABS( AB( L+I, J ) ) 00218 SUM = SUM + ABSA 00219 WORK( I ) = WORK( I ) + ABSA 00220 90 CONTINUE 00221 VALUE = MAX( VALUE, SUM ) 00222 100 CONTINUE 00223 END IF 00224 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN 00225 * 00226 * Find normF(A). 00227 * 00228 SCALE = ZERO 00229 SUM = ONE 00230 IF( K.GT.0 ) THEN 00231 IF( LSAME( UPLO, 'U' ) ) THEN 00232 DO 110 J = 2, N 00233 CALL ZLASSQ( MIN( J-1, K ), AB( MAX( K+2-J, 1 ), J ), 00234 $ 1, SCALE, SUM ) 00235 110 CONTINUE 00236 L = K + 1 00237 ELSE 00238 DO 120 J = 1, N - 1 00239 CALL ZLASSQ( MIN( N-J, K ), AB( 2, J ), 1, SCALE, 00240 $ SUM ) 00241 120 CONTINUE 00242 L = 1 00243 END IF 00244 SUM = 2*SUM 00245 ELSE 00246 L = 1 00247 END IF 00248 CALL ZLASSQ( N, AB( L, 1 ), LDAB, SCALE, SUM ) 00249 VALUE = SCALE*SQRT( SUM ) 00250 END IF 00251 * 00252 ZLANSB = VALUE 00253 RETURN 00254 * 00255 * End of ZLANSB 00256 * 00257 END