207 SUBROUTINE zcposv( UPLO, N, NRHS, A, LDA, B, LDB, X, LDX, WORK,
208 $ SWORK, RWORK, ITER, INFO )
216 INTEGER INFO, ITER, LDA, LDB, LDX, N, NRHS
219 DOUBLE PRECISION RWORK( * )
221 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( N, * ),
229 parameter( doitref = .true. )
232 parameter( itermax = 30 )
234 DOUBLE PRECISION BWDMAX
235 parameter( bwdmax = 1.0e+00 )
237 COMPLEX*16 NEGONE, ONE
238 parameter( negone = ( -1.0d+00, 0.0d+00 ),
239 $ one = ( 1.0d+00, 0.0d+00 ) )
242 INTEGER I, IITER, PTSA, PTSX
243 DOUBLE PRECISION ANRM, CTE, EPS, RNRM, XNRM
252 DOUBLE PRECISION DLAMCH, ZLANHE
254 EXTERNAL izamax, dlamch, zlanhe, lsame
257 INTRINSIC abs, dble, max, sqrt
259 DOUBLE PRECISION CABS1
262 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
271 IF( .NOT.lsame( uplo,
'U' ) .AND. .NOT.lsame( uplo,
'L' ) )
THEN
273 ELSE IF( n.LT.0 )
THEN
275 ELSE IF( nrhs.LT.0 )
THEN
277 ELSE IF( lda.LT.max( 1, n ) )
THEN
279 ELSE IF( ldb.LT.max( 1, n ) )
THEN
281 ELSE IF( ldx.LT.max( 1, n ) )
THEN
285 CALL xerbla(
'ZCPOSV', -info )
297 IF( .NOT.doitref )
THEN
304 anrm = zlanhe(
'I', uplo, n, a, lda, rwork )
305 eps = dlamch(
'Epsilon' )
306 cte = anrm*eps*sqrt( dble( n ) )*bwdmax
316 CALL zlag2c( n, nrhs, b, ldb, swork( ptsx ), n, info )
326 CALL zlat2c( uplo, n, a, lda, swork( ptsa ), n, info )
335 CALL cpotrf( uplo, n, swork( ptsa ), n, info )
344 CALL cpotrs( uplo, n, nrhs, swork( ptsa ), n, swork( ptsx ), n,
349 CALL clag2z( n, nrhs, swork( ptsx ), n, x, ldx, info )
353 CALL zlacpy(
'All', n, nrhs, b, ldb, work, n )
355 CALL zhemm(
'Left', uplo, n, nrhs, negone, a, lda, x, ldx, one,
362 xnrm = cabs1( x( izamax( n, x( 1, i ), 1 ), i ) )
363 rnrm = cabs1( work( izamax( n, work( 1, i ), 1 ), i ) )
364 IF( rnrm.GT.xnrm*cte )
376 DO 30 iiter = 1, itermax
381 CALL zlag2c( n, nrhs, work, n, swork( ptsx ), n, info )
390 CALL cpotrs( uplo, n, nrhs, swork( ptsa ), n, swork( ptsx ), n,
396 CALL clag2z( n, nrhs, swork( ptsx ), n, work, n, info )
399 CALL zaxpy( n, one, work( 1, i ), 1, x( 1, i ), 1 )
404 CALL zlacpy(
'All', n, nrhs, b, ldb, work, n )
406 CALL zhemm(
'L', uplo, n, nrhs, negone, a, lda, x, ldx, one,
413 xnrm = cabs1( x( izamax( n, x( 1, i ), 1 ), i ) )
414 rnrm = cabs1( work( izamax( n, work( 1, i ), 1 ), i ) )
415 IF( rnrm.GT.xnrm*cte )
442 CALL zpotrf( uplo, n, a, lda, info )
447 CALL zlacpy(
'All', n, nrhs, b, ldb, x, ldx )
448 CALL zpotrs( uplo, n, nrhs, a, lda, x, ldx, info )
subroutine xerbla(srname, info)
subroutine clag2z(m, n, sa, ldsa, a, lda, info)
CLAG2Z converts a complex single precision matrix to a complex double precision matrix.
subroutine zlag2c(m, n, a, lda, sa, ldsa, info)
ZLAG2C converts a complex double precision matrix to a complex single precision matrix.
subroutine zlat2c(uplo, n, a, lda, sa, ldsa, info)
ZLAT2C converts a double complex triangular matrix to a complex triangular matrix.
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zhemm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
ZHEMM
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zcposv(uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork, rwork, iter, info)
ZCPOSV computes the solution to system of linear equations A * X = B for PO matrices
subroutine zpotrf(uplo, n, a, lda, info)
ZPOTRF
subroutine cpotrf(uplo, n, a, lda, info)
CPOTRF
subroutine cpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
CPOTRS
subroutine zpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
ZPOTRS