LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ 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 minor of order k is not
               positive definite; 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.
Date
December 2016

Definition at line 93 of file spttrf.f.

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