331 SUBROUTINE dggsvd( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
332 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,
340 CHARACTER JOBQ, JOBU, JOBV
341 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
345 DOUBLE PRECISION A( LDA, * ), ALPHA( * ), B( LDB, * ),
346 $ beta( * ), q( ldq, * ), u( ldu, * ),
347 $ v( ldv, * ), work( * )
353 LOGICAL WANTQ, WANTU, WANTV
354 INTEGER I, IBND, ISUB, J, NCYCLE
355 DOUBLE PRECISION ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
359 DOUBLE PRECISION DLAMCH, DLANGE
360 EXTERNAL lsame, dlamch, dlange
372 wantu = lsame( jobu,
'U' )
373 wantv = lsame( jobv,
'V' )
374 wantq = lsame( jobq,
'Q' )
377 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
379 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
381 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
383 ELSE IF( m.LT.0 )
THEN
385 ELSE IF( n.LT.0 )
THEN
387 ELSE IF( p.LT.0 )
THEN
389 ELSE IF( lda.LT.max( 1, m ) )
THEN
391 ELSE IF( ldb.LT.max( 1, p ) )
THEN
393 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
395 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
397 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
401 CALL xerbla(
'DGGSVD', -info )
407 anorm = dlange(
'1', m, n, a, lda, work )
408 bnorm = dlange(
'1', p, n, b, ldb, work )
413 ulp = dlamch(
'Precision' )
414 unfl = dlamch(
'Safe Minimum' )
415 tola = max( m, n )*max( anorm, unfl )*ulp
416 tolb = max( p, n )*max( bnorm, unfl )*ulp
420 CALL dggsvp( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
421 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, work,
422 $ work( n+1 ), info )
426 CALL dtgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
427 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
428 $ work, ncycle, info )
433 CALL dcopy( n, alpha, 1, work, 1 )
441 DO 10 j = i + 1, ibnd
443 IF( temp.GT.smax )
THEN
449 work( k+isub ) = work( k+i )
451 iwork( k+i ) = k + isub
subroutine xerbla(srname, info)
subroutine dggsvd(jobu, jobv, jobq, m, n, p, k, l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, iwork, info)
DGGSVD computes the singular value decomposition (SVD) for OTHER matrices
subroutine dggsvp(jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola, tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, tau, work, info)
DGGSVP
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dtgsja(jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb, tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle, info)
DTGSJA