183 SUBROUTINE sckcsd( NM, MVAL, PVAL, QVAL, NMATS, ISEED, THRESH,
184 $ mmax, x, xf, u1, u2, v1t, v2t, theta, iwork,
185 $ work, rwork, nin, nout, info )
193 INTEGER info, nin, nm, nmats, mmax, nout
197 INTEGER iseed( 4 ), iwork( * ), mval( * ), pval( * ),
199 REAL rwork( * ), theta( * )
200 REAL u1( * ), u2( * ), v1t( * ), v2t( * ),
201 $ work( * ), x( * ), xf( * )
208 parameter( ntests = 9 )
210 parameter( ntypes = 3 )
211 REAL gapdigit, orth, piover2, ten
212 parameter( gapdigit = 10.0e0, orth = 1.0e-4,
213 $ piover2 = 1.57079632679489662e0,
219 INTEGER i, iinfo, im, imat, j, ldu1, ldu2, ldv1t,
220 $ ldv2t, ldx, lwork, m, nfail, nrun, nt, p, q, r
223 LOGICAL dotype( ntypes )
224 REAL result( ntests )
246 CALL
alareq( path, nmats, dotype, ntypes, nin, nout )
261 DO 20 imat = 1, ntypes
265 IF( .NOT.dotype( imat ) )
271 CALL
slaror(
'L',
'I', m, m, x, ldx, iseed, work, iinfo )
272 IF( m .NE. 0 .AND. iinfo .NE. 0 )
THEN
273 WRITE( nout, fmt = 9999 ) m, iinfo
277 ELSE IF( imat.EQ.2 )
THEN
278 r = min( p, m-p, q, m-q )
280 theta(i) = piover2 *
slarnd( 1, iseed )
282 CALL
slacsg( m, p, q, theta, iseed, x, ldx, work )
285 x(i+(j-1)*ldx) = x(i+(j-1)*ldx) +
290 r = min( p, m-p, q, m-q )
292 theta(i) = ten**(-
slarnd(1,iseed)*gapdigit)
295 theta(i) = theta(i-1) + theta(i)
298 theta(i) = piover2 * theta(i) / theta(r+1)
300 CALL
slacsg( m, p, q, theta, iseed, x, ldx, work )
305 CALL
scsdts( m, p, q, x, xf, ldx, u1, ldu1, u2, ldu2, v1t,
306 $ ldv1t, v2t, ldv2t, theta, iwork, work, lwork,
313 IF( result( i ).GE.thresh )
THEN
314 IF( nfail.EQ.0 .AND. firstt )
THEN
318 WRITE( nout, fmt = 9998 )m, p, q, imat, i,
329 CALL
alasum( path, nout, nfail, nrun, 0 )
331 9999 format(
' SLAROR in SCKCSD: M = ', i5,
', INFO = ', i15 )
332 9998 format(
' M=', i4,
' P=', i4,
', Q=', i4,
', type ', i2,
333 $
', test ', i2,
', ratio=', g13.6 )
342 SUBROUTINE slacsg( M, P, Q, THETA, ISEED, X, LDX, WORK )
348 REAL work( * ), x( ldx, * )
351 parameter( one = 1.0e0, zero = 0.0e0 )
355 r = min( p, m-p, q, m-q )
357 CALL
slaset(
'Full', m, m, zero, zero, x, ldx )
363 x(min(p,q)-r+i,min(p,q)-r+i) = cos(theta(i))
365 DO i = 1, min(p,m-q)-r
366 x(p-i+1,m-i+1) = -one
369 x(p-(min(p,m-q)-r)+1-i,m-(min(p,m-q)-r)+1-i) =
372 DO i = 1, min(m-p,q)-r
376 x(m-(min(m-p,q)-r)+1-i,q-(min(m-p,q)-r)+1-i) =
379 DO i = 1, min(m-p,m-q)-r
383 x(p+(min(m-p,m-q)-r)+i,q+(min(m-p,m-q)-r)+i) =
386 CALL
slaror(
'Left',
'No init', p, m, x, ldx, iseed, work, info )
387 CALL
slaror(
'Left',
'No init', m-p, m, x(p+1,1), ldx,
388 $ iseed, work, info )
389 CALL
slaror(
'Right',
'No init', m, q, x, ldx, iseed,
391 CALL
slaror(
'Right',
'No init', m, m-q,
392 $ x(1,q+1), ldx, iseed, work, info )