181 SUBROUTINE zckcsd( NM, MVAL, PVAL, QVAL, NMATS, ISEED, THRESH,
182 $ MMAX, X, XF, U1, U2, V1T, V2T, THETA, IWORK,
183 $ WORK, RWORK, NIN, NOUT, INFO )
190 INTEGER INFO, NIN, NM, NMATS, MMAX, NOUT
191 DOUBLE PRECISION THRESH
194 INTEGER ISEED( 4 ), IWORK( * ), MVAL( * ), PVAL( * ),
196 DOUBLE PRECISION RWORK( * ), THETA( * )
197 COMPLEX*16 U1( * ), U2( * ), V1T( * ), V2T( * ),
198 $ work( * ), x( * ), xf( * )
205 PARAMETER ( NTESTS = 15 )
207 parameter( ntypes = 4 )
208 DOUBLE PRECISION GAPDIGIT, ORTH, REALONE, REALZERO, TEN
209 parameter( gapdigit = 18.0d0, orth = 1.0d-12,
210 $ realone = 1.0d0, realzero = 0.0d0,
213 PARAMETER ( ONE = (1.0d0,0.0d0), zero = (0.0d0,0.0d0) )
214 DOUBLE PRECISION PIOVER2
215 parameter( piover2 = 1.57079632679489661923132169163975144210d0 )
220 INTEGER I, IINFO, IM, IMAT, J, LDU1, LDU2, LDV1T,
221 $ ldv2t, ldx, lwork, m, nfail, nrun, nt, p, q, r
224 LOGICAL DOTYPE( NTYPES )
225 DOUBLE PRECISION RESULT( NTESTS )
235 DOUBLE PRECISION DLARAN, DLARND
236 EXTERNAL DLARAN, DLARND
247 CALL alareq( path, nmats, dotype, ntypes, nin, nout )
262 DO 20 imat = 1, ntypes
266 IF( .NOT.dotype( imat ) )
272 CALL zlaror(
'L',
'I', m, m, x, ldx, iseed, work, iinfo )
273 IF( m .NE. 0 .AND. iinfo .NE. 0 )
THEN
274 WRITE( nout, fmt = 9999 ) m, iinfo
278 ELSE IF( imat.EQ.2 )
THEN
279 r = min( p, m-p, q, m-q )
281 theta(i) = piover2 * dlarnd( 1, iseed )
283 CALL zlacsg( m, p, q, theta, iseed, x, ldx, work )
286 x(i+(j-1)*ldx) = x(i+(j-1)*ldx) +
287 $ orth*dlarnd(2,iseed)
290 ELSE IF( imat.EQ.3 )
THEN
291 r = min( p, m-p, q, m-q )
293 theta(i) = ten**(-dlarnd(1,iseed)*gapdigit)
296 theta(i) = theta(i-1) + theta(i)
299 theta(i) = piover2 * theta(i) / theta(r+1)
301 CALL zlacsg( m, p, q, theta, iseed, x, ldx, work )
303 CALL zlaset(
'F', m, m, zero, one, x, ldx )
305 j = int( dlaran( iseed ) * m ) + 1
307 CALL zdrot( m, x(1+(i-1)*ldx), 1, x(1+(j-1)*ldx),
308 $ 1, realzero, realone )
315 CALL zcsdts( m, p, q, x, xf, ldx, u1, ldu1, u2, ldu2, v1t,
316 $ ldv1t, v2t, ldv2t, theta, iwork, work, lwork,
323 IF( result( i ).GE.thresh )
THEN
324 IF( nfail.EQ.0 .AND. firstt )
THEN
328 WRITE( nout, fmt = 9998 )m, p, q, imat, i,
339 CALL alasum( path, nout, nfail, nrun, 0 )
341 9999
FORMAT(
' ZLAROR in ZCKCSD: M = ', i5,
', INFO = ', i15 )
342 9998
FORMAT(
' M=', i4,
' P=', i4,
', Q=', i4,
', type ', i2,
343 $
', test ', i2,
', ratio=', g13.6 )
352 SUBROUTINE zlacsg( M, P, Q, THETA, ISEED, X, LDX, WORK )
357 DOUBLE PRECISION THETA( * )
358 COMPLEX*16 WORK( * ), X( LDX, * )
361 PARAMETER ( ONE = (1.0d0,0.0d0), zero = (0.0d0,0.0d0) )
365 r = min( p, m-p, q, m-q )
367 CALL zlaset(
'Full', m, m, zero, zero, x, ldx )
373 x(min(p,q)-r+i,min(p,q)-r+i) = dcmplx( cos(theta(i)), 0.0d0 )
375 DO i = 1, min(p,m-q)-r
376 x(p-i+1,m-i+1) = -one
379 x(p-(min(p,m-q)-r)+1-i,m-(min(p,m-q)-r)+1-i) =
380 $ dcmplx( -sin(theta(r-i+1)), 0.0d0 )
382 DO i = 1, min(m-p,q)-r
386 x(m-(min(m-p,q)-r)+1-i,q-(min(m-p,q)-r)+1-i) =
387 $ dcmplx( sin(theta(r-i+1)), 0.0d0 )
389 DO i = 1, min(m-p,m-q)-r
393 x(p+(min(m-p,m-q)-r)+i,q+(min(m-p,m-q)-r)+i) =
394 $ dcmplx( cos(theta(i)), 0.0d0 )
396 CALL zlaror(
'Left',
'No init', p, m, x, ldx, iseed, work, info )
397 CALL zlaror(
'Left',
'No init', m-p, m, x(p+1,1), ldx,
398 $ iseed, work, info )
399 CALL zlaror(
'Right',
'No init', m, q, x, ldx, iseed,
401 CALL zlaror(
'Right',
'No init', m, m-q,
402 $ x(1,q+1), ldx, iseed, work, info )
subroutine alareq(path, nmats, dotype, ntypes, nin, nout)
ALAREQ
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine alahdg(iounit, path)
ALAHDG
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 zdrot(n, zx, incx, zy, incy, c, s)
ZDROT
subroutine zlacsg(m, p, q, theta, iseed, x, ldx, work)
subroutine zckcsd(nm, mval, pval, qval, nmats, iseed, thresh, mmax, x, xf, u1, u2, v1t, v2t, theta, iwork, work, rwork, nin, nout, info)
ZCKCSD
subroutine zcsdts(m, p, q, x, xf, ldx, u1, ldu1, u2, ldu2, v1t, ldv1t, v2t, ldv2t, theta, iwork, work, lwork, rwork, result)
ZCSDTS
subroutine zlaror(side, init, m, n, a, lda, iseed, x, info)
ZLAROR