LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zpbtf2.f
Go to the documentation of this file.
1*> \brief \b ZPBTF2 computes the Cholesky factorization of a symmetric/Hermitian positive definite band matrix (unblocked algorithm).
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZPBTF2 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zpbtf2.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zpbtf2.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpbtf2.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZPBTF2( UPLO, N, KD, AB, LDAB, INFO )
20*
21* .. Scalar Arguments ..
22* CHARACTER UPLO
23* INTEGER INFO, KD, LDAB, N
24* ..
25* .. Array Arguments ..
26* COMPLEX*16 AB( LDAB, * )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> ZPBTF2 computes the Cholesky factorization of a complex Hermitian
36*> positive definite band matrix A.
37*>
38*> The factorization has the form
39*> A = U**H * U , if UPLO = 'U', or
40*> A = L * L**H, if UPLO = 'L',
41*> where U is an upper triangular matrix, U**H is the conjugate transpose
42*> of U, and L is lower triangular.
43*>
44*> This is the unblocked version of the algorithm, calling Level 2 BLAS.
45*> \endverbatim
46*
47* Arguments:
48* ==========
49*
50*> \param[in] UPLO
51*> \verbatim
52*> UPLO is CHARACTER*1
53*> Specifies whether the upper or lower triangular part of the
54*> Hermitian matrix A is stored:
55*> = 'U': Upper triangular
56*> = 'L': Lower triangular
57*> \endverbatim
58*>
59*> \param[in] N
60*> \verbatim
61*> N is INTEGER
62*> The order of the matrix A. N >= 0.
63*> \endverbatim
64*>
65*> \param[in] KD
66*> \verbatim
67*> KD is INTEGER
68*> The number of super-diagonals of the matrix A if UPLO = 'U',
69*> or the number of sub-diagonals if UPLO = 'L'. KD >= 0.
70*> \endverbatim
71*>
72*> \param[in,out] AB
73*> \verbatim
74*> AB is COMPLEX*16 array, dimension (LDAB,N)
75*> On entry, the upper or lower triangle of the Hermitian band
76*> matrix A, stored in the first KD+1 rows of the array. The
77*> j-th column of A is stored in the j-th column of the array AB
78*> as follows:
79*> if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
80*> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
81*>
82*> On exit, if INFO = 0, the triangular factor U or L from the
83*> Cholesky factorization A = U**H *U or A = L*L**H of the band
84*> matrix A, in the same storage format as A.
85*> \endverbatim
86*>
87*> \param[in] LDAB
88*> \verbatim
89*> LDAB is INTEGER
90*> The leading dimension of the array AB. LDAB >= KD+1.
91*> \endverbatim
92*>
93*> \param[out] INFO
94*> \verbatim
95*> INFO is INTEGER
96*> = 0: successful exit
97*> < 0: if INFO = -k, the k-th argument had an illegal value
98*> > 0: if INFO = k, the leading principal minor of order k
99*> is not positive, and the factorization could not be
100*> completed.
101*> \endverbatim
102*
103* Authors:
104* ========
105*
106*> \author Univ. of Tennessee
107*> \author Univ. of California Berkeley
108*> \author Univ. of Colorado Denver
109*> \author NAG Ltd.
110*
111*> \ingroup pbtf2
112*
113*> \par Further Details:
114* =====================
115*>
116*> \verbatim
117*>
118*> The band storage scheme is illustrated by the following example, when
119*> N = 6, KD = 2, and UPLO = 'U':
120*>
121*> On entry: On exit:
122*>
123*> * * a13 a24 a35 a46 * * u13 u24 u35 u46
124*> * a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56
125*> a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66
126*>
127*> Similarly, if UPLO = 'L' the format of A is as follows:
128*>
129*> On entry: On exit:
130*>
131*> a11 a22 a33 a44 a55 a66 l11 l22 l33 l44 l55 l66
132*> a21 a32 a43 a54 a65 * l21 l32 l43 l54 l65 *
133*> a31 a42 a53 a64 * * l31 l42 l53 l64 * *
134*>
135*> Array elements marked * are not used by the routine.
136*> \endverbatim
137*>
138* =====================================================================
139 SUBROUTINE zpbtf2( UPLO, N, KD, AB, LDAB, INFO )
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 COMPLEX*16 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 xerbla, zdscal, zher, zlacgv
170* ..
171* .. Intrinsic Functions ..
172 INTRINSIC dble, 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( 'ZPBTF2', -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**H * U.
204*
205 DO 10 j = 1, n
206*
207* Compute U(J,J) and test for non-positive-definiteness.
208*
209 ajj = dble( ab( kd+1, j ) )
210 IF( ajj.LE.zero ) THEN
211 ab( kd+1, j ) = ajj
212 GO TO 30
213 END IF
214 ajj = sqrt( ajj )
215 ab( kd+1, j ) = ajj
216*
217* Compute elements J+1:J+KN of row J and update the
218* trailing submatrix within the band.
219*
220 kn = min( kd, n-j )
221 IF( kn.GT.0 ) THEN
222 CALL zdscal( kn, one / ajj, ab( kd, j+1 ), kld )
223 CALL zlacgv( kn, ab( kd, j+1 ), kld )
224 CALL zher( 'Upper', kn, -one, ab( kd, j+1 ), kld,
225 $ ab( kd+1, j+1 ), kld )
226 CALL zlacgv( kn, ab( kd, j+1 ), kld )
227 END IF
228 10 CONTINUE
229 ELSE
230*
231* Compute the Cholesky factorization A = L*L**H.
232*
233 DO 20 j = 1, n
234*
235* Compute L(J,J) and test for non-positive-definiteness.
236*
237 ajj = dble( ab( 1, j ) )
238 IF( ajj.LE.zero ) THEN
239 ab( 1, j ) = ajj
240 GO TO 30
241 END IF
242 ajj = sqrt( ajj )
243 ab( 1, j ) = ajj
244*
245* Compute elements J+1:J+KN of column J and update the
246* trailing submatrix within the band.
247*
248 kn = min( kd, n-j )
249 IF( kn.GT.0 ) THEN
250 CALL zdscal( kn, one / ajj, ab( 2, j ), 1 )
251 CALL zher( 'Lower', kn, -one, ab( 2, j ), 1,
252 $ ab( 1, j+1 ), kld )
253 END IF
254 20 CONTINUE
255 END IF
256 RETURN
257*
258 30 CONTINUE
259 info = j
260 RETURN
261*
262* End of ZPBTF2
263*
264 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zher(uplo, n, alpha, x, incx, a, lda)
ZHER
Definition zher.f:135
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
Definition zlacgv.f:72
subroutine zpbtf2(uplo, n, kd, ab, ldab, info)
ZPBTF2 computes the Cholesky factorization of a symmetric/Hermitian positive definite band matrix (un...
Definition zpbtf2.f:140
subroutine zdscal(n, da, zx, incx)
ZDSCAL
Definition zdscal.f:78