![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b ZLANGB 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download ZLANGB + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlangb.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlangb.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlangb.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * DOUBLE PRECISION FUNCTION ZLANGB( NORM, N, KL, KU, AB, LDAB, 00022 * WORK ) 00023 * 00024 * .. Scalar Arguments .. 00025 * CHARACTER NORM 00026 * INTEGER KL, KU, 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 *> ZLANGB 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 band matrix A, with kl sub-diagonals and ku super-diagonals. 00042 *> \endverbatim 00043 *> 00044 *> \return ZLANGB 00045 *> \verbatim 00046 *> 00047 *> ZLANGB = ( 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 ZLANGB as described 00068 *> above. 00069 *> \endverbatim 00070 *> 00071 *> \param[in] N 00072 *> \verbatim 00073 *> N is INTEGER 00074 *> The order of the matrix A. N >= 0. When N = 0, ZLANGB is 00075 *> set to zero. 00076 *> \endverbatim 00077 *> 00078 *> \param[in] KL 00079 *> \verbatim 00080 *> KL is INTEGER 00081 *> The number of sub-diagonals of the matrix A. KL >= 0. 00082 *> \endverbatim 00083 *> 00084 *> \param[in] KU 00085 *> \verbatim 00086 *> KU is INTEGER 00087 *> The number of super-diagonals of the matrix A. KU >= 0. 00088 *> \endverbatim 00089 *> 00090 *> \param[in] AB 00091 *> \verbatim 00092 *> AB is COMPLEX*16 array, dimension (LDAB,N) 00093 *> The band matrix A, stored in rows 1 to KL+KU+1. The j-th 00094 *> column of A is stored in the j-th column of the array AB as 00095 *> follows: 00096 *> AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl). 00097 *> \endverbatim 00098 *> 00099 *> \param[in] LDAB 00100 *> \verbatim 00101 *> LDAB is INTEGER 00102 *> The leading dimension of the array AB. LDAB >= KL+KU+1. 00103 *> \endverbatim 00104 *> 00105 *> \param[out] WORK 00106 *> \verbatim 00107 *> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)), 00108 *> where LWORK >= N when NORM = 'I'; otherwise, WORK is not 00109 *> referenced. 00110 *> \endverbatim 00111 * 00112 * Authors: 00113 * ======== 00114 * 00115 *> \author Univ. of Tennessee 00116 *> \author Univ. of California Berkeley 00117 *> \author Univ. of Colorado Denver 00118 *> \author NAG Ltd. 00119 * 00120 *> \date November 2011 00121 * 00122 *> \ingroup complex16GBauxiliary 00123 * 00124 * ===================================================================== 00125 DOUBLE PRECISION FUNCTION ZLANGB( NORM, N, KL, KU, AB, LDAB, 00126 $ WORK ) 00127 * 00128 * -- LAPACK auxiliary routine (version 3.4.0) -- 00129 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00130 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00131 * November 2011 00132 * 00133 * .. Scalar Arguments .. 00134 CHARACTER NORM 00135 INTEGER KL, KU, LDAB, N 00136 * .. 00137 * .. Array Arguments .. 00138 DOUBLE PRECISION WORK( * ) 00139 COMPLEX*16 AB( LDAB, * ) 00140 * .. 00141 * 00142 * ===================================================================== 00143 * 00144 * .. Parameters .. 00145 DOUBLE PRECISION ONE, ZERO 00146 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 ) 00147 * .. 00148 * .. Local Scalars .. 00149 INTEGER I, J, K, L 00150 DOUBLE PRECISION SCALE, SUM, VALUE 00151 * .. 00152 * .. External Functions .. 00153 LOGICAL LSAME 00154 EXTERNAL LSAME 00155 * .. 00156 * .. External Subroutines .. 00157 EXTERNAL ZLASSQ 00158 * .. 00159 * .. Intrinsic Functions .. 00160 INTRINSIC ABS, MAX, MIN, SQRT 00161 * .. 00162 * .. Executable Statements .. 00163 * 00164 IF( N.EQ.0 ) THEN 00165 VALUE = ZERO 00166 ELSE IF( LSAME( NORM, 'M' ) ) THEN 00167 * 00168 * Find max(abs(A(i,j))). 00169 * 00170 VALUE = ZERO 00171 DO 20 J = 1, N 00172 DO 10 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 ) 00173 VALUE = MAX( VALUE, ABS( AB( I, J ) ) ) 00174 10 CONTINUE 00175 20 CONTINUE 00176 ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN 00177 * 00178 * Find norm1(A). 00179 * 00180 VALUE = ZERO 00181 DO 40 J = 1, N 00182 SUM = ZERO 00183 DO 30 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 ) 00184 SUM = SUM + ABS( AB( I, J ) ) 00185 30 CONTINUE 00186 VALUE = MAX( VALUE, SUM ) 00187 40 CONTINUE 00188 ELSE IF( LSAME( NORM, 'I' ) ) THEN 00189 * 00190 * Find normI(A). 00191 * 00192 DO 50 I = 1, N 00193 WORK( I ) = ZERO 00194 50 CONTINUE 00195 DO 70 J = 1, N 00196 K = KU + 1 - J 00197 DO 60 I = MAX( 1, J-KU ), MIN( N, J+KL ) 00198 WORK( I ) = WORK( I ) + ABS( AB( K+I, J ) ) 00199 60 CONTINUE 00200 70 CONTINUE 00201 VALUE = ZERO 00202 DO 80 I = 1, N 00203 VALUE = MAX( VALUE, WORK( I ) ) 00204 80 CONTINUE 00205 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN 00206 * 00207 * Find normF(A). 00208 * 00209 SCALE = ZERO 00210 SUM = ONE 00211 DO 90 J = 1, N 00212 L = MAX( 1, J-KU ) 00213 K = KU + 1 - J + L 00214 CALL ZLASSQ( MIN( N, J+KL )-L+1, AB( K, J ), 1, SCALE, SUM ) 00215 90 CONTINUE 00216 VALUE = SCALE*SQRT( SUM ) 00217 END IF 00218 * 00219 ZLANGB = VALUE 00220 RETURN 00221 * 00222 * End of ZLANGB 00223 * 00224 END