126 SUBROUTINE sgtsv( N, NRHS, DL, D, DU, B, LDB, INFO )
133 INTEGER INFO, LDB, N, NRHS
136 REAL B( LDB, * ), D( * ), DL( * ), DU( * )
143 parameter( zero = 0.0e+0 )
160 ELSE IF( nrhs.LT.0 )
THEN
162 ELSE IF( ldb.LT.max( 1, n ) )
THEN
166 CALL xerbla(
'SGTSV ', -info )
175 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
179 IF( d( i ).NE.zero )
THEN
180 fact = dl( i ) / d( i )
181 d( i+1 ) = d( i+1 ) - fact*du( i )
182 b( i+1, 1 ) = b( i+1, 1 ) - fact*b( i, 1 )
192 fact = d( i ) / dl( i )
195 d( i+1 ) = du( i ) - fact*temp
197 du( i+1 ) = -fact*dl( i )
200 b( i, 1 ) = b( i+1, 1 )
201 b( i+1, 1 ) = temp - fact*b( i+1, 1 )
206 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
207 IF( d( i ).NE.zero )
THEN
208 fact = dl( i ) / d( i )
209 d( i+1 ) = d( i+1 ) - fact*du( i )
210 b( i+1, 1 ) = b( i+1, 1 ) - fact*b( i, 1 )
216 fact = d( i ) / dl( i )
219 d( i+1 ) = du( i ) - fact*temp
222 b( i, 1 ) = b( i+1, 1 )
223 b( i+1, 1 ) = temp - fact*b( i+1, 1 )
226 IF( d( n ).EQ.zero )
THEN
232 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
236 IF( d( i ).NE.zero )
THEN
237 fact = dl( i ) / d( i )
238 d( i+1 ) = d( i+1 ) - fact*du( i )
240 b( i+1, j ) = b( i+1, j ) - fact*b( i, j )
251 fact = d( i ) / dl( i )
254 d( i+1 ) = du( i ) - fact*temp
256 du( i+1 ) = -fact*dl( i )
260 b( i, j ) = b( i+1, j )
261 b( i+1, j ) = temp - fact*b( i+1, j )
267 IF( abs( d( i ) ).GE.abs( dl( i ) ) )
THEN
268 IF( d( i ).NE.zero )
THEN
269 fact = dl( i ) / d( i )
270 d( i+1 ) = d( i+1 ) - fact*du( i )
272 b( i+1, j ) = b( i+1, j ) - fact*b( i, j )
279 fact = d( i ) / dl( i )
282 d( i+1 ) = du( i ) - fact*temp
286 b( i, j ) = b( i+1, j )
287 b( i+1, j ) = temp - fact*b( i+1, j )
291 IF( d( n ).EQ.zero )
THEN
302 b( n, j ) = b( n, j ) / d( n )
304 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) / d( n-1 )
305 DO 80 i = n - 2, 1, -1
306 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-dl( i )*
307 $ b( i+2, j ) ) / d( i )
315 b( n, j ) = b( n, j ) / d( n )
317 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
319 DO 90 i = n - 2, 1, -1
320 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-dl( i )*
321 $ b( i+2, j ) ) / d( i )
subroutine xerbla(srname, info)
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