197 SUBROUTINE dsposv( UPLO, N, NRHS, A, LDA, B, LDB, X, LDX, WORK,
198 $ SWORK, ITER, INFO )
206 INTEGER INFO, ITER, LDA, LDB, LDX, N, NRHS
210 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), WORK( N, * ),
218 parameter( doitref = .true. )
221 parameter( itermax = 30 )
223 DOUBLE PRECISION BWDMAX
224 parameter( bwdmax = 1.0e+00 )
226 DOUBLE PRECISION NEGONE, ONE
227 parameter( negone = -1.0d+0, one = 1.0d+0 )
230 INTEGER I, IITER, PTSA, PTSX
231 DOUBLE PRECISION ANRM, CTE, EPS, RNRM, XNRM
239 DOUBLE PRECISION DLAMCH, DLANSY
241 EXTERNAL idamax, dlamch, dlansy, lsame
244 INTRINSIC abs, dble, max, sqrt
253 IF( .NOT.lsame( uplo,
'U' ) .AND. .NOT.lsame( uplo,
'L' ) )
THEN
255 ELSE IF( n.LT.0 )
THEN
257 ELSE IF( nrhs.LT.0 )
THEN
259 ELSE IF( lda.LT.max( 1, n ) )
THEN
261 ELSE IF( ldb.LT.max( 1, n ) )
THEN
263 ELSE IF( ldx.LT.max( 1, n ) )
THEN
267 CALL xerbla(
'DSPOSV', -info )
279 IF( .NOT.doitref )
THEN
286 anrm = dlansy(
'I', uplo, n, a, lda, work )
287 eps = dlamch(
'Epsilon' )
288 cte = anrm*eps*sqrt( dble( n ) )*bwdmax
298 CALL dlag2s( n, nrhs, b, ldb, swork( ptsx ), n, info )
308 CALL dlat2s( uplo, n, a, lda, swork( ptsa ), n, info )
317 CALL spotrf( uplo, n, swork( ptsa ), n, info )
326 CALL spotrs( uplo, n, nrhs, swork( ptsa ), n, swork( ptsx ), n,
331 CALL slag2d( n, nrhs, swork( ptsx ), n, x, ldx, info )
335 CALL dlacpy(
'All', n, nrhs, b, ldb, work, n )
337 CALL dsymm(
'Left', uplo, n, nrhs, negone, a, lda, x, ldx, one,
344 xnrm = abs( x( idamax( n, x( 1, i ), 1 ), i ) )
345 rnrm = abs( work( idamax( n, work( 1, i ), 1 ), i ) )
346 IF( rnrm.GT.xnrm*cte )
358 DO 30 iiter = 1, itermax
363 CALL dlag2s( n, nrhs, work, n, swork( ptsx ), n, info )
372 CALL spotrs( uplo, n, nrhs, swork( ptsa ), n, swork( ptsx ), n,
378 CALL slag2d( n, nrhs, swork( ptsx ), n, work, n, info )
381 CALL daxpy( n, one, work( 1, i ), 1, x( 1, i ), 1 )
386 CALL dlacpy(
'All', n, nrhs, b, ldb, work, n )
388 CALL dsymm(
'L', uplo, n, nrhs, negone, a, lda, x, ldx, one,
395 xnrm = abs( x( idamax( n, x( 1, i ), 1 ), i ) )
396 rnrm = abs( work( idamax( n, work( 1, i ), 1 ), i ) )
397 IF( rnrm.GT.xnrm*cte )
424 CALL dpotrf( uplo, n, a, lda, info )
429 CALL dlacpy(
'All', n, nrhs, b, ldb, x, ldx )
430 CALL dpotrs( uplo, n, nrhs, a, lda, x, ldx, info )
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 dlat2s(uplo, n, a, lda, sa, ldsa, info)
DLAT2S converts a double-precision triangular matrix to a single-precision triangular matrix.
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
DSYMM
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dsposv(uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork, iter, info)
DSPOSV computes the solution to system of linear equations A * X = B for PO matrices
subroutine dpotrf(uplo, n, a, lda, info)
DPOTRF
subroutine spotrf(uplo, n, a, lda, info)
SPOTRF
subroutine dpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
DPOTRS
subroutine spotrs(uplo, n, nrhs, a, lda, b, ldb, info)
SPOTRS