148 DOUBLE PRECISION FUNCTION zqrt17( 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 COMPLEX*16 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 )
186 INTRINSIC dble, dcmplx, max
192 IF(
lsame( trans,
'N' ) )
THEN
195 ELSE IF(
lsame( trans,
'C' ) )
THEN
199 CALL xerbla(
'ZQRT17', 1 )
203 IF( lwork.LT.ncols*nrhs )
THEN
204 CALL xerbla(
'ZQRT17', 13 )
208 IF( m.LE.0 .OR. n.LE.0 .OR. nrhs.LE.0 )
211 norma =
zlange(
'One-norm', m, n, a, lda, rwork )
212 smlnum =
dlamch(
'Safe minimum' ) /
dlamch(
'Precision' )
213 bignum = one / smlnum
218 CALL zlacpy(
'All', nrows, nrhs, b, ldb, c, ldb )
219 CALL zgemm( trans,
'No transpose', nrows, nrhs, ncols,
220 $ dcmplx( -one ), a, lda, x, ldx, dcmplx( one ), c,
222 normrs =
zlange(
'Max', nrows, nrhs, c, ldb, rwork )
223 IF( normrs.GT.smlnum )
THEN
225 CALL zlascl(
'General', 0, 0, normrs, one, nrows, nrhs, c, ldb,
231 CALL zgemm(
'Conjugate transpose', trans, nrhs, ncols, nrows,
232 $ dcmplx( one ), c, ldb, a, lda, dcmplx( zero ), work,
237 err =
zlange(
'One-norm', nrhs, ncols, work, nrhs, rwork )
244 IF( iresid.EQ.1 )
THEN
245 normb =
zlange(
'One-norm', nrows, nrhs, b, ldb, rwork )
253 zqrt17 = err / (
dlamch(
'Epsilon' )*dble( max( m, n, nrhs ) ) )
double precision function dlamch(CMACH)
DLAMCH
subroutine xerbla(SRNAME, INFO)
XERBLA
logical function lsame(CA, CB)
LSAME
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
double precision function zqrt17(TRANS, IRESID, M, N, NRHS, A, LDA, X, LDX, B, LDB, C, WORK, LWORK)
ZQRT17
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
subroutine zlascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
ZLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.