128 SUBROUTINE sgtsv( N, NRHS, DL, D, DU, B, LDB, INFO )
136 INTEGER INFO, LDB, N, NRHS
139 REAL B( ldb, * ), D( * ), DL( * ), DU( * )
146 parameter ( zero = 0.0e+0 )
163 ELSE IF( nrhs.LT.0 )
THEN
165 ELSE IF( ldb.LT.max( 1, n ) )
THEN
169 CALL xerbla(
'SGTSV ', -info )
178 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
182 IF( d( i ).NE.zero )
THEN
183 fact = dl( i ) / d( i )
184 d( i+1 ) = d( i+1 ) - fact*du( i )
185 b( i+1, 1 ) = b( i+1, 1 ) - fact*b( i, 1 )
195 fact = d( i ) / dl( i )
198 d( i+1 ) = du( i ) - fact*temp
200 du( i+1 ) = -fact*dl( i )
203 b( i, 1 ) = b( i+1, 1 )
204 b( i+1, 1 ) = temp - fact*b( i+1, 1 )
209 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
210 IF( d( i ).NE.zero )
THEN
211 fact = dl( i ) / d( i )
212 d( i+1 ) = d( i+1 ) - fact*du( i )
213 b( i+1, 1 ) = b( i+1, 1 ) - fact*b( i, 1 )
219 fact = d( i ) / dl( i )
222 d( i+1 ) = du( i ) - fact*temp
225 b( i, 1 ) = b( i+1, 1 )
226 b( i+1, 1 ) = temp - fact*b( i+1, 1 )
229 IF( d( n ).EQ.zero )
THEN
235 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
239 IF( d( i ).NE.zero )
THEN
240 fact = dl( i ) / d( i )
241 d( i+1 ) = d( i+1 ) - fact*du( i )
243 b( i+1, j ) = b( i+1, j ) - fact*b( i, j )
254 fact = d( i ) / dl( i )
257 d( i+1 ) = du( i ) - fact*temp
259 du( i+1 ) = -fact*dl( i )
263 b( i, j ) = b( i+1, j )
264 b( i+1, j ) = temp - fact*b( i+1, j )
270 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
271 IF( d( i ).NE.zero )
THEN
272 fact = dl( i ) / d( i )
273 d( i+1 ) = d( i+1 ) - fact*du( i )
275 b( i+1, j ) = b( i+1, j ) - fact*b( i, j )
282 fact = d( i ) / dl( i )
285 d( i+1 ) = du( i ) - fact*temp
289 b( i, j ) = b( i+1, j )
290 b( i+1, j ) = temp - fact*b( i+1, j )
294 IF( d( n ).EQ.zero )
THEN
305 b( n, j ) = b( n, j ) / d( n )
307 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) / d( n-1 )
308 DO 80 i = n - 2, 1, -1
309 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-dl( i )*
310 $ b( i+2, j ) ) / d( i )
318 b( n, j ) = b( n, j ) / d( n )
320 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
322 DO 90 i = n - 2, 1, -1
323 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-dl( i )*
324 $ b( i+2, j ) ) / d( i )
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine sgtsv(N, NRHS, DL, D, DU, B, LDB, INFO)
SGTSV computes the solution to system of linear equations A * X = B for GT matrices ...