148 DOUBLE PRECISION FUNCTION dqrt17( TRANS, IRESID, M, N, NRHS, A,
149 $ LDA, X, LDX, B, LDB, C, WORK, LWORK )
157 INTEGER iresid, lda, ldb, ldx, lwork, m, n, nrhs
160 DOUBLE PRECISION a( lda, * ), b( ldb, * ), c( ldb, * ),
161 $ work( lwork ), x( ldx, * )
167 DOUBLE PRECISION zero, one
168 parameter( zero = 0.0d0, one = 1.0d0 )
171 INTEGER info, iscl, ncols, nrows
172 DOUBLE PRECISION bignum, err, norma, normb, normrs, smlnum
175 DOUBLE PRECISION rwork( 1 )
192 IF(
lsame( trans,
'N' ) )
THEN
195 ELSE IF(
lsame( trans,
'T' ) )
THEN
199 CALL xerbla(
'DQRT17', 1 )
203 IF( lwork.LT.ncols*nrhs )
THEN
204 CALL xerbla(
'DQRT17', 13 )
208 IF( m.LE.0 .OR. n.LE.0 .OR. nrhs.LE.0 )
THEN
212 norma =
dlange(
'One-norm', m, n, a, lda, rwork )
213 smlnum =
dlamch(
'Safe minimum' ) /
dlamch(
'Precision' )
214 bignum = one / smlnum
219 CALL dlacpy(
'All', nrows, nrhs, b, ldb, c, ldb )
220 CALL dgemm( trans,
'No transpose', nrows, nrhs, ncols, -one, a,
221 $ lda, x, ldx, one, c, ldb )
222 normrs =
dlange(
'Max', nrows, nrhs, c, ldb, rwork )
223 IF( normrs.GT.smlnum )
THEN
225 CALL dlascl(
'General', 0, 0, normrs, one, nrows, nrhs, c, ldb,
231 CALL dgemm(
'Transpose', trans, nrhs, ncols, nrows, one, c, ldb,
232 $ a, lda, zero, work, nrhs )
236 err =
dlange(
'One-norm', nrhs, ncols, work, nrhs, rwork )
243 IF( iresid.EQ.1 )
THEN
244 normb =
dlange(
'One-norm', nrows, nrhs, b, ldb, rwork )
252 dqrt17 = err / (
dlamch(
'Epsilon' )*dble( max( m, n, nrhs ) ) )
double precision function dlamch(CMACH)
DLAMCH
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.
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
DLACPY copies all or part of one two-dimensional array to another.
subroutine xerbla(SRNAME, INFO)
XERBLA
logical function lsame(CA, CB)
LSAME
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
double precision function dqrt17(TRANS, IRESID, M, N, NRHS, A, LDA, X, LDX, B, LDB, C, WORK, LWORK)
DQRT17
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 ...