199 SUBROUTINE zcgesv( N, NRHS, A, LDA, IPIV, B, LDB, X, LDX, WORK,
200 $ SWORK, RWORK, ITER, INFO )
207 INTEGER INFO, ITER, LDA, LDB, LDX, N, NRHS
211 DOUBLE PRECISION RWORK( * )
213 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( N, * ),
221 parameter( doitref = .true. )
224 parameter( itermax = 30 )
226 DOUBLE PRECISION BWDMAX
227 parameter( bwdmax = 1.0e+00 )
229 COMPLEX*16 NEGONE, ONE
230 parameter( negone = ( -1.0d+00, 0.0d+00 ),
231 $ one = ( 1.0d+00, 0.0d+00 ) )
234 INTEGER I, IITER, PTSA, PTSX
235 DOUBLE PRECISION ANRM, CTE, EPS, RNRM, XNRM
244 DOUBLE PRECISION DLAMCH, ZLANGE
245 EXTERNAL izamax, dlamch, zlange
248 INTRINSIC abs, dble, max, sqrt
251 DOUBLE PRECISION CABS1
254 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
265 ELSE IF( nrhs.LT.0 )
THEN
267 ELSE IF( lda.LT.max( 1, n ) )
THEN
269 ELSE IF( ldb.LT.max( 1, n ) )
THEN
271 ELSE IF( ldx.LT.max( 1, n ) )
THEN
275 CALL xerbla(
'ZCGESV', -info )
287 IF( .NOT.doitref )
THEN
294 anrm = zlange(
'I', n, n, a, lda, rwork )
295 eps = dlamch(
'Epsilon' )
296 cte = anrm*eps*sqrt( dble( n ) )*bwdmax
306 CALL zlag2c( n, nrhs, b, ldb, swork( ptsx ), n, info )
316 CALL zlag2c( n, n, a, lda, swork( ptsa ), n, info )
325 CALL cgetrf( n, n, swork( ptsa ), n, ipiv, info )
334 CALL cgetrs(
'No transpose', n, nrhs, swork( ptsa ), n, ipiv,
335 $ swork( ptsx ), n, info )
339 CALL clag2z( n, nrhs, swork( ptsx ), n, x, ldx, info )
343 CALL zlacpy(
'All', n, nrhs, b, ldb, work, n )
345 CALL zgemm(
'No Transpose',
'No Transpose', n, nrhs, n, negone, a,
346 $ lda, x, ldx, one, work, n )
352 xnrm = cabs1( x( izamax( n, x( 1, i ), 1 ), i ) )
353 rnrm = cabs1( work( izamax( n, work( 1, i ), 1 ), i ) )
354 IF( rnrm.GT.xnrm*cte )
366 DO 30 iiter = 1, itermax
371 CALL zlag2c( n, nrhs, work, n, swork( ptsx ), n, info )
380 CALL cgetrs(
'No transpose', n, nrhs, swork( ptsa ), n, ipiv,
381 $ swork( ptsx ), n, info )
386 CALL clag2z( n, nrhs, swork( ptsx ), n, work, n, info )
389 CALL zaxpy( n, one, work( 1, i ), 1, x( 1, i ), 1 )
394 CALL zlacpy(
'All', n, nrhs, b, ldb, work, n )
396 CALL zgemm(
'No Transpose',
'No Transpose', n, nrhs, n, negone,
397 $ a, lda, x, ldx, one, work, n )
403 xnrm = cabs1( x( izamax( n, x( 1, i ), 1 ), i ) )
404 rnrm = cabs1( work( izamax( n, work( 1, i ), 1 ), i ) )
405 IF( rnrm.GT.xnrm*cte )
432 CALL zgetrf( n, n, a, lda, ipiv, info )
437 CALL zlacpy(
'All', n, nrhs, b, ldb, x, ldx )
438 CALL zgetrs(
'No transpose', n, nrhs, a, lda, ipiv, x, ldx,
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 zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zcgesv(n, nrhs, a, lda, ipiv, b, ldb, x, ldx, work, swork, rwork, iter, info)
ZCGESV computes the solution to system of linear equations A * X = B for GE matrices (mixed precision...
subroutine cgetrf(m, n, a, lda, ipiv, info)
CGETRF
subroutine zgetrf(m, n, a, lda, ipiv, info)
ZGETRF
subroutine cgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
CGETRS
subroutine zgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
ZGETRS
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.