276 SUBROUTINE dlasd7( ICOMPQ, NL, NR, SQRE, K, D, Z, ZW, VF, VFW, VL,
277 $ VLW, ALPHA, BETA, DSIGMA, IDX, IDXP, IDXQ,
278 $ PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM,
286 INTEGER GIVPTR, ICOMPQ, INFO, K, LDGCOL, LDGNUM, NL,
288 DOUBLE PRECISION ALPHA, BETA, C, S
291 INTEGER GIVCOL( LDGCOL, * ), IDX( * ), IDXP( * ),
292 $ IDXQ( * ), PERM( * )
293 DOUBLE PRECISION D( * ), DSIGMA( * ), GIVNUM( LDGNUM, * ),
294 $ vf( * ), vfw( * ), vl( * ), vlw( * ), z( * ),
301 DOUBLE PRECISION ZERO, ONE, TWO, EIGHT
302 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0, two = 2.0d+0,
307 INTEGER I, IDXI, IDXJ, IDXJP, J, JP, JPREV, K2, M, N,
309 DOUBLE PRECISION EPS, HLFTOL, TAU, TOL, Z1
315 DOUBLE PRECISION DLAMCH, DLAPY2
316 EXTERNAL DLAMCH, DLAPY2
329 IF( ( icompq.LT.0 ) .OR. ( icompq.GT.1 ) )
THEN
331 ELSE IF( nl.LT.1 )
THEN
333 ELSE IF( nr.LT.1 )
THEN
335 ELSE IF( ( sqre.LT.0 ) .OR. ( sqre.GT.1 ) )
THEN
337 ELSE IF( ldgcol.LT.n )
THEN
339 ELSE IF( ldgnum.LT.n )
THEN
343 CALL xerbla(
'DLASD7', -info )
349 IF( icompq.EQ.1 )
THEN
356 z1 = alpha*vl( nlp1 )
360 z( i+1 ) = alpha*vl( i )
364 idxq( i+1 ) = idxq( i ) + 1
371 z( i ) = beta*vf( i )
378 idxq( i ) = idxq( i ) + nlp1
384 dsigma( i ) = d( idxq( i ) )
385 zw( i ) = z( idxq( i ) )
386 vfw( i ) = vf( idxq( i ) )
387 vlw( i ) = vl( idxq( i ) )
390 CALL dlamrg( nl, nr, dsigma( 2 ), 1, 1, idx( 2 ) )
394 d( i ) = dsigma( idxi )
396 vf( i ) = vfw( idxi )
397 vl( i ) = vlw( idxi )
402 eps = dlamch(
'Epsilon' )
403 tol = max( abs( alpha ), abs( beta ) )
404 tol = eight*eight*eps*max( abs( d( n ) ), tol )
428 IF( abs( z( j ) ).LE.tol )
THEN
447 IF( abs( z( j ) ).LE.tol )
THEN
457 IF( abs( d( j )-d( jprev ) ).LE.tol )
THEN
475 IF( icompq.EQ.1 )
THEN
477 idxjp = idxq( idx( jprev )+1 )
478 idxj = idxq( idx( j )+1 )
479 IF( idxjp.LE.nlp1 )
THEN
482 IF( idxj.LE.nlp1 )
THEN
485 givcol( givptr, 2 ) = idxjp
486 givcol( givptr, 1 ) = idxj
487 givnum( givptr, 2 ) = c
488 givnum( givptr, 1 ) = s
490 CALL drot( 1, vf( jprev ), 1, vf( j ), 1, c, s )
491 CALL drot( 1, vl( jprev ), 1, vl( j ), 1, c, s )
498 dsigma( k ) = d( jprev )
510 dsigma( k ) = d( jprev )
521 dsigma( j ) = d( jp )
525 IF( icompq.EQ.1 )
THEN
528 perm( j ) = idxq( idx( jp )+1 )
529 IF( perm( j ).LE.nlp1 )
THEN
530 perm( j ) = perm( j ) - 1
538 CALL dcopy( n-k, dsigma( k+1 ), 1, d( k+1 ), 1 )
545 IF( abs( dsigma( 2 ) ).LE.hlftol )
546 $ dsigma( 2 ) = hlftol
548 z( 1 ) = dlapy2( z1, z( m ) )
549 IF( z( 1 ).LE.tol )
THEN
557 CALL drot( 1, vf( m ), 1, vf( 1 ), 1, c, s )
558 CALL drot( 1, vl( m ), 1, vl( 1 ), 1, c, s )
560 IF( abs( z1 ).LE.tol )
THEN
569 CALL dcopy( k-1, zw( 2 ), 1, z( 2 ), 1 )
570 CALL dcopy( n-1, vfw( 2 ), 1, vf( 2 ), 1 )
571 CALL dcopy( n-1, vlw( 2 ), 1, vl( 2 ), 1 )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dlamrg(n1, n2, a, dtrd1, dtrd2, index)
DLAMRG creates a permutation list to merge the entries of two independently sorted sets into a single...
subroutine dlasd7(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)
DLASD7 merges the two sets of singular values together into a single sorted set. Then it tries to def...
subroutine drot(n, dx, incx, dy, incy, c, s)
DROT