334 SUBROUTINE zggsvd( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
335 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,
336 $ RWORK, IWORK, INFO )
343 CHARACTER JOBQ, JOBU, JOBV
344 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
348 DOUBLE PRECISION ALPHA( * ), BETA( * ), RWORK( * )
349 COMPLEX*16 A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
350 $ u( ldu, * ), v( ldv, * ), work( * )
356 LOGICAL WANTQ, WANTU, WANTV
357 INTEGER I, IBND, ISUB, J, NCYCLE
358 DOUBLE PRECISION ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
362 DOUBLE PRECISION DLAMCH, ZLANGE
363 EXTERNAL lsame, dlamch, zlange
375 wantu = lsame( jobu,
'U' )
376 wantv = lsame( jobv,
'V' )
377 wantq = lsame( jobq,
'Q' )
380 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
382 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
384 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
386 ELSE IF( m.LT.0 )
THEN
388 ELSE IF( n.LT.0 )
THEN
390 ELSE IF( p.LT.0 )
THEN
392 ELSE IF( lda.LT.max( 1, m ) )
THEN
394 ELSE IF( ldb.LT.max( 1, p ) )
THEN
396 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
398 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
400 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
404 CALL xerbla(
'ZGGSVD', -info )
410 anorm = zlange(
'1', m, n, a, lda, rwork )
411 bnorm = zlange(
'1', p, n, b, ldb, rwork )
416 ulp = dlamch(
'Precision' )
417 unfl = dlamch(
'Safe Minimum' )
418 tola = max( m, n )*max( anorm, unfl )*ulp
419 tolb = max( p, n )*max( bnorm, unfl )*ulp
421 CALL zggsvp( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
422 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork,
423 $ work, work( n+1 ), info )
427 CALL ztgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
428 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
429 $ work, ncycle, info )
434 CALL dcopy( n, alpha, 1, rwork, 1 )
442 DO 10 j = i + 1, ibnd
444 IF( temp.GT.smax )
THEN
450 rwork( k+isub ) = rwork( k+i )
452 iwork( k+i ) = k + isub
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
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