209 SUBROUTINE dlasdq( UPLO, SQRE, N, NCVT, NRU, NCC, D, E, VT, LDVT,
210 $ U, LDU, C, LDC, WORK, INFO )
218 INTEGER INFO, LDC, LDU, LDVT, N, NCC, NCVT, NRU, SQRE
221 DOUBLE PRECISION C( LDC, * ), D( * ), E( * ), U( LDU, * ),
222 $ vt( ldvt, * ), work( * )
228 DOUBLE PRECISION ZERO
229 parameter( zero = 0.0d+0 )
233 INTEGER I, ISUB, IUPLO, J, NP1, SQRE1
234 DOUBLE PRECISION CS, R, SMIN, SN
252 IF( lsame( uplo,
'U' ) )
254 IF( lsame( uplo,
'L' ) )
256 IF( iuplo.EQ.0 )
THEN
258 ELSE IF( ( sqre.LT.0 ) .OR. ( sqre.GT.1 ) )
THEN
260 ELSE IF( n.LT.0 )
THEN
262 ELSE IF( ncvt.LT.0 )
THEN
264 ELSE IF( nru.LT.0 )
THEN
266 ELSE IF( ncc.LT.0 )
THEN
268 ELSE IF( ( ncvt.EQ.0 .AND. ldvt.LT.1 ) .OR.
269 $ ( ncvt.GT.0 .AND. ldvt.LT.max( 1, n ) ) )
THEN
271 ELSE IF( ldu.LT.max( 1, nru ) )
THEN
273 ELSE IF( ( ncc.EQ.0 .AND. ldc.LT.1 ) .OR.
274 $ ( ncc.GT.0 .AND. ldc.LT.max( 1, n ) ) )
THEN
278 CALL xerbla(
'DLASDQ', -info )
286 rotate = ( ncvt.GT.0 ) .OR. ( nru.GT.0 ) .OR. ( ncc.GT.0 )
293 IF( ( iuplo.EQ.1 ) .AND. ( sqre1.EQ.1 ) )
THEN
295 CALL dlartg( d( i ), e( i ), cs, sn, r )
298 d( i+1 ) = cs*d( i+1 )
304 CALL dlartg( d( n ), e( n ), cs, sn, r )
317 $
CALL dlasr(
'L',
'V',
'F', np1, ncvt, work( 1 ),
318 $ work( np1 ), vt, ldvt )
324 IF( iuplo.EQ.2 )
THEN
326 CALL dlartg( d( i ), e( i ), cs, sn, r )
329 d( i+1 ) = cs*d( i+1 )
339 IF( sqre1.EQ.1 )
THEN
340 CALL dlartg( d( n ), e( n ), cs, sn, r )
351 IF( sqre1.EQ.0 )
THEN
352 CALL dlasr(
'R',
'V',
'F', nru, n, work( 1 ),
353 $ work( np1 ), u, ldu )
355 CALL dlasr(
'R',
'V',
'F', nru, np1, work( 1 ),
356 $ work( np1 ), u, ldu )
360 IF( sqre1.EQ.0 )
THEN
361 CALL dlasr(
'L',
'V',
'F', n, ncc, work( 1 ),
362 $ work( np1 ), c, ldc )
364 CALL dlasr(
'L',
'V',
'F', np1, ncc, work( 1 ),
365 $ work( np1 ), c, ldc )
373 CALL dbdsqr(
'U', n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c,
386 IF( d( j ).LT.smin )
THEN
398 $
CALL dswap( ncvt, vt( isub, 1 ), ldvt, vt( i, 1 ), ldvt )
400 $
CALL dswap( nru, u( 1, isub ), 1, u( 1, i ), 1 )
402 $
CALL dswap( ncc, c( isub, 1 ), ldc, c( i, 1 ), ldc )
subroutine xerbla(srname, info)
subroutine dbdsqr(uplo, n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c, ldc, work, info)
DBDSQR
subroutine dlartg(f, g, c, s, r)
DLARTG generates a plane rotation with real cosine and real sine.
subroutine dlasdq(uplo, sqre, n, ncvt, nru, ncc, d, e, vt, ldvt, u, ldu, c, ldc, work, info)
DLASDQ computes the SVD of a real bidiagonal matrix with diagonal d and off-diagonal e....
subroutine dlasr(side, pivot, direct, m, n, c, s, a, lda)
DLASR applies a sequence of plane rotations to a general rectangular matrix.
subroutine dswap(n, dx, incx, dy, incy)
DSWAP