272 SUBROUTINE slasda( ICOMPQ, SMLSIZ, N, SQRE, D, E, U, LDU, VT, K,
273 $ difl, difr, z, poles, givptr, givcol, ldgcol,
274 $ perm, givnum, c, s, work, iwork, info )
282 INTEGER icompq, info, ldgcol, ldu, n, smlsiz, sqre
285 INTEGER givcol( ldgcol, * ), givptr( * ), iwork( * ),
286 $ k( * ), perm( ldgcol, * )
287 REAL c( * ), d( * ), difl( ldu, * ), difr( ldu, * ),
288 $ e( * ), givnum( ldu, * ), poles( ldu, * ),
289 $ s( * ), u( ldu, * ), vt( ldu, * ), work( * ),
297 parameter( zero = 0.0e+0, one = 1.0e+0 )
300 INTEGER i, i1, ic, idxq, idxqi, im1, inode, itemp, iwk,
301 $ j, lf, ll, lvl, lvl2, m, ncc, nd, ndb1, ndiml,
302 $ ndimr, nl, nlf, nlp1, nlvl, nr, nrf, nrp1, nru,
303 $ nwork1, nwork2, smlszp, sqrei, vf, vfi, vl, vli
315 IF( ( icompq.LT.0 ) .OR. ( icompq.GT.1 ) )
THEN
317 ELSE IF( smlsiz.LT.3 )
THEN
319 ELSE IF( n.LT.0 )
THEN
321 ELSE IF( ( sqre.LT.0 ) .OR. ( sqre.GT.1 ) )
THEN
323 ELSE IF( ldu.LT.( n+sqre ) )
THEN
325 ELSE IF( ldgcol.LT.n )
THEN
329 CALL
xerbla(
'SLASDA', -info )
337 IF( n.LE.smlsiz )
THEN
338 IF( icompq.EQ.0 )
THEN
339 CALL
slasdq(
'U', sqre, n, 0, 0, 0, d, e, vt, ldu, u, ldu,
340 $ u, ldu, work, info )
342 CALL
slasdq(
'U', sqre, n, m, n, 0, d, e, vt, ldu, u, ldu,
343 $ u, ldu, work, info )
363 nwork2 = nwork1 + smlszp*smlszp
365 CALL
slasdt( n, nlvl, nd, iwork( inode ), iwork( ndiml ),
366 $ iwork( ndimr ), smlsiz )
381 ic = iwork( inode+i1 )
382 nl = iwork( ndiml+i1 )
384 nr = iwork( ndimr+i1 )
387 idxqi = idxq + nlf - 2
391 IF( icompq.EQ.0 )
THEN
392 CALL
slaset(
'A', nlp1, nlp1, zero, one, work( nwork1 ),
394 CALL
slasdq(
'U', sqrei, nl, nlp1, nru, ncc, d( nlf ),
395 $ e( nlf ), work( nwork1 ), smlszp,
396 $ work( nwork2 ), nl, work( nwork2 ), nl,
397 $ work( nwork2 ), info )
398 itemp = nwork1 + nl*smlszp
399 CALL
scopy( nlp1, work( nwork1 ), 1, work( vfi ), 1 )
400 CALL
scopy( nlp1, work( itemp ), 1, work( vli ), 1 )
402 CALL
slaset(
'A', nl, nl, zero, one, u( nlf, 1 ), ldu )
403 CALL
slaset(
'A', nlp1, nlp1, zero, one, vt( nlf, 1 ), ldu )
404 CALL
slasdq(
'U', sqrei, nl, nlp1, nl, ncc, d( nlf ),
405 $ e( nlf ), vt( nlf, 1 ), ldu, u( nlf, 1 ), ldu,
406 $ u( nlf, 1 ), ldu, work( nwork1 ), info )
407 CALL
scopy( nlp1, vt( nlf, 1 ), 1, work( vfi ), 1 )
408 CALL
scopy( nlp1, vt( nlf, nlp1 ), 1, work( vli ), 1 )
416 IF( ( i.EQ.nd ) .AND. ( sqre.EQ.0 ) )
THEN
425 IF( icompq.EQ.0 )
THEN
426 CALL
slaset(
'A', nrp1, nrp1, zero, one, work( nwork1 ),
428 CALL
slasdq(
'U', sqrei, nr, nrp1, nru, ncc, d( nrf ),
429 $ e( nrf ), work( nwork1 ), smlszp,
430 $ work( nwork2 ), nr, work( nwork2 ), nr,
431 $ work( nwork2 ), info )
432 itemp = nwork1 + ( nrp1-1 )*smlszp
433 CALL
scopy( nrp1, work( nwork1 ), 1, work( vfi ), 1 )
434 CALL
scopy( nrp1, work( itemp ), 1, work( vli ), 1 )
436 CALL
slaset(
'A', nr, nr, zero, one, u( nrf, 1 ), ldu )
437 CALL
slaset(
'A', nrp1, nrp1, zero, one, vt( nrf, 1 ), ldu )
438 CALL
slasdq(
'U', sqrei, nr, nrp1, nr, ncc, d( nrf ),
439 $ e( nrf ), vt( nrf, 1 ), ldu, u( nrf, 1 ), ldu,
440 $ u( nrf, 1 ), ldu, work( nwork1 ), info )
441 CALL
scopy( nrp1, vt( nrf, 1 ), 1, work( vfi ), 1 )
442 CALL
scopy( nrp1, vt( nrf, nrp1 ), 1, work( vli ), 1 )
455 DO 50 lvl = nlvl, 1, -1
470 ic = iwork( inode+im1 )
471 nl = iwork( ndiml+im1 )
472 nr = iwork( ndimr+im1 )
482 idxqi = idxq + nlf - 1
485 IF( icompq.EQ.0 )
THEN
486 CALL
slasd6( icompq, nl, nr, sqrei, d( nlf ),
487 $ work( vfi ), work( vli ), alpha, beta,
488 $ iwork( idxqi ), perm, givptr( 1 ), givcol,
489 $ ldgcol, givnum, ldu, poles, difl, difr, z,
490 $ k( 1 ), c( 1 ), s( 1 ), work( nwork1 ),
491 $ iwork( iwk ), info )
494 CALL
slasd6( icompq, nl, nr, sqrei, d( nlf ),
495 $ work( vfi ), work( vli ), alpha, beta,
496 $ iwork( idxqi ), perm( nlf, lvl ),
497 $ givptr( j ), givcol( nlf, lvl2 ), ldgcol,
498 $ givnum( nlf, lvl2 ), ldu,
499 $ poles( nlf, lvl2 ), difl( nlf, lvl ),
500 $ difr( nlf, lvl2 ), z( nlf, lvl ), k( j ),
501 $ c( j ), s( j ), work( nwork1 ),
502 $ iwork( iwk ), info )