333 SUBROUTINE cggsvd( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
334 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,
335 $ RWORK, IWORK, INFO )
342 CHARACTER JOBQ, JOBU, JOBV
343 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
347 REAL ALPHA( * ), BETA( * ), RWORK( * )
348 COMPLEX A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
349 $ u( ldu, * ), v( ldv, * ), work( * )
355 LOGICAL WANTQ, WANTU, WANTV
356 INTEGER I, IBND, ISUB, J, NCYCLE
357 REAL ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
362 EXTERNAL lsame, clange, slamch
374 wantu = lsame( jobu,
'U' )
375 wantv = lsame( jobv,
'V' )
376 wantq = lsame( jobq,
'Q' )
379 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
381 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
383 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
385 ELSE IF( m.LT.0 )
THEN
387 ELSE IF( n.LT.0 )
THEN
389 ELSE IF( p.LT.0 )
THEN
391 ELSE IF( lda.LT.max( 1, m ) )
THEN
393 ELSE IF( ldb.LT.max( 1, p ) )
THEN
395 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
397 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
399 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
403 CALL xerbla(
'CGGSVD', -info )
409 anorm = clange(
'1', m, n, a, lda, rwork )
410 bnorm = clange(
'1', p, n, b, ldb, rwork )
415 ulp = slamch(
'Precision' )
416 unfl = slamch(
'Safe Minimum' )
417 tola = max( m, n )*max( anorm, unfl )*ulp
418 tolb = max( p, n )*max( bnorm, unfl )*ulp
420 CALL cggsvp( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
421 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork,
422 $ work, work( n+1 ), info )
426 CALL ctgsja( 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 scopy( n, alpha, 1, rwork, 1 )
441 DO 10 j = i + 1, ibnd
443 IF( temp.GT.smax )
THEN
449 rwork( k+isub ) = rwork( k+i )
451 iwork( k+i ) = k + isub
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 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