1 SUBROUTINE ztrsv ( UPLO, TRANS, DIAG, N, A, LDA, X, INCX )
4 CHARACTER*1 DIAG, TRANS, UPLO
6 COMPLEX*16 A( LDA, * ), X( * )
105 parameter( zero = ( 0.0d+0, 0.0d+0 ) )
108 INTEGER I, INFO, IX, J, JX, KX
109 LOGICAL NOCONJ, NOUNIT
116 INTRINSIC dconjg, max
123 IF ( .NOT.lsame( uplo ,
'U' ).AND.
124 $ .NOT.lsame( uplo ,
'L' ) )
THEN
126 ELSE IF( .NOT.lsame( trans,
'N' ).AND.
127 $ .NOT.lsame( trans,
'T' ).AND.
128 $ .NOT.lsame( trans,
'C' ) )
THEN
130 ELSE IF( .NOT.lsame( diag ,
'U' ).AND.
131 $ .NOT.lsame( diag ,
'N' ) )
THEN
133 ELSE IF( n.LT.0 )
THEN
135 ELSE IF( lda.LT.max( 1, n ) )
THEN
137 ELSE IF( incx.EQ.0 )
THEN
141 CALL xerbla(
'ZTRSV ', info )
150 noconj = lsame( trans,
'T' )
151 nounit = lsame( diag ,
'N' )
157 kx = 1 - ( n - 1 )*incx
158 ELSE IF( incx.NE.1 )
THEN
165 IF( lsame( trans,
'N' ) )
THEN
169 IF( lsame( uplo,
'U' ) )
THEN
172 IF( x( j ).NE.zero )
THEN
174 $ x( j ) = x( j )/a( j, j )
176 DO 10, i = j - 1, 1, -1
177 x( i ) = x( i ) - temp*a( i, j )
182 jx = kx + ( n - 1 )*incx
184 IF( x( jx ).NE.zero )
THEN
186 $ x( jx ) = x( jx )/a( j, j )
189 DO 30, i = j - 1, 1, -1
191 x( ix ) = x( ix ) - temp*a( i, j )
200 IF( x( j ).NE.zero )
THEN
202 $ x( j ) = x( j )/a( j, j )
205 x( i ) = x( i ) - temp*a( i, j )
212 IF( x( jx ).NE.zero )
THEN
214 $ x( jx ) = x( jx )/a( j, j )
219 x( ix ) = x( ix ) - temp*a( i, j )
230 IF( lsame( uplo,
'U' ) )
THEN
236 temp = temp - a( i, j )*x( i )
239 $ temp = temp/a( j, j )
242 temp = temp - dconjg( a( i, j ) )*x( i )
245 $ temp = temp/dconjg( a( j, j ) )
256 temp = temp - a( i, j )*x( ix )
260 $ temp = temp/a( j, j )
263 temp = temp - dconjg( a( i, j ) )*x( ix )
267 $ temp = temp/dconjg( a( j, j ) )
278 DO 150, i = n, j + 1, -1
279 temp = temp - a( i, j )*x( i )
282 $ temp = temp/a( j, j )
284 DO 160, i = n, j + 1, -1
285 temp = temp - dconjg( a( i, j ) )*x( i )
288 $ temp = temp/dconjg( a( j, j ) )
293 kx = kx + ( n - 1 )*incx
299 DO 180, i = n, j + 1, -1
300 temp = temp - a( i, j )*x( ix )
304 $ temp = temp/a( j, j )
306 DO 190, i = n, j + 1, -1
307 temp = temp - dconjg( a( i, j ) )*x( ix )
311 $ temp = temp/dconjg( a( j, j ) )
subroutine xerbla(SRNAME, INFO)
subroutine ztrsv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)