151 DOUBLE PRECISION FUNCTION dqrt17( TRANS, IRESID, M, N, NRHS, A,
152 $ LDA, X, LDX, B, LDB, C, WORK, LWORK )
160 INTEGER iresid, lda, ldb, ldx, lwork, m, n, nrhs
163 DOUBLE PRECISION a( lda, * ), b( ldb, * ), c( ldb, * ),
164 $ work( lwork ), x( ldx, * )
170 DOUBLE PRECISION zero, one
171 parameter( zero = 0.0d0, one = 1.0d0 )
174 INTEGER info, iscl, ncols, nrows
175 DOUBLE PRECISION err, norma, normb, normrs, smlnum
178 DOUBLE PRECISION rwork( 1 )
195 IF(
lsame( trans,
'N' ) )
THEN
198 ELSE IF(
lsame( trans,
'T' ) )
THEN
202 CALL xerbla(
'DQRT17', 1 )
206 IF( lwork.LT.ncols*nrhs )
THEN
207 CALL xerbla(
'DQRT17', 13 )
211 IF( m.LE.0 .OR. n.LE.0 .OR. nrhs.LE.0 )
THEN
215 norma =
dlange(
'One-norm', m, n, a, lda, rwork )
216 smlnum =
dlamch(
'Safe minimum' ) /
dlamch(
'Precision' )
221 CALL dlacpy(
'All', nrows, nrhs, b, ldb, c, ldb )
222 CALL dgemm( trans,
'No transpose', nrows, nrhs, ncols, -one, a,
223 $ lda, x, ldx, one, c, ldb )
224 normrs =
dlange(
'Max', nrows, nrhs, c, ldb, rwork )
225 IF( normrs.GT.smlnum )
THEN
227 CALL dlascl(
'General', 0, 0, normrs, one, nrows, nrhs, c, ldb,
233 CALL dgemm(
'Transpose', trans, nrhs, ncols, nrows, one, c, ldb,
234 $ a, lda, zero, work, nrhs )
238 err =
dlange(
'One-norm', nrhs, ncols, work, nrhs, rwork )
245 IF( iresid.EQ.1 )
THEN
246 normb =
dlange(
'One-norm', nrows, nrhs, b, ldb, rwork )
254 dqrt17 = err / (
dlamch(
'Epsilon' )*dble( max( m, n, nrhs ) ) )
subroutine xerbla(srname, info)
double precision function dqrt17(trans, iresid, m, n, nrhs, a, lda, x, ldx, b, ldb, c, work, lwork)
DQRT17
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
double precision function dlamch(cmach)
DLAMCH
double precision function dlange(norm, m, n, a, lda, work)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
subroutine dlascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
logical function lsame(ca, cb)
LSAME