181 SUBROUTINE dckcsd( 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 DOUBLE PRECISION U1( * ), U2( * ), V1T( * ), V2T( * ),
198 $ work( * ), x( * ), xf( * )
205 PARAMETER ( NTESTS = 15 )
207 parameter( ntypes = 4 )
208 DOUBLE PRECISION GAPDIGIT, ONE, ORTH, TEN, ZERO
209 parameter( gapdigit = 18.0d0, one = 1.0d0,
211 $ ten = 10.0d0, zero = 0.0d0 )
212 DOUBLE PRECISION PIOVER2
213 PARAMETER ( PIOVER2 = 1.57079632679489661923132169163975144210d0 )
218 INTEGER I, IINFO, IM, IMAT, J, LDU1, LDU2, LDV1T,
219 $ ldv2t, ldx, lwork, m, nfail, nrun, nt, p, q, r
222 LOGICAL DOTYPE( NTYPES )
223 DOUBLE PRECISION RESULT( NTESTS )
233 DOUBLE PRECISION DLARAN, DLARND
234 EXTERNAL DLARAN, DLARND
245 CALL alareq( path, nmats, dotype, ntypes, nin, nout )
260 DO 20 imat = 1, ntypes
264 IF( .NOT.dotype( imat ) )
270 CALL dlaror(
'L',
'I', m, m, x, ldx, iseed, work, iinfo )
271 IF( m .NE. 0 .AND. iinfo .NE. 0 )
THEN
272 WRITE( nout, fmt = 9999 ) m, iinfo
276 ELSE IF( imat.EQ.2 )
THEN
277 r = min( p, m-p, q, m-q )
279 theta(i) = piover2 * dlarnd( 1, iseed )
281 CALL dlacsg( m, p, q, theta, iseed, x, ldx, work )
284 x(i+(j-1)*ldx) = x(i+(j-1)*ldx) +
285 $ orth*dlarnd(2,iseed)
288 ELSE IF( imat.EQ.3 )
THEN
289 r = min( p, m-p, q, m-q )
291 theta(i) = ten**(-dlarnd(1,iseed)*gapdigit)
294 theta(i) = theta(i-1) + theta(i)
297 theta(i) = piover2 * theta(i) / theta(r+1)
299 CALL dlacsg( m, p, q, theta, iseed, x, ldx, work )
301 CALL dlaset(
'F', m, m, zero, one, x, ldx )
303 j = int( dlaran( iseed ) * m ) + 1
305 CALL drot( m, x(1+(i-1)*ldx), 1, x(1+(j-1)*ldx), 1,
313 CALL dcsdts( m, p, q, x, xf, ldx, u1, ldu1, u2, ldu2, v1t,
314 $ ldv1t, v2t, ldv2t, theta, iwork, work, lwork,
321 IF( result( i ).GE.thresh )
THEN
322 IF( nfail.EQ.0 .AND. firstt )
THEN
326 WRITE( nout, fmt = 9998 )m, p, q, imat, i,
337 CALL alasum( path, nout, nfail, nrun, 0 )
339 9999
FORMAT(
' DLAROR in DCKCSD: M = ', i5,
', INFO = ', i15 )
340 9998
FORMAT(
' M=', i4,
' P=', i4,
', Q=', i4,
', type ', i2,
341 $
', test ', i2,
', ratio=', g13.6 )
350 SUBROUTINE dlacsg( M, P, Q, THETA, ISEED, X, LDX, WORK )
355 DOUBLE PRECISION THETA( * )
356 DOUBLE PRECISION WORK( * ), X( LDX, * )
358 DOUBLE PRECISION ONE, ZERO
359 PARAMETER ( ONE = 1.0d0, zero = 0.0d0 )
363 r = min( p, m-p, q, m-q )
365 CALL dlaset(
'Full', m, m, zero, zero, x, ldx )
371 x(min(p,q)-r+i,min(p,q)-r+i) = cos(theta(i))
373 DO i = 1, min(p,m-q)-r
374 x(p-i+1,m-i+1) = -one
377 x(p-(min(p,m-q)-r)+1-i,m-(min(p,m-q)-r)+1-i) =
380 DO i = 1, min(m-p,q)-r
384 x(m-(min(m-p,q)-r)+1-i,q-(min(m-p,q)-r)+1-i) =
387 DO i = 1, min(m-p,m-q)-r
391 x(p+(min(m-p,m-q)-r)+i,q+(min(m-p,m-q)-r)+i) =
394 CALL dlaror(
'Left',
'No init', p, m, x, ldx, iseed, work, info )
395 CALL dlaror(
'Left',
'No init', m-p, m, x(p+1,1), ldx,
396 $ iseed, work, info )
397 CALL dlaror(
'Right',
'No init', m, q, x, ldx, iseed,
399 CALL dlaror(
'Right',
'No init', m, m-q,
400 $ 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 dckcsd(nm, mval, pval, qval, nmats, iseed, thresh, mmax, x, xf, u1, u2, v1t, v2t, theta, iwork, work, rwork, nin, nout, info)
DCKCSD
subroutine dlacsg(m, p, q, theta, iseed, x, ldx, work)
subroutine dcsdts(m, p, q, x, xf, ldx, u1, ldu1, u2, ldu2, v1t, ldv1t, v2t, ldv2t, theta, iwork, work, lwork, rwork, result)
DCSDTS
subroutine dlaror(side, init, m, n, a, lda, iseed, x, info)
DLAROR
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine drot(n, dx, incx, dy, incy, c, s)
DROT