LAPACK 3.3.1
Linear Algebra PACKage

zpbstf.f

Go to the documentation of this file.
00001       SUBROUTINE ZPBSTF( UPLO, N, KD, AB, LDAB, INFO )
00002 *
00003 *  -- LAPACK routine (version 3.2) --
00004 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00005 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00006 *     November 2006
00007 *
00008 *     .. Scalar Arguments ..
00009       CHARACTER          UPLO
00010       INTEGER            INFO, KD, LDAB, N
00011 *     ..
00012 *     .. Array Arguments ..
00013       COMPLEX*16         AB( LDAB, * )
00014 *     ..
00015 *
00016 *  Purpose
00017 *  =======
00018 *
00019 *  ZPBSTF computes a split Cholesky factorization of a complex
00020 *  Hermitian positive definite band matrix A.
00021 *
00022 *  This routine is designed to be used in conjunction with ZHBGST.
00023 *
00024 *  The factorization has the form  A = S**H*S  where S is a band matrix
00025 *  of the same bandwidth as A and the following structure:
00026 *
00027 *    S = ( U    )
00028 *        ( M  L )
00029 *
00030 *  where U is upper triangular of order m = (n+kd)/2, and L is lower
00031 *  triangular of order n-m.
00032 *
00033 *  Arguments
00034 *  =========
00035 *
00036 *  UPLO    (input) CHARACTER*1
00037 *          = 'U':  Upper triangle of A is stored;
00038 *          = 'L':  Lower triangle of A is stored.
00039 *
00040 *  N       (input) INTEGER
00041 *          The order of the matrix A.  N >= 0.
00042 *
00043 *  KD      (input) INTEGER
00044 *          The number of superdiagonals of the matrix A if UPLO = 'U',
00045 *          or the number of subdiagonals if UPLO = 'L'.  KD >= 0.
00046 *
00047 *  AB      (input/output) COMPLEX*16 array, dimension (LDAB,N)
00048 *          On entry, the upper or lower triangle of the Hermitian band
00049 *          matrix A, stored in the first kd+1 rows of the array.  The
00050 *          j-th column of A is stored in the j-th column of the array AB
00051 *          as follows:
00052 *          if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
00053 *          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd).
00054 *
00055 *          On exit, if INFO = 0, the factor S from the split Cholesky
00056 *          factorization A = S**H*S. See Further Details.
00057 *
00058 *  LDAB    (input) INTEGER
00059 *          The leading dimension of the array AB.  LDAB >= KD+1.
00060 *
00061 *  INFO    (output) INTEGER
00062 *          = 0: successful exit
00063 *          < 0: if INFO = -i, the i-th argument had an illegal value
00064 *          > 0: if INFO = i, the factorization could not be completed,
00065 *               because the updated element a(i,i) was negative; the
00066 *               matrix A is not positive definite.
00067 *
00068 *  Further Details
00069 *  ===============
00070 *
00071 *  The band storage scheme is illustrated by the following example, when
00072 *  N = 7, KD = 2:
00073 *
00074 *  S = ( s11  s12  s13                     )
00075 *      (      s22  s23  s24                )
00076 *      (           s33  s34                )
00077 *      (                s44                )
00078 *      (           s53  s54  s55           )
00079 *      (                s64  s65  s66      )
00080 *      (                     s75  s76  s77 )
00081 *
00082 *  If UPLO = 'U', the array AB holds:
00083 *
00084 *  on entry:                          on exit:
00085 *
00086 *   *    *   a13  a24  a35  a46  a57   *    *   s13  s24  s53**H s64**H s75**H
00087 *   *   a12  a23  a34  a45  a56  a67   *   s12  s23  s34  s54**H s65**H s76**H
00088 *  a11  a22  a33  a44  a55  a66  a77  s11  s22  s33  s44  s55    s66    s77
00089 *
00090 *  If UPLO = 'L', the array AB holds:
00091 *
00092 *  on entry:                          on exit:
00093 *
00094 *  a11  a22  a33  a44  a55  a66  a77  s11    s22    s33    s44  s55  s66  s77
00095 *  a21  a32  a43  a54  a65  a76   *   s12**H s23**H s34**H s54  s65  s76   *
00096 *  a31  a42  a53  a64  a64   *    *   s13**H s24**H s53    s64  s75   *    *
00097 *
00098 *  Array elements marked * are not used by the routine; s12**H denotes
00099 *  conjg(s12); the diagonal elements of S are real.
00100 
00101 *
00102 *  =====================================================================
00103 *
00104 *     .. Parameters ..
00105       DOUBLE PRECISION   ONE, ZERO
00106       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00107 *     ..
00108 *     .. Local Scalars ..
00109       LOGICAL            UPPER
00110       INTEGER            J, KLD, KM, M
00111       DOUBLE PRECISION   AJJ
00112 *     ..
00113 *     .. External Functions ..
00114       LOGICAL            LSAME
00115       EXTERNAL           LSAME
00116 *     ..
00117 *     .. External Subroutines ..
00118       EXTERNAL           XERBLA, ZDSCAL, ZHER, ZLACGV
00119 *     ..
00120 *     .. Intrinsic Functions ..
00121       INTRINSIC          DBLE, MAX, MIN, SQRT
00122 *     ..
00123 *     .. Executable Statements ..
00124 *
00125 *     Test the input parameters.
00126 *
00127       INFO = 0
00128       UPPER = LSAME( UPLO, 'U' )
00129       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00130          INFO = -1
00131       ELSE IF( N.LT.0 ) THEN
00132          INFO = -2
00133       ELSE IF( KD.LT.0 ) THEN
00134          INFO = -3
00135       ELSE IF( LDAB.LT.KD+1 ) THEN
00136          INFO = -5
00137       END IF
00138       IF( INFO.NE.0 ) THEN
00139          CALL XERBLA( 'ZPBSTF', -INFO )
00140          RETURN
00141       END IF
00142 *
00143 *     Quick return if possible
00144 *
00145       IF( N.EQ.0 )
00146      $   RETURN
00147 *
00148       KLD = MAX( 1, LDAB-1 )
00149 *
00150 *     Set the splitting point m.
00151 *
00152       M = ( N+KD ) / 2
00153 *
00154       IF( UPPER ) THEN
00155 *
00156 *        Factorize A(m+1:n,m+1:n) as L**H*L, and update A(1:m,1:m).
00157 *
00158          DO 10 J = N, M + 1, -1
00159 *
00160 *           Compute s(j,j) and test for non-positive-definiteness.
00161 *
00162             AJJ = DBLE( AB( KD+1, J ) )
00163             IF( AJJ.LE.ZERO ) THEN
00164                AB( KD+1, J ) = AJJ
00165                GO TO 50
00166             END IF
00167             AJJ = SQRT( AJJ )
00168             AB( KD+1, J ) = AJJ
00169             KM = MIN( J-1, KD )
00170 *
00171 *           Compute elements j-km:j-1 of the j-th column and update the
00172 *           the leading submatrix within the band.
00173 *
00174             CALL ZDSCAL( KM, ONE / AJJ, AB( KD+1-KM, J ), 1 )
00175             CALL ZHER( 'Upper', KM, -ONE, AB( KD+1-KM, J ), 1,
00176      $                 AB( KD+1, J-KM ), KLD )
00177    10    CONTINUE
00178 *
00179 *        Factorize the updated submatrix A(1:m,1:m) as U**H*U.
00180 *
00181          DO 20 J = 1, M
00182 *
00183 *           Compute s(j,j) and test for non-positive-definiteness.
00184 *
00185             AJJ = DBLE( AB( KD+1, J ) )
00186             IF( AJJ.LE.ZERO ) THEN
00187                AB( KD+1, J ) = AJJ
00188                GO TO 50
00189             END IF
00190             AJJ = SQRT( AJJ )
00191             AB( KD+1, J ) = AJJ
00192             KM = MIN( KD, M-J )
00193 *
00194 *           Compute elements j+1:j+km of the j-th row and update the
00195 *           trailing submatrix within the band.
00196 *
00197             IF( KM.GT.0 ) THEN
00198                CALL ZDSCAL( KM, ONE / AJJ, AB( KD, J+1 ), KLD )
00199                CALL ZLACGV( KM, AB( KD, J+1 ), KLD )
00200                CALL ZHER( 'Upper', KM, -ONE, AB( KD, J+1 ), KLD,
00201      $                    AB( KD+1, J+1 ), KLD )
00202                CALL ZLACGV( KM, AB( KD, J+1 ), KLD )
00203             END IF
00204    20    CONTINUE
00205       ELSE
00206 *
00207 *        Factorize A(m+1:n,m+1:n) as L**H*L, and update A(1:m,1:m).
00208 *
00209          DO 30 J = N, M + 1, -1
00210 *
00211 *           Compute s(j,j) and test for non-positive-definiteness.
00212 *
00213             AJJ = DBLE( AB( 1, J ) )
00214             IF( AJJ.LE.ZERO ) THEN
00215                AB( 1, J ) = AJJ
00216                GO TO 50
00217             END IF
00218             AJJ = SQRT( AJJ )
00219             AB( 1, J ) = AJJ
00220             KM = MIN( J-1, KD )
00221 *
00222 *           Compute elements j-km:j-1 of the j-th row and update the
00223 *           trailing submatrix within the band.
00224 *
00225             CALL ZDSCAL( KM, ONE / AJJ, AB( KM+1, J-KM ), KLD )
00226             CALL ZLACGV( KM, AB( KM+1, J-KM ), KLD )
00227             CALL ZHER( 'Lower', KM, -ONE, AB( KM+1, J-KM ), KLD,
00228      $                 AB( 1, J-KM ), KLD )
00229             CALL ZLACGV( KM, AB( KM+1, J-KM ), KLD )
00230    30    CONTINUE
00231 *
00232 *        Factorize the updated submatrix A(1:m,1:m) as U**H*U.
00233 *
00234          DO 40 J = 1, M
00235 *
00236 *           Compute s(j,j) and test for non-positive-definiteness.
00237 *
00238             AJJ = DBLE( AB( 1, J ) )
00239             IF( AJJ.LE.ZERO ) THEN
00240                AB( 1, J ) = AJJ
00241                GO TO 50
00242             END IF
00243             AJJ = SQRT( AJJ )
00244             AB( 1, J ) = AJJ
00245             KM = MIN( KD, M-J )
00246 *
00247 *           Compute elements j+1:j+km of the j-th column and update the
00248 *           trailing submatrix within the band.
00249 *
00250             IF( KM.GT.0 ) THEN
00251                CALL ZDSCAL( KM, ONE / AJJ, AB( 2, J ), 1 )
00252                CALL ZHER( 'Lower', KM, -ONE, AB( 2, J ), 1,
00253      $                    AB( 1, J+1 ), KLD )
00254             END IF
00255    40    CONTINUE
00256       END IF
00257       RETURN
00258 *
00259    50 CONTINUE
00260       INFO = J
00261       RETURN
00262 *
00263 *     End of ZPBSTF
00264 *
00265       END
 All Files Functions