147 SUBROUTINE zqrt15( SCALE, RKSEL, M, N, NRHS, A, LDA, B, LDB, S,
148 $ RANK, NORMA, NORMB, ISEED, WORK, LWORK )
155 INTEGER LDA, LDB, LWORK, M, N, NRHS, RANK, RKSEL, SCALE
156 DOUBLE PRECISION NORMA, NORMB
160 DOUBLE PRECISION S( * )
161 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( LWORK )
167 DOUBLE PRECISION ZERO, ONE, TWO, SVMIN
168 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0,
170 COMPLEX*16 CZERO, CONE
171 parameter( czero = ( 0.0d+0, 0.0d+0 ),
172 $ cone = ( 1.0d+0, 0.0d+0 ) )
176 DOUBLE PRECISION BIGNUM, EPS, SMLNUM, TEMP
179 DOUBLE PRECISION DUMMY( 1 )
182 DOUBLE PRECISION DASUM, DLAMCH, DLARND, DZNRM2, ZLANGE
183 EXTERNAL dasum, dlamch, dlarnd, dznrm2, zlange
190 INTRINSIC abs, dcmplx, max, min
195 IF( lwork.LT.max( m+mn, mn*nrhs, 2*n+m ) )
THEN
196 CALL xerbla(
'ZQRT15', 16 )
200 smlnum = dlamch(
'Safe minimum' )
201 bignum = one / smlnum
202 eps = dlamch(
'Epsilon' )
203 smlnum = ( smlnum / eps ) / eps
204 bignum = one / smlnum
208 IF( rksel.EQ.1 )
THEN
210 ELSE IF( rksel.EQ.2 )
THEN
212 DO 10 j = rank + 1, mn
216 CALL xerbla(
'ZQRT15', 2 )
226 temp = dlarnd( 1, iseed )
227 IF( temp.GT.svmin )
THEN
233 CALL dlaord(
'Decreasing', rank, s, 1 )
237 CALL zlarnv( 2, iseed, m, work )
238 CALL zdscal( m, one / dznrm2( m, work, 1 ), work, 1 )
239 CALL zlaset(
'Full', m, rank, czero, cone, a, lda )
240 CALL zlarf(
'Left', m, rank, work, 1, dcmplx( two ), a, lda,
247 CALL zlarnv( 2, iseed, rank*nrhs, work )
248 CALL zgemm(
'No transpose',
'No transpose', m, nrhs, rank,
249 $ cone, a, lda, work, rank, czero, b, ldb )
256 CALL zdscal( m, s( j ), a( 1, j ), 1 )
259 $
CALL zlaset(
'Full', m, n-rank, czero, czero,
260 $ a( 1, rank+1 ), lda )
261 CALL zlaror(
'Right',
'No initialization', m, n, a, lda, iseed,
273 CALL zlaset(
'Full', m, n, czero, czero, a, lda )
274 CALL zlaset(
'Full', m, nrhs, czero, czero, b, ldb )
280 IF( scale.NE.1 )
THEN
281 norma = zlange(
'Max', m, n, a, lda, dummy )
282 IF( norma.NE.zero )
THEN
283 IF( scale.EQ.2 )
THEN
287 CALL zlascl(
'General', 0, 0, norma, bignum, m, n, a,
289 CALL dlascl(
'General', 0, 0, norma, bignum, mn, 1, s,
291 CALL zlascl(
'General', 0, 0, norma, bignum, m, nrhs, b,
293 ELSE IF( scale.EQ.3 )
THEN
297 CALL zlascl(
'General', 0, 0, norma, smlnum, m, n, a,
299 CALL dlascl(
'General', 0, 0, norma, smlnum, mn, 1, s,
301 CALL zlascl(
'General', 0, 0, norma, smlnum, m, nrhs, b,
304 CALL xerbla(
'ZQRT15', 1 )
310 norma = dasum( mn, s, 1 )
311 normb = zlange(
'One-norm', m, nrhs, b, ldb, dummy )
subroutine xerbla(srname, info)
subroutine dlaord(job, n, x, incx)
DLAORD
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zlarf(side, m, n, v, incv, tau, c, ldc, work)
ZLARF applies an elementary reflector to a general rectangular matrix.
subroutine zlarnv(idist, iseed, n, x)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
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 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 zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine zlaror(side, init, m, n, a, lda, iseed, x, info)
ZLAROR
subroutine zqrt15(scale, rksel, m, n, nrhs, a, lda, b, ldb, s, rank, norma, normb, iseed, work, lwork)
ZQRT15