346 SUBROUTINE dggsvd3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
347 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ,
348 $ WORK, LWORK, IWORK, INFO )
355 CHARACTER JOBQ, JOBU, JOBV
356 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P,
361 DOUBLE PRECISION A( LDA, * ), ALPHA( * ), B( LDB, * ),
362 $ beta( * ), q( ldq, * ), u( ldu, * ),
363 $ v( ldv, * ), work( * )
369 LOGICAL WANTQ, WANTU, WANTV, LQUERY
370 INTEGER I, IBND, ISUB, J, NCYCLE, LWKOPT
371 DOUBLE PRECISION ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
375 DOUBLE PRECISION DLAMCH, DLANGE
376 EXTERNAL lsame, dlamch, dlange
388 wantu = lsame( jobu,
'U' )
389 wantv = lsame( jobv,
'V' )
390 wantq = lsame( jobq,
'Q' )
391 lquery = ( lwork.EQ.-1 )
397 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
399 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
401 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
403 ELSE IF( m.LT.0 )
THEN
405 ELSE IF( n.LT.0 )
THEN
407 ELSE IF( p.LT.0 )
THEN
409 ELSE IF( lda.LT.max( 1, m ) )
THEN
411 ELSE IF( ldb.LT.max( 1, p ) )
THEN
413 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
415 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
417 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
419 ELSE IF( lwork.LT.1 .AND. .NOT.lquery )
THEN
426 CALL dggsvp3( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
427 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, work,
429 lwkopt = n + int( work( 1 ) )
430 lwkopt = max( 2*n, lwkopt )
431 lwkopt = max( 1, lwkopt )
432 work( 1 ) = dble( lwkopt )
436 CALL xerbla(
'DGGSVD3', -info )
445 anorm = dlange(
'1', m, n, a, lda, work )
446 bnorm = dlange(
'1', p, n, b, ldb, work )
451 ulp = dlamch(
'Precision' )
452 unfl = dlamch(
'Safe Minimum' )
453 tola = max( m, n )*max( anorm, unfl )*ulp
454 tolb = max( p, n )*max( bnorm, unfl )*ulp
458 CALL dggsvp3( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
459 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, work,
460 $ work( n+1 ), lwork-n, info )
464 CALL dtgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
465 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
466 $ work, ncycle, info )
471 CALL dcopy( n, alpha, 1, work, 1 )
479 DO 10 j = i + 1, ibnd
481 IF( temp.GT.smax )
THEN
487 work( k+isub ) = work( k+i )
489 iwork( k+i ) = k + isub
495 work( 1 ) = dble( lwkopt )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dggsvd3(jobu, jobv, jobq, m, n, p, k, l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, lwork, iwork, info)
DGGSVD3 computes the singular value decomposition (SVD) for OTHER matrices
subroutine dggsvp3(jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola, tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, tau, work, lwork, info)
DGGSVP3
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