![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CPBSTF 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CPBSTF + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cpbstf.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cpbstf.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbstf.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE CPBSTF( UPLO, N, KD, AB, LDAB, INFO ) 00022 * 00023 * .. Scalar Arguments .. 00024 * CHARACTER UPLO 00025 * INTEGER INFO, KD, LDAB, N 00026 * .. 00027 * .. Array Arguments .. 00028 * COMPLEX AB( LDAB, * ) 00029 * .. 00030 * 00031 * 00032 *> \par Purpose: 00033 * ============= 00034 *> 00035 *> \verbatim 00036 *> 00037 *> CPBSTF computes a split Cholesky factorization of a complex 00038 *> Hermitian positive definite band matrix A. 00039 *> 00040 *> This routine is designed to be used in conjunction with CHBGST. 00041 *> 00042 *> The factorization has the form A = S**H*S where S is a band matrix 00043 *> of the same bandwidth as A and the following structure: 00044 *> 00045 *> S = ( U ) 00046 *> ( M L ) 00047 *> 00048 *> where U is upper triangular of order m = (n+kd)/2, and L is lower 00049 *> triangular of order n-m. 00050 *> \endverbatim 00051 * 00052 * Arguments: 00053 * ========== 00054 * 00055 *> \param[in] UPLO 00056 *> \verbatim 00057 *> UPLO is CHARACTER*1 00058 *> = 'U': Upper triangle of A is stored; 00059 *> = 'L': Lower triangle of A is stored. 00060 *> \endverbatim 00061 *> 00062 *> \param[in] N 00063 *> \verbatim 00064 *> N is INTEGER 00065 *> The order of the matrix A. N >= 0. 00066 *> \endverbatim 00067 *> 00068 *> \param[in] KD 00069 *> \verbatim 00070 *> KD is INTEGER 00071 *> The number of superdiagonals of the matrix A if UPLO = 'U', 00072 *> or the number of subdiagonals if UPLO = 'L'. KD >= 0. 00073 *> \endverbatim 00074 *> 00075 *> \param[in,out] AB 00076 *> \verbatim 00077 *> AB is COMPLEX array, dimension (LDAB,N) 00078 *> On entry, the upper or lower triangle of the Hermitian band 00079 *> matrix A, stored in the first kd+1 rows of the array. The 00080 *> j-th column of A is stored in the j-th column of the array AB 00081 *> as follows: 00082 *> if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; 00083 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd). 00084 *> 00085 *> On exit, if INFO = 0, the factor S from the split Cholesky 00086 *> factorization A = S**H*S. See Further Details. 00087 *> \endverbatim 00088 *> 00089 *> \param[in] LDAB 00090 *> \verbatim 00091 *> LDAB is INTEGER 00092 *> The leading dimension of the array AB. LDAB >= KD+1. 00093 *> \endverbatim 00094 *> 00095 *> \param[out] INFO 00096 *> \verbatim 00097 *> INFO is INTEGER 00098 *> = 0: successful exit 00099 *> < 0: if INFO = -i, the i-th argument had an illegal value 00100 *> > 0: if INFO = i, the factorization could not be completed, 00101 *> because the updated element a(i,i) was negative; the 00102 *> matrix A is not positive definite. 00103 *> \endverbatim 00104 * 00105 * Authors: 00106 * ======== 00107 * 00108 *> \author Univ. of Tennessee 00109 *> \author Univ. of California Berkeley 00110 *> \author Univ. of Colorado Denver 00111 *> \author NAG Ltd. 00112 * 00113 *> \date November 2011 00114 * 00115 *> \ingroup complexOTHERcomputational 00116 * 00117 *> \par Further Details: 00118 * ===================== 00119 *> 00120 *> \verbatim 00121 *> 00122 *> The band storage scheme is illustrated by the following example, when 00123 *> N = 7, KD = 2: 00124 *> 00125 *> S = ( s11 s12 s13 ) 00126 *> ( s22 s23 s24 ) 00127 *> ( s33 s34 ) 00128 *> ( s44 ) 00129 *> ( s53 s54 s55 ) 00130 *> ( s64 s65 s66 ) 00131 *> ( s75 s76 s77 ) 00132 *> 00133 *> If UPLO = 'U', the array AB holds: 00134 *> 00135 *> on entry: on exit: 00136 *> 00137 *> * * a13 a24 a35 a46 a57 * * s13 s24 s53**H s64**H s75**H 00138 *> * a12 a23 a34 a45 a56 a67 * s12 s23 s34 s54**H s65**H s76**H 00139 *> a11 a22 a33 a44 a55 a66 a77 s11 s22 s33 s44 s55 s66 s77 00140 *> 00141 *> If UPLO = 'L', the array AB holds: 00142 *> 00143 *> on entry: on exit: 00144 *> 00145 *> a11 a22 a33 a44 a55 a66 a77 s11 s22 s33 s44 s55 s66 s77 00146 *> a21 a32 a43 a54 a65 a76 * s12**H s23**H s34**H s54 s65 s76 * 00147 *> a31 a42 a53 a64 a64 * * s13**H s24**H s53 s64 s75 * * 00148 *> 00149 *> Array elements marked * are not used by the routine; s12**H denotes 00150 *> conjg(s12); the diagonal elements of S are real. 00151 *> \endverbatim 00152 *> 00153 * ===================================================================== 00154 SUBROUTINE CPBSTF( UPLO, N, KD, AB, LDAB, INFO ) 00155 * 00156 * -- LAPACK computational routine (version 3.4.0) -- 00157 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00158 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00159 * November 2011 00160 * 00161 * .. Scalar Arguments .. 00162 CHARACTER UPLO 00163 INTEGER INFO, KD, LDAB, N 00164 * .. 00165 * .. Array Arguments .. 00166 COMPLEX AB( LDAB, * ) 00167 * .. 00168 * 00169 * ===================================================================== 00170 * 00171 * .. Parameters .. 00172 REAL ONE, ZERO 00173 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 ) 00174 * .. 00175 * .. Local Scalars .. 00176 LOGICAL UPPER 00177 INTEGER J, KLD, KM, M 00178 REAL AJJ 00179 * .. 00180 * .. External Functions .. 00181 LOGICAL LSAME 00182 EXTERNAL LSAME 00183 * .. 00184 * .. External Subroutines .. 00185 EXTERNAL CHER, CLACGV, CSSCAL, XERBLA 00186 * .. 00187 * .. Intrinsic Functions .. 00188 INTRINSIC MAX, MIN, REAL, SQRT 00189 * .. 00190 * .. Executable Statements .. 00191 * 00192 * Test the input parameters. 00193 * 00194 INFO = 0 00195 UPPER = LSAME( UPLO, 'U' ) 00196 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN 00197 INFO = -1 00198 ELSE IF( N.LT.0 ) THEN 00199 INFO = -2 00200 ELSE IF( KD.LT.0 ) THEN 00201 INFO = -3 00202 ELSE IF( LDAB.LT.KD+1 ) THEN 00203 INFO = -5 00204 END IF 00205 IF( INFO.NE.0 ) THEN 00206 CALL XERBLA( 'CPBSTF', -INFO ) 00207 RETURN 00208 END IF 00209 * 00210 * Quick return if possible 00211 * 00212 IF( N.EQ.0 ) 00213 $ RETURN 00214 * 00215 KLD = MAX( 1, LDAB-1 ) 00216 * 00217 * Set the splitting point m. 00218 * 00219 M = ( N+KD ) / 2 00220 * 00221 IF( UPPER ) THEN 00222 * 00223 * Factorize A(m+1:n,m+1:n) as L**H*L, and update A(1:m,1:m). 00224 * 00225 DO 10 J = N, M + 1, -1 00226 * 00227 * Compute s(j,j) and test for non-positive-definiteness. 00228 * 00229 AJJ = REAL( AB( KD+1, J ) ) 00230 IF( AJJ.LE.ZERO ) THEN 00231 AB( KD+1, J ) = AJJ 00232 GO TO 50 00233 END IF 00234 AJJ = SQRT( AJJ ) 00235 AB( KD+1, J ) = AJJ 00236 KM = MIN( J-1, KD ) 00237 * 00238 * Compute elements j-km:j-1 of the j-th column and update the 00239 * the leading submatrix within the band. 00240 * 00241 CALL CSSCAL( KM, ONE / AJJ, AB( KD+1-KM, J ), 1 ) 00242 CALL CHER( 'Upper', KM, -ONE, AB( KD+1-KM, J ), 1, 00243 $ AB( KD+1, J-KM ), KLD ) 00244 10 CONTINUE 00245 * 00246 * Factorize the updated submatrix A(1:m,1:m) as U**H*U. 00247 * 00248 DO 20 J = 1, M 00249 * 00250 * Compute s(j,j) and test for non-positive-definiteness. 00251 * 00252 AJJ = REAL( AB( KD+1, J ) ) 00253 IF( AJJ.LE.ZERO ) THEN 00254 AB( KD+1, J ) = AJJ 00255 GO TO 50 00256 END IF 00257 AJJ = SQRT( AJJ ) 00258 AB( KD+1, J ) = AJJ 00259 KM = MIN( KD, M-J ) 00260 * 00261 * Compute elements j+1:j+km of the j-th row and update the 00262 * trailing submatrix within the band. 00263 * 00264 IF( KM.GT.0 ) THEN 00265 CALL CSSCAL( KM, ONE / AJJ, AB( KD, J+1 ), KLD ) 00266 CALL CLACGV( KM, AB( KD, J+1 ), KLD ) 00267 CALL CHER( 'Upper', KM, -ONE, AB( KD, J+1 ), KLD, 00268 $ AB( KD+1, J+1 ), KLD ) 00269 CALL CLACGV( KM, AB( KD, J+1 ), KLD ) 00270 END IF 00271 20 CONTINUE 00272 ELSE 00273 * 00274 * Factorize A(m+1:n,m+1:n) as L**H*L, and update A(1:m,1:m). 00275 * 00276 DO 30 J = N, M + 1, -1 00277 * 00278 * Compute s(j,j) and test for non-positive-definiteness. 00279 * 00280 AJJ = REAL( AB( 1, J ) ) 00281 IF( AJJ.LE.ZERO ) THEN 00282 AB( 1, J ) = AJJ 00283 GO TO 50 00284 END IF 00285 AJJ = SQRT( AJJ ) 00286 AB( 1, J ) = AJJ 00287 KM = MIN( J-1, KD ) 00288 * 00289 * Compute elements j-km:j-1 of the j-th row and update the 00290 * trailing submatrix within the band. 00291 * 00292 CALL CSSCAL( KM, ONE / AJJ, AB( KM+1, J-KM ), KLD ) 00293 CALL CLACGV( KM, AB( KM+1, J-KM ), KLD ) 00294 CALL CHER( 'Lower', KM, -ONE, AB( KM+1, J-KM ), KLD, 00295 $ AB( 1, J-KM ), KLD ) 00296 CALL CLACGV( KM, AB( KM+1, J-KM ), KLD ) 00297 30 CONTINUE 00298 * 00299 * Factorize the updated submatrix A(1:m,1:m) as U**H*U. 00300 * 00301 DO 40 J = 1, M 00302 * 00303 * Compute s(j,j) and test for non-positive-definiteness. 00304 * 00305 AJJ = REAL( AB( 1, J ) ) 00306 IF( AJJ.LE.ZERO ) THEN 00307 AB( 1, J ) = AJJ 00308 GO TO 50 00309 END IF 00310 AJJ = SQRT( AJJ ) 00311 AB( 1, J ) = AJJ 00312 KM = MIN( KD, M-J ) 00313 * 00314 * Compute elements j+1:j+km of the j-th column and update the 00315 * trailing submatrix within the band. 00316 * 00317 IF( KM.GT.0 ) THEN 00318 CALL CSSCAL( KM, ONE / AJJ, AB( 2, J ), 1 ) 00319 CALL CHER( 'Lower', KM, -ONE, AB( 2, J ), 1, 00320 $ AB( 1, J+1 ), KLD ) 00321 END IF 00322 40 CONTINUE 00323 END IF 00324 RETURN 00325 * 00326 50 CONTINUE 00327 INFO = J 00328 RETURN 00329 * 00330 * End of CPBSTF 00331 * 00332 END