127 SUBROUTINE sgtts2( ITRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB )
134 INTEGER ITRANS, LDB, N, NRHS
138 REAL B( LDB, * ), D( * ), DL( * ), DU( * ), DU2( * )
151 IF( n.EQ.0 .OR. nrhs.EQ.0 )
154 IF( itrans.EQ.0 )
THEN
167 temp = b( i+1-ip+i, j ) - dl( i )*b( ip, j )
168 b( i, j ) = b( ip, j )
174 b( n, j ) = b( n, j ) / d( n )
176 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
178 DO 30 i = n - 2, 1, -1
179 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-du2( i )*
180 $ b( i+2, j ) ) / d( i )
192 IF( ipiv( i ).EQ.i )
THEN
193 b( i+1, j ) = b( i+1, j ) - dl( i )*b( i, j )
196 b( i, j ) = b( i+1, j )
197 b( i+1, j ) = temp - dl( i )*b( i, j )
203 b( n, j ) = b( n, j ) / d( n )
205 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
207 DO 50 i = n - 2, 1, -1
208 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-du2( i )*
209 $ b( i+2, j ) ) / d( i )
223 b( 1, j ) = b( 1, j ) / d( 1 )
225 $ b( 2, j ) = ( b( 2, j )-du( 1 )*b( 1, j ) ) / d( 2 )
227 b( i, j ) = ( b( i, j )-du( i-1 )*b( i-1, j )-du2( i-2 )*
228 $ b( i-2, j ) ) / d( i )
233 DO 90 i = n - 1, 1, -1
235 temp = b( i, j ) - dl( i )*b( i+1, j )
236 b( i, j ) = b( ip, j )
249 b( 1, j ) = b( 1, j ) / d( 1 )
251 $ b( 2, j ) = ( b( 2, j )-du( 1 )*b( 1, j ) ) / d( 2 )
253 b( i, j ) = ( b( i, j )-du( i-1 )*b( i-1, j )-
254 $ du2( i-2 )*b( i-2, j ) ) / d( i )
256 DO 110 i = n - 1, 1, -1
257 IF( ipiv( i ).EQ.i )
THEN
258 b( i, j ) = b( i, j ) - dl( i )*b( i+1, j )
261 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...