148 REAL function
cqrt17( 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 a( lda, * ), b( ldb, * ), c( ldb, * ),
161 $ work( lwork ), x( ldx, * )
168 parameter( zero = 0.0e0, one = 1.0e0 )
171 INTEGER info, iscl, ncols, nrows
172 REAL bignum, err, norma, normb, normrs, smlnum
186 INTRINSIC cmplx, max, real
192 IF(
lsame( trans,
'N' ) )
THEN
195 ELSE IF(
lsame( trans,
'C' ) )
THEN
199 CALL xerbla(
'CQRT17', 1 )
203 IF( lwork.LT.ncols*nrhs )
THEN
204 CALL xerbla(
'CQRT17', 13 )
208 IF( m.LE.0 .OR. n.LE.0 .OR. nrhs.LE.0 )
211 norma =
clange(
'One-norm', m, n, a, lda, rwork )
212 smlnum =
slamch(
'Safe minimum' ) /
slamch(
'Precision' )
213 bignum = one / smlnum
218 CALL clacpy(
'All', nrows, nrhs, b, ldb, c, ldb )
219 CALL cgemm( trans,
'No transpose', nrows, nrhs, ncols,
220 $ cmplx( -one ), a, lda, x, ldx, cmplx( one ), c, ldb )
221 normrs =
clange(
'Max', nrows, nrhs, c, ldb, rwork )
222 IF( normrs.GT.smlnum )
THEN
224 CALL clascl(
'General', 0, 0, normrs, one, nrows, nrhs, c, ldb,
230 CALL cgemm(
'Conjugate transpose', trans, nrhs, ncols, nrows,
231 $ cmplx( one ), c, ldb, a, lda, cmplx( zero ), work,
236 err =
clange(
'One-norm', nrhs, ncols, work, nrhs, rwork )
243 IF( iresid.EQ.1 )
THEN
244 normb =
clange(
'One-norm', nrows, nrhs, b, ldb, rwork )
252 cqrt17 = err / (
slamch(
'Epsilon' )*real( max( m, n, nrhs ) ) )
subroutine xerbla(SRNAME, INFO)
XERBLA
logical function lsame(CA, CB)
LSAME
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
real function cqrt17(TRANS, IRESID, M, N, NRHS, A, LDA, X, LDX, B, LDB, C, WORK, LWORK)
CQRT17
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
subroutine clascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
CLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
real function slamch(CMACH)
SLAMCH