151 REAL function
cqrt17( 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 COMPLEX a( lda, * ), b( ldb, * ), c( ldb, * ),
164 $ work( lwork ), x( ldx, * )
171 parameter( zero = 0.0e0, one = 1.0e0 )
174 INTEGER info, iscl, ncols, nrows
175 REAL err, norma, normb, normrs, smlnum
189 INTRINSIC cmplx, max, real
195 IF(
lsame( trans,
'N' ) )
THEN
198 ELSE IF(
lsame( trans,
'C' ) )
THEN
202 CALL xerbla(
'CQRT17', 1 )
206 IF( lwork.LT.ncols*nrhs )
THEN
207 CALL xerbla(
'CQRT17', 13 )
211 IF( m.LE.0 .OR. n.LE.0 .OR. nrhs.LE.0 )
214 norma =
clange(
'One-norm', m, n, a, lda, rwork )
215 smlnum =
slamch(
'Safe minimum' ) /
slamch(
'Precision' )
220 CALL clacpy(
'All', nrows, nrhs, b, ldb, c, ldb )
221 CALL cgemm( trans,
'No transpose', nrows, nrhs, ncols,
222 $ cmplx( -one ), a, lda, x, ldx, cmplx( one ), c, ldb )
223 normrs =
clange(
'Max', nrows, nrhs, c, ldb, rwork )
224 IF( normrs.GT.smlnum )
THEN
226 CALL clascl(
'General', 0, 0, normrs, one, nrows, nrhs, c, ldb,
232 CALL cgemm(
'Conjugate transpose', trans, nrhs, ncols, nrows,
233 $ cmplx( one ), c, ldb, a, lda, cmplx( zero ), work,
238 err =
clange(
'One-norm', nrhs, ncols, work, nrhs, rwork )
245 IF( iresid.EQ.1 )
THEN
246 normb =
clange(
'One-norm', nrows, nrhs, b, ldb, rwork )
254 cqrt17 = err / (
slamch(
'Epsilon' )*real( max( m, n, nrhs ) ) )
subroutine xerbla(srname, info)
real function cqrt17(trans, iresid, m, n, nrhs, a, lda, x, ldx, b, ldb, c, work, lwork)
CQRT17
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
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
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.
logical function lsame(ca, cb)
LSAME