3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SPTTRF + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/spttrf.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/spttrf.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spttrf.f">
21 * SUBROUTINE SPTTRF( N, D, E, INFO )
23 * .. Scalar Arguments ..
26 * .. Array Arguments ..
36 *> SPTTRF computes the L*D*L**T factorization of a real symmetric
37 *> positive definite tridiagonal matrix A. The factorization may also
38 *> be regarded as having the form A = U**T*D*U.
47 *> The order of the matrix A. N >= 0.
52 *> D is REAL array, dimension (N)
53 *> On entry, the n diagonal elements of the tridiagonal matrix
54 *> A. On exit, the n diagonal elements of the diagonal matrix
55 *> D from the L*D*L**T factorization of A.
60 *> E is REAL array, dimension (N-1)
61 *> On entry, the (n-1) subdiagonal elements of the tridiagonal
62 *> matrix A. On exit, the (n-1) subdiagonal elements of the
63 *> unit bidiagonal factor L from the L*D*L**T factorization of A.
64 *> E can also be regarded as the superdiagonal of the unit
65 *> bidiagonal factor U from the U**T*D*U factorization of A.
71 *> = 0: successful exit
72 *> < 0: if INFO = -k, the k-th argument had an illegal value
73 *> > 0: if INFO = k, the leading minor of order k is not
74 *> positive definite; if k < N, the factorization could not
75 *> be completed, while if k = N, the factorization was
76 *> completed, but D(N) <= 0.
82 *> \author Univ. of Tennessee
83 *> \author Univ. of California Berkeley
84 *> \author Univ. of Colorado Denver
87 *> \date November 2011
89 *> \ingroup auxOTHERcomputational
91 * =====================================================================
92 SUBROUTINE SPTTRF( N, D, E, INFO )
94 * -- LAPACK computational routine (version 3.4.0) --
95 * -- LAPACK is a software package provided by Univ. of Tennessee, --
96 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
99 * .. Scalar Arguments ..
102 * .. Array Arguments ..
106 * =====================================================================
110 PARAMETER ( ZERO = 0.0E+0 )
112 * .. Local Scalars ..
116 * .. External Subroutines ..
119 * .. Intrinsic Functions ..
122 * .. Executable Statements ..
124 * Test the input parameters.
129 CALL XERBLA( 'SPTTRF', -INFO )
133 * Quick return if possible
138 * Compute the L*D*L**T (or U**T*D*U) factorization of A.
142 IF( D( I ).LE.ZERO ) THEN
148 D( I+1 ) = D( I+1 ) - E( I )*EI
151 DO 20 I = I4 + 1, N - 4, 4
153 * Drop out of the loop if d(i) <= 0: the matrix is not positive
156 IF( D( I ).LE.ZERO ) THEN
161 * Solve for e(i) and d(i+1).
165 D( I+1 ) = D( I+1 ) - E( I )*EI
167 IF( D( I+1 ).LE.ZERO ) THEN
172 * Solve for e(i+1) and d(i+2).
175 E( I+1 ) = EI / D( I+1 )
176 D( I+2 ) = D( I+2 ) - E( I+1 )*EI
178 IF( D( I+2 ).LE.ZERO ) THEN
183 * Solve for e(i+2) and d(i+3).
186 E( I+2 ) = EI / D( I+2 )
187 D( I+3 ) = D( I+3 ) - E( I+2 )*EI
189 IF( D( I+3 ).LE.ZERO ) THEN
194 * Solve for e(i+3) and d(i+4).
197 E( I+3 ) = EI / D( I+3 )
198 D( I+4 ) = D( I+4 ) - E( I+3 )*EI
201 * Check d(n) for positive definiteness.