335 SUBROUTINE cggsvd( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
336 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,
337 $ RWORK, IWORK, INFO )
344 CHARACTER JOBQ, JOBU, JOBV
345 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
349 REAL ALPHA( * ), BETA( * ), RWORK( * )
350 COMPLEX A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
351 $ u( ldu, * ), v( ldv, * ), work( * )
357 LOGICAL WANTQ, WANTU, WANTV
358 INTEGER I, IBND, ISUB, J, NCYCLE
359 REAL ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
364 EXTERNAL lsame, clange, slamch
376 wantu = lsame( jobu,
'U' )
377 wantv = lsame( jobv,
'V' )
378 wantq = lsame( jobq,
'Q' )
381 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
383 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
385 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
387 ELSE IF( m.LT.0 )
THEN
389 ELSE IF( n.LT.0 )
THEN
391 ELSE IF( p.LT.0 )
THEN
393 ELSE IF( lda.LT.max( 1, m ) )
THEN
395 ELSE IF( ldb.LT.max( 1, p ) )
THEN
397 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
399 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
401 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
405 CALL xerbla(
'CGGSVD', -info )
411 anorm = clange(
'1', m, n, a, lda, rwork )
412 bnorm = clange(
'1', p, n, b, ldb, rwork )
417 ulp = slamch(
'Precision' )
418 unfl = slamch(
'Safe Minimum' )
419 tola = max( m, n )*max( anorm, unfl )*ulp
420 tolb = max( p, n )*max( bnorm, unfl )*ulp
422 CALL cggsvp( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
423 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork,
424 $ work, work( n+1 ), info )
428 CALL ctgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
429 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
430 $ work, ncycle, info )
435 CALL scopy( n, alpha, 1, rwork, 1 )
443 DO 10 j = i + 1, ibnd
445 IF( temp.GT.smax )
THEN
451 rwork( k+isub ) = rwork( k+i )
453 iwork( k+i ) = k + isub
subroutine xerbla(srname, info)
subroutine cggsvd(jobu, jobv, jobq, m, n, p, k, l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, rwork, iwork, info)
CGGSVD computes the singular value decomposition (SVD) for OTHER matrices
subroutine cggsvp(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)
CGGSVP
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine ctgsja(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)
CTGSJA