125 SUBROUTINE sgtts2( ITRANS, N, NRHS, DL, D, DU, DU2, IPIV, B,
133 INTEGER ITRANS, LDB, N, NRHS
137 REAL B( LDB, * ), D( * ), DL( * ), DU( * ), DU2( * )
150 IF( n.EQ.0 .OR. nrhs.EQ.0 )
153 IF( itrans.EQ.0 )
THEN
166 temp = b( i+1-ip+i, j ) - dl( i )*b( ip, j )
167 b( i, j ) = b( ip, j )
173 b( n, j ) = b( n, j ) / d( n )
175 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
177 DO 30 i = n - 2, 1, -1
178 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-du2( i )*
179 $ b( i+2, j ) ) / d( i )
191 IF( ipiv( i ).EQ.i )
THEN
192 b( i+1, j ) = b( i+1, j ) - dl( i )*b( i, j )
195 b( i, j ) = b( i+1, j )
196 b( i+1, j ) = temp - dl( i )*b( i, j )
202 b( n, j ) = b( n, j ) / d( n )
204 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
206 DO 50 i = n - 2, 1, -1
207 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-du2( i )*
208 $ b( i+2, j ) ) / d( i )
222 b( 1, j ) = b( 1, j ) / d( 1 )
224 $ b( 2, j ) = ( b( 2, j )-du( 1 )*b( 1, j ) ) / d( 2 )
226 b( i, j ) = ( b( i, j )-du( i-1 )*b( i-1, j )-du2( i-2 )*
227 $ b( i-2, j ) ) / d( i )
232 DO 90 i = n - 1, 1, -1
234 temp = b( i, j ) - dl( i )*b( i+1, j )
235 b( i, j ) = b( ip, j )
248 b( 1, j ) = b( 1, j ) / d( 1 )
250 $ b( 2, j ) = ( b( 2, j )-du( 1 )*b( 1, j ) ) / d( 2 )
252 b( i, j ) = ( b( i, j )-du( i-1 )*b( i-1, j )-
253 $ du2( i-2 )*b( i-2, j ) ) / d( i )
255 DO 110 i = n - 1, 1, -1
256 IF( ipiv( i ).EQ.i )
THEN
257 b( i, j ) = b( i, j ) - dl( i )*b( i+1, j )
260 b( i+1, j ) = b( i, j ) - dl( i )*temp
subroutine sgtts2(itrans, n, nrhs, dl, d, du, du2, ipiv, b, ldb)
SGTTS2 solves a system of linear equations with a tridiagonal matrix using the LU factorization compu...