274 SUBROUTINE slasd7( ICOMPQ, NL, NR, SQRE, K, D, Z, ZW, VF, VFW,
276 $ VLW, ALPHA, BETA, DSIGMA, IDX, IDXP, IDXQ,
277 $ PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM,
285 INTEGER GIVPTR, ICOMPQ, INFO, K, LDGCOL, LDGNUM, NL,
287 REAL ALPHA, BETA, C, S
290 INTEGER GIVCOL( LDGCOL, * ), IDX( * ), IDXP( * ),
291 $ idxq( * ), perm( * )
292 REAL D( * ), DSIGMA( * ), GIVNUM( LDGNUM, * ),
293 $ VF( * ), VFW( * ), VL( * ), VLW( * ), Z( * ),
300 REAL ZERO, ONE, TWO, EIGHT
301 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0, two = 2.0e+0,
306 INTEGER I, IDXI, IDXJ, IDXJP, J, JP, JPREV, K2, M, N,
308 REAL EPS, HLFTOL, TAU, TOL, Z1
315 EXTERNAL slamch, slapy2
328 IF( ( icompq.LT.0 ) .OR. ( icompq.GT.1 ) )
THEN
330 ELSE IF( nl.LT.1 )
THEN
332 ELSE IF( nr.LT.1 )
THEN
334 ELSE IF( ( sqre.LT.0 ) .OR. ( sqre.GT.1 ) )
THEN
336 ELSE IF( ldgcol.LT.n )
THEN
338 ELSE IF( ldgnum.LT.n )
THEN
342 CALL xerbla(
'SLASD7', -info )
348 IF( icompq.EQ.1 )
THEN
355 z1 = alpha*vl( nlp1 )
359 z( i+1 ) = alpha*vl( i )
363 idxq( i+1 ) = idxq( i ) + 1
370 z( i ) = beta*vf( i )
377 idxq( i ) = idxq( i ) + nlp1
383 dsigma( i ) = d( idxq( i ) )
384 zw( i ) = z( idxq( i ) )
385 vfw( i ) = vf( idxq( i ) )
386 vlw( i ) = vl( idxq( i ) )
389 CALL slamrg( nl, nr, dsigma( 2 ), 1, 1, idx( 2 ) )
393 d( i ) = dsigma( idxi )
395 vf( i ) = vfw( idxi )
396 vl( i ) = vlw( idxi )
401 eps = slamch(
'Epsilon' )
402 tol = max( abs( alpha ), abs( beta ) )
403 tol = eight*eight*eps*max( abs( d( n ) ), tol )
427 IF( abs( z( j ) ).LE.tol )
THEN
446 IF( abs( z( j ) ).LE.tol )
THEN
456 IF( abs( d( j )-d( jprev ) ).LE.tol )
THEN
474 IF( icompq.EQ.1 )
THEN
476 idxjp = idxq( idx( jprev )+1 )
477 idxj = idxq( idx( j )+1 )
478 IF( idxjp.LE.nlp1 )
THEN
481 IF( idxj.LE.nlp1 )
THEN
484 givcol( givptr, 2 ) = idxjp
485 givcol( givptr, 1 ) = idxj
486 givnum( givptr, 2 ) = c
487 givnum( givptr, 1 ) = s
489 CALL srot( 1, vf( jprev ), 1, vf( j ), 1, c, s )
490 CALL srot( 1, vl( jprev ), 1, vl( j ), 1, c, s )
497 dsigma( k ) = d( jprev )
509 dsigma( k ) = d( jprev )
520 dsigma( j ) = d( jp )
524 IF( icompq.EQ.1 )
THEN
527 perm( j ) = idxq( idx( jp )+1 )
528 IF( perm( j ).LE.nlp1 )
THEN
529 perm( j ) = perm( j ) - 1
537 CALL scopy( n-k, dsigma( k+1 ), 1, d( k+1 ), 1 )
544 IF( abs( dsigma( 2 ) ).LE.hlftol )
545 $ dsigma( 2 ) = hlftol
547 z( 1 ) = slapy2( z1, z( m ) )
548 IF( z( 1 ).LE.tol )
THEN
556 CALL srot( 1, vf( m ), 1, vf( 1 ), 1, c, s )
557 CALL srot( 1, vl( m ), 1, vl( 1 ), 1, c, s )
559 IF( abs( z1 ).LE.tol )
THEN
568 CALL scopy( k-1, zw( 2 ), 1, z( 2 ), 1 )
569 CALL scopy( n-1, vfw( 2 ), 1, vf( 2 ), 1 )
570 CALL scopy( n-1, vlw( 2 ), 1, vl( 2 ), 1 )
subroutine slasd7(icompq, nl, nr, sqre, k, d, z, zw, vf, vfw, vl, vlw, alpha, beta, dsigma, idx, idxp, idxq, perm, givptr, givcol, ldgcol, givnum, ldgnum, c, s, info)
SLASD7 merges the two sets of singular values together into a single sorted set. Then it tries to def...