LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dpbtf2()

subroutine dpbtf2 ( character uplo,
integer n,
integer kd,
double precision, dimension( ldab, * ) ab,
integer ldab,
integer info )

DPBTF2 computes the Cholesky factorization of a symmetric/Hermitian positive definite band matrix (unblocked algorithm).

Download DPBTF2 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> DPBTF2 computes the Cholesky factorization of a real symmetric
!> positive definite band matrix A.
!>
!> The factorization has the form
!>    A = U**T * U ,  if UPLO = 'U', or
!>    A = L  * L**T,  if UPLO = 'L',
!> where U is an upper triangular matrix, U**T is the transpose of U, and
!> L is lower triangular.
!>
!> This is the unblocked version of the algorithm, calling Level 2 BLAS.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies whether the upper or lower triangular part of the
!>          symmetric matrix A is stored:
!>          = 'U':  Upper triangular
!>          = 'L':  Lower triangular
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in]KD
!>          KD is INTEGER
!>          The number of super-diagonals of the matrix A if UPLO = 'U',
!>          or the number of sub-diagonals if UPLO = 'L'.  KD >= 0.
!> 
[in,out]AB
!>          AB is DOUBLE PRECISION array, dimension (LDAB,N)
!>          On entry, the upper or lower triangle of the symmetric band
!>          matrix A, stored in the first KD+1 rows of the array.  The
!>          j-th column of A is stored in the j-th column of the array AB
!>          as follows:
!>          if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
!>          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd).
!>
!>          On exit, if INFO = 0, the triangular factor U or L from the
!>          Cholesky factorization A = U**T*U or A = L*L**T of the band
!>          matrix A, in the same storage format as A.
!> 
[in]LDAB
!>          LDAB is INTEGER
!>          The leading dimension of the array AB.  LDAB >= KD+1.
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0: successful exit
!>          < 0: if INFO = -k, the k-th argument had an illegal value
!>          > 0: if INFO = k, the leading principal minor of order k
!>               is not positive, and the factorization could not be
!>               completed.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
!>
!>  The band storage scheme is illustrated by the following example, when
!>  N = 6, KD = 2, and UPLO = 'U':
!>
!>  On entry:                       On exit:
!>
!>      *    *   a13  a24  a35  a46      *    *   u13  u24  u35  u46
!>      *   a12  a23  a34  a45  a56      *   u12  u23  u34  u45  u56
!>     a11  a22  a33  a44  a55  a66     u11  u22  u33  u44  u55  u66
!>
!>  Similarly, if UPLO = 'L' the format of A is as follows:
!>
!>  On entry:                       On exit:
!>
!>     a11  a22  a33  a44  a55  a66     l11  l22  l33  l44  l55  l66
!>     a21  a32  a43  a54  a65   *      l21  l32  l43  l54  l65   *
!>     a31  a42  a53  a64   *    *      l31  l42  l53  l64   *    *
!>
!>  Array elements marked * are not used by the routine.
!> 

Definition at line 139 of file dpbtf2.f.

140*
141* -- LAPACK computational routine --
142* -- LAPACK is a software package provided by Univ. of Tennessee, --
143* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
144*
145* .. Scalar Arguments ..
146 CHARACTER UPLO
147 INTEGER INFO, KD, LDAB, N
148* ..
149* .. Array Arguments ..
150 DOUBLE PRECISION AB( LDAB, * )
151* ..
152*
153* =====================================================================
154*
155* .. Parameters ..
156 DOUBLE PRECISION ONE, ZERO
157 parameter( one = 1.0d+0, zero = 0.0d+0 )
158* ..
159* .. Local Scalars ..
160 LOGICAL UPPER
161 INTEGER J, KLD, KN
162 DOUBLE PRECISION AJJ
163* ..
164* .. External Functions ..
165 LOGICAL LSAME
166 EXTERNAL lsame
167* ..
168* .. External Subroutines ..
169 EXTERNAL dscal, dsyr, xerbla
170* ..
171* .. Intrinsic Functions ..
172 INTRINSIC max, min, sqrt
173* ..
174* .. Executable Statements ..
175*
176* Test the input parameters.
177*
178 info = 0
179 upper = lsame( uplo, 'U' )
180 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
181 info = -1
182 ELSE IF( n.LT.0 ) THEN
183 info = -2
184 ELSE IF( kd.LT.0 ) THEN
185 info = -3
186 ELSE IF( ldab.LT.kd+1 ) THEN
187 info = -5
188 END IF
189 IF( info.NE.0 ) THEN
190 CALL xerbla( 'DPBTF2', -info )
191 RETURN
192 END IF
193*
194* Quick return if possible
195*
196 IF( n.EQ.0 )
197 $ RETURN
198*
199 kld = max( 1, ldab-1 )
200*
201 IF( upper ) THEN
202*
203* Compute the Cholesky factorization A = U**T*U.
204*
205 DO 10 j = 1, n
206*
207* Compute U(J,J) and test for non-positive-definiteness.
208*
209 ajj = ab( kd+1, j )
210 IF( ajj.LE.zero )
211 $ GO TO 30
212 ajj = sqrt( ajj )
213 ab( kd+1, j ) = ajj
214*
215* Compute elements J+1:J+KN of row J and update the
216* trailing submatrix within the band.
217*
218 kn = min( kd, n-j )
219 IF( kn.GT.0 ) THEN
220 CALL dscal( kn, one / ajj, ab( kd, j+1 ), kld )
221 CALL dsyr( 'Upper', kn, -one, ab( kd, j+1 ), kld,
222 $ ab( kd+1, j+1 ), kld )
223 END IF
224 10 CONTINUE
225 ELSE
226*
227* Compute the Cholesky factorization A = L*L**T.
228*
229 DO 20 j = 1, n
230*
231* Compute L(J,J) and test for non-positive-definiteness.
232*
233 ajj = ab( 1, j )
234 IF( ajj.LE.zero )
235 $ GO TO 30
236 ajj = sqrt( ajj )
237 ab( 1, j ) = ajj
238*
239* Compute elements J+1:J+KN of column J and update the
240* trailing submatrix within the band.
241*
242 kn = min( kd, n-j )
243 IF( kn.GT.0 ) THEN
244 CALL dscal( kn, one / ajj, ab( 2, j ), 1 )
245 CALL dsyr( 'Lower', kn, -one, ab( 2, j ), 1,
246 $ ab( 1, j+1 ), kld )
247 END IF
248 20 CONTINUE
249 END IF
250 RETURN
251*
252 30 CONTINUE
253 info = j
254 RETURN
255*
256* End of DPBTF2
257*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dsyr(uplo, n, alpha, x, incx, a, lda)
DSYR
Definition dsyr.f:132
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine dscal(n, da, dx, incx)
DSCAL
Definition dscal.f:79
Here is the call graph for this function:
Here is the caller graph for this function: