193 SUBROUTINE dsgesv( N, NRHS, A, LDA, IPIV, B, LDB, X, LDX, WORK,
194 $ SWORK, ITER, INFO )
201 INTEGER INFO, ITER, LDA, LDB, LDX, N, NRHS
206 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), WORK( N, * ),
214 parameter( doitref = .true. )
217 parameter( itermax = 30 )
219 DOUBLE PRECISION BWDMAX
220 parameter( bwdmax = 1.0e+00 )
222 DOUBLE PRECISION NEGONE, ONE
223 parameter( negone = -1.0d+0, one = 1.0d+0 )
226 INTEGER I, IITER, PTSA, PTSX
227 DOUBLE PRECISION ANRM, CTE, EPS, RNRM, XNRM
235 DOUBLE PRECISION DLAMCH, DLANGE
236 EXTERNAL idamax, dlamch, dlange
239 INTRINSIC abs, dble, max, sqrt
250 ELSE IF( nrhs.LT.0 )
THEN
252 ELSE IF( lda.LT.max( 1, n ) )
THEN
254 ELSE IF( ldb.LT.max( 1, n ) )
THEN
256 ELSE IF( ldx.LT.max( 1, n ) )
THEN
260 CALL xerbla(
'DSGESV', -info )
272 IF( .NOT.doitref )
THEN
279 anrm = dlange(
'I', n, n, a, lda, work )
280 eps = dlamch(
'Epsilon' )
281 cte = anrm*eps*sqrt( dble( n ) )*bwdmax
291 CALL dlag2s( n, nrhs, b, ldb, swork( ptsx ), n, info )
301 CALL dlag2s( n, n, a, lda, swork( ptsa ), n, info )
310 CALL sgetrf( n, n, swork( ptsa ), n, ipiv, info )
319 CALL sgetrs(
'No transpose', n, nrhs, swork( ptsa ), n, ipiv,
320 $ swork( ptsx ), n, info )
324 CALL slag2d( n, nrhs, swork( ptsx ), n, x, ldx, info )
328 CALL dlacpy(
'All', n, nrhs, b, ldb, work, n )
330 CALL dgemm(
'No Transpose',
'No Transpose', n, nrhs, n, negone, a,
331 $ lda, x, ldx, one, work, n )
337 xnrm = abs( x( idamax( n, x( 1, i ), 1 ), i ) )
338 rnrm = abs( work( idamax( n, work( 1, i ), 1 ), i ) )
339 IF( rnrm.GT.xnrm*cte )
351 DO 30 iiter = 1, itermax
356 CALL dlag2s( n, nrhs, work, n, swork( ptsx ), n, info )
365 CALL sgetrs(
'No transpose', n, nrhs, swork( ptsa ), n, ipiv,
366 $ swork( ptsx ), n, info )
371 CALL slag2d( n, nrhs, swork( ptsx ), n, work, n, info )
374 CALL daxpy( n, one, work( 1, i ), 1, x( 1, i ), 1 )
379 CALL dlacpy(
'All', n, nrhs, b, ldb, work, n )
381 CALL dgemm(
'No Transpose',
'No Transpose', n, nrhs, n, negone,
382 $ a, lda, x, ldx, one, work, n )
388 xnrm = abs( x( idamax( n, x( 1, i ), 1 ), i ) )
389 rnrm = abs( work( idamax( n, work( 1, i ), 1 ), i ) )
390 IF( rnrm.GT.xnrm*cte )
417 CALL dgetrf( n, n, a, lda, ipiv, info )
422 CALL dlacpy(
'All', n, nrhs, b, ldb, x, ldx )
423 CALL dgetrs(
'No transpose', n, nrhs, a, lda, ipiv, x, ldx,
subroutine xerbla(srname, info)
subroutine dlag2s(m, n, a, lda, sa, ldsa, info)
DLAG2S converts a double precision matrix to a single precision matrix.
subroutine slag2d(m, n, sa, ldsa, a, lda, info)
SLAG2D converts a single precision matrix to a double precision matrix.
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dsgesv(n, nrhs, a, lda, ipiv, b, ldb, x, ldx, work, swork, iter, info)
DSGESV computes the solution to system of linear equations A * X = B for GE matrices (mixed precision...
subroutine sgetrf(m, n, a, lda, ipiv, info)
SGETRF
subroutine dgetrf(m, n, a, lda, ipiv, info)
DGETRF
subroutine sgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
SGETRS
subroutine dgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
DGETRS
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.