129 SUBROUTINE clavsp( UPLO, TRANS, DIAG, N, NRHS, A, IPIV, B, LDB,
137 CHARACTER DIAG, TRANS, UPLO
138 INTEGER INFO, LDB, N, NRHS
142 COMPLEX A( * ), B( LDB, * )
149 parameter( one = ( 1.0e+0, 0.0e+0 ) )
153 INTEGER J, K, KC, KCNEXT, KP
154 COMPLEX D11, D12, D21, D22, T1, T2
171 IF( .NOT.lsame( uplo,
'U' ) .AND. .NOT.lsame( uplo,
'L' ) )
THEN
173 ELSE IF( .NOT.lsame( trans,
'N' ) .AND. .NOT.lsame( trans,
'T' ) )
176 ELSE IF( .NOT.lsame( diag,
'U' ) .AND. .NOT.lsame( diag,
'N' ) )
179 ELSE IF( n.LT.0 )
THEN
181 ELSE IF( ldb.LT.max( 1, n ) )
THEN
185 CALL xerbla(
'CLAVSP ', -info )
194 nounit = lsame( diag,
'N' )
200 IF( lsame( trans,
'N' ) )
THEN
205 IF( lsame( uplo,
'U' ) )
THEN
217 IF( ipiv( k ).GT.0 )
THEN
222 $
CALL cscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
230 CALL cgeru( k-1, nrhs, one, a( kc ), 1, b( k, 1 ),
231 $ ldb, b( 1, 1 ), ldb )
237 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
252 d12 = a( kcnext+k-1 )
257 b( k, j ) = d11*t1 + d12*t2
258 b( k+1, j ) = d21*t1 + d22*t2
268 CALL cgeru( k-1, nrhs, one, a( kc ), 1, b( k, 1 ),
269 $ ldb, b( 1, 1 ), ldb )
270 CALL cgeru( k-1, nrhs, one, a( kcnext ), 1,
271 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
275 kp = abs( ipiv( k ) )
277 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
293 kc = n*( n+1 ) / 2 + 1
302 IF( ipiv( k ).GT.0 )
THEN
309 $
CALL cscal( nrhs, a( kc ), b( k, 1 ), ldb )
318 CALL cgeru( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
319 $ ldb, b( k+1, 1 ), ldb )
325 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
333 kcnext = kc - ( n-k+2 )
345 b( k-1, j ) = d11*t1 + d12*t2
346 b( k, j ) = d21*t1 + d22*t2
356 CALL cgeru( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
357 $ ldb, b( k+1, 1 ), ldb )
358 CALL cgeru( n-k, nrhs, one, a( kcnext+2 ), 1,
359 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
364 kp = abs( ipiv( k ) )
366 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
385 IF( lsame( uplo,
'U' ) )
THEN
390 kc = n*( n+1 ) / 2 + 1
397 IF( ipiv( k ).GT.0 )
THEN
404 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
410 CALL cgemv(
'Transpose', k-1, nrhs, one, b, ldb,
411 $ a( kc ), 1, one, b( k, 1 ), ldb )
414 $
CALL cscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
420 kcnext = kc - ( k-1 )
425 kp = abs( ipiv( k ) )
427 $
CALL cswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
432 CALL cgemv(
'Transpose', k-2, nrhs, one, b, ldb,
433 $ a( kc ), 1, one, b( k, 1 ), ldb )
435 CALL cgemv(
'Transpose', k-2, nrhs, one, b, ldb,
436 $ a( kcnext ), 1, one, b( k-1, 1 ), ldb )
449 b( k-1, j ) = d11*t1 + d12*t2
450 b( k, j ) = d21*t1 + d22*t2
475 IF( ipiv( k ).GT.0 )
THEN
482 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
486 CALL cgemv(
'Transpose', n-k, nrhs, one, b( k+1, 1 ),
487 $ ldb, a( kc+1 ), 1, one, b( k, 1 ), ldb )
490 $
CALL cscal( nrhs, a( kc ), b( k, 1 ), ldb )
497 kcnext = kc + n - k + 1
502 kp = abs( ipiv( k ) )
504 $
CALL cswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
509 CALL cgemv(
'Transpose', n-k-1, nrhs, one,
510 $ b( k+2, 1 ), ldb, a( kcnext+1 ), 1, one,
513 CALL cgemv(
'Transpose', n-k-1, nrhs, one,
514 $ b( k+2, 1 ), ldb, a( kc+2 ), 1, one,
528 b( k, j ) = d11*t1 + d12*t2
529 b( k+1, j ) = d21*t1 + d22*t2
532 kc = kcnext + ( n-k )
subroutine xerbla(srname, info)
subroutine clavsp(uplo, trans, diag, n, nrhs, a, ipiv, b, ldb, info)
CLAVSP
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgeru(m, n, alpha, x, incx, y, incy, a, lda)
CGERU
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP