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

◆ spttrf()

subroutine spttrf ( integer n,
real, dimension( * ) d,
real, dimension( * ) e,
integer info )

SPTTRF

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

Purpose:
!>
!> SPTTRF computes the L*D*L**T factorization of a real symmetric
!> positive definite tridiagonal matrix A.  The factorization may also
!> be regarded as having the form A = U**T*D*U.
!> 
Parameters
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in,out]D
!>          D is REAL array, dimension (N)
!>          On entry, the n diagonal elements of the tridiagonal matrix
!>          A.  On exit, the n diagonal elements of the diagonal matrix
!>          D from the L*D*L**T factorization of A.
!> 
[in,out]E
!>          E is REAL array, dimension (N-1)
!>          On entry, the (n-1) subdiagonal elements of the tridiagonal
!>          matrix A.  On exit, the (n-1) subdiagonal elements of the
!>          unit bidiagonal factor L from the L*D*L**T factorization of A.
!>          E can also be regarded as the superdiagonal of the unit
!>          bidiagonal factor U from the U**T*D*U factorization of A.
!> 
[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; if k < N, the factorization could not
!>               be completed, while if k = N, the factorization was
!>               completed, but D(N) <= 0.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 88 of file spttrf.f.

89*
90* -- LAPACK computational routine --
91* -- LAPACK is a software package provided by Univ. of Tennessee, --
92* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
93*
94* .. Scalar Arguments ..
95 INTEGER INFO, N
96* ..
97* .. Array Arguments ..
98 REAL D( * ), E( * )
99* ..
100*
101* =====================================================================
102*
103* .. Parameters ..
104 REAL ZERO
105 parameter( zero = 0.0e+0 )
106* ..
107* .. Local Scalars ..
108 INTEGER I, I4
109 REAL EI
110* ..
111* .. External Subroutines ..
112 EXTERNAL xerbla
113* ..
114* .. Intrinsic Functions ..
115 INTRINSIC mod
116* ..
117* .. Executable Statements ..
118*
119* Test the input parameters.
120*
121 info = 0
122 IF( n.LT.0 ) THEN
123 info = -1
124 CALL xerbla( 'SPTTRF', -info )
125 RETURN
126 END IF
127*
128* Quick return if possible
129*
130 IF( n.EQ.0 )
131 $ RETURN
132*
133* Compute the L*D*L**T (or U**T*D*U) factorization of A.
134*
135 i4 = mod( n-1, 4 )
136 DO 10 i = 1, i4
137 IF( d( i ).LE.zero ) THEN
138 info = i
139 GO TO 30
140 END IF
141 ei = e( i )
142 e( i ) = ei / d( i )
143 d( i+1 ) = d( i+1 ) - e( i )*ei
144 10 CONTINUE
145*
146 DO 20 i = i4 + 1, n - 4, 4
147*
148* Drop out of the loop if d(i) <= 0: the matrix is not positive
149* definite.
150*
151 IF( d( i ).LE.zero ) THEN
152 info = i
153 GO TO 30
154 END IF
155*
156* Solve for e(i) and d(i+1).
157*
158 ei = e( i )
159 e( i ) = ei / d( i )
160 d( i+1 ) = d( i+1 ) - e( i )*ei
161*
162 IF( d( i+1 ).LE.zero ) THEN
163 info = i + 1
164 GO TO 30
165 END IF
166*
167* Solve for e(i+1) and d(i+2).
168*
169 ei = e( i+1 )
170 e( i+1 ) = ei / d( i+1 )
171 d( i+2 ) = d( i+2 ) - e( i+1 )*ei
172*
173 IF( d( i+2 ).LE.zero ) THEN
174 info = i + 2
175 GO TO 30
176 END IF
177*
178* Solve for e(i+2) and d(i+3).
179*
180 ei = e( i+2 )
181 e( i+2 ) = ei / d( i+2 )
182 d( i+3 ) = d( i+3 ) - e( i+2 )*ei
183*
184 IF( d( i+3 ).LE.zero ) THEN
185 info = i + 3
186 GO TO 30
187 END IF
188*
189* Solve for e(i+3) and d(i+4).
190*
191 ei = e( i+3 )
192 e( i+3 ) = ei / d( i+3 )
193 d( i+4 ) = d( i+4 ) - e( i+3 )*ei
194 20 CONTINUE
195*
196* Check d(n) for positive definiteness.
197*
198 IF( d( n ).LE.zero )
199 $ info = n
200*
201 30 CONTINUE
202 RETURN
203*
204* End of SPTTRF
205*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
Here is the call graph for this function:
Here is the caller graph for this function: