332 SUBROUTINE zggsvd( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
333 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,
334 $ RWORK, IWORK, INFO )
341 CHARACTER JOBQ, JOBU, JOBV
342 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
346 DOUBLE PRECISION ALPHA( * ), BETA( * ), RWORK( * )
347 COMPLEX*16 A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
348 $ u( ldu, * ), v( ldv, * ), work( * )
354 LOGICAL WANTQ, WANTU, WANTV
355 INTEGER I, IBND, ISUB, J, NCYCLE
356 DOUBLE PRECISION ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
360 DOUBLE PRECISION DLAMCH, ZLANGE
361 EXTERNAL lsame, dlamch, zlange
373 wantu = lsame( jobu,
'U' )
374 wantv = lsame( jobv,
'V' )
375 wantq = lsame( jobq,
'Q' )
378 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
380 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
382 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
384 ELSE IF( m.LT.0 )
THEN
386 ELSE IF( n.LT.0 )
THEN
388 ELSE IF( p.LT.0 )
THEN
390 ELSE IF( lda.LT.max( 1, m ) )
THEN
392 ELSE IF( ldb.LT.max( 1, p ) )
THEN
394 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
396 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
398 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
402 CALL xerbla(
'ZGGSVD', -info )
408 anorm = zlange(
'1', m, n, a, lda, rwork )
409 bnorm = zlange(
'1', p, n, b, ldb, rwork )
414 ulp = dlamch(
'Precision' )
415 unfl = dlamch(
'Safe Minimum' )
416 tola = max( m, n )*max( anorm, unfl )*ulp
417 tolb = max( p, n )*max( bnorm, unfl )*ulp
419 CALL zggsvp( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
420 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork,
421 $ work, work( n+1 ), info )
425 CALL ztgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
426 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
427 $ work, ncycle, info )
432 CALL dcopy( n, alpha, 1, rwork, 1 )
440 DO 10 j = i + 1, ibnd
442 IF( temp.GT.smax )
THEN
448 rwork( k+isub ) = rwork( k+i )
450 iwork( k+i ) = k + isub
subroutine ztgsja(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)
ZTGSJA
subroutine zggsvd(jobu, jobv, jobq, m, n, p, k, l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, rwork, iwork, info)
ZGGSVD computes the singular value decomposition (SVD) for OTHER matrices
subroutine zggsvp(jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola, tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork, tau, work, info)
ZGGSVP