129 SUBROUTINE cgtts2( ITRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB )
137 INTEGER ITRANS, LDB, N, NRHS
141 COMPLEX B( ldb, * ), D( * ), DL( * ), DU( * ), DU2( * )
157 IF( n.EQ.0 .OR. nrhs.EQ.0 )
160 IF( itrans.EQ.0 )
THEN
172 IF( ipiv( i ).EQ.i )
THEN
173 b( i+1, j ) = b( i+1, j ) - dl( i )*b( i, j )
176 b( i, j ) = b( i+1, j )
177 b( i+1, j ) = temp - dl( i )*b( i, j )
183 b( n, j ) = b( n, j ) / d( n )
185 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
187 DO 30 i = n - 2, 1, -1
188 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-du2( i )*
189 $ b( i+2, j ) ) / d( i )
201 IF( ipiv( i ).EQ.i )
THEN
202 b( i+1, j ) = b( i+1, j ) - dl( i )*b( i, j )
205 b( i, j ) = b( i+1, j )
206 b( i+1, j ) = temp - dl( i )*b( i, j )
212 b( n, j ) = b( n, j ) / d( n )
214 $ b( n-1, j ) = ( b( n-1, j )-du( n-1 )*b( n, j ) ) /
216 DO 50 i = n - 2, 1, -1
217 b( i, j ) = ( b( i, j )-du( i )*b( i+1, j )-du2( i )*
218 $ b( i+2, j ) ) / d( i )
222 ELSE IF( itrans.EQ.1 )
THEN
232 b( 1, j ) = b( 1, j ) / d( 1 )
234 $ b( 2, j ) = ( b( 2, j )-du( 1 )*b( 1, j ) ) / d( 2 )
236 b( i, j ) = ( b( i, j )-du( i-1 )*b( i-1, j )-du2( i-2 )*
237 $ b( i-2, j ) ) / d( i )
242 DO 90 i = n - 1, 1, -1
243 IF( ipiv( i ).EQ.i )
THEN
244 b( i, j ) = b( i, j ) - dl( i )*b( i+1, j )
247 b( i+1, j ) = b( i, j ) - dl( i )*temp
260 b( 1, j ) = b( 1, j ) / d( 1 )
262 $ b( 2, j ) = ( b( 2, j )-du( 1 )*b( 1, j ) ) / d( 2 )
264 b( i, j ) = ( b( i, j )-du( i-1 )*b( i-1, j )-
265 $ du2( i-2 )*b( i-2, j ) ) / d( i )
270 DO 110 i = n - 1, 1, -1
271 IF( ipiv( i ).EQ.i )
THEN
272 b( i, j ) = b( i, j ) - dl( i )*b( i+1, j )
275 b( i+1, j ) = b( i, j ) - dl( i )*temp
291 b( 1, j ) = b( 1, j ) / conjg( d( 1 ) )
293 $ b( 2, j ) = ( b( 2, j )-conjg( du( 1 ) )*b( 1, j ) ) /
296 b( i, j ) = ( b( i, j )-conjg( du( i-1 ) )*b( i-1, j )-
297 $ conjg( du2( i-2 ) )*b( i-2, j ) ) /
303 DO 150 i = n - 1, 1, -1
304 IF( ipiv( i ).EQ.i )
THEN
305 b( i, j ) = b( i, j ) - conjg( dl( i ) )*b( i+1, j )
308 b( i+1, j ) = b( i, j ) - conjg( dl( i ) )*temp
321 b( 1, j ) = b( 1, j ) / conjg( d( 1 ) )
323 $ b( 2, j ) = ( b( 2, j )-conjg( du( 1 ) )*b( 1, j ) ) /
326 b( i, j ) = ( b( i, j )-conjg( du( i-1 ) )*
327 $ b( i-1, j )-conjg( du2( i-2 ) )*
328 $ b( i-2, j ) ) / conjg( d( i ) )
333 DO 170 i = n - 1, 1, -1
334 IF( ipiv( i ).EQ.i )
THEN
335 b( i, j ) = b( i, j ) - conjg( dl( i ) )*
339 b( i+1, j ) = b( i, j ) - conjg( dl( i ) )*temp
subroutine cgtts2(ITRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB)
CGTTS2 solves a system of linear equations with a tridiagonal matrix using the LU factorization compu...