351 SUBROUTINE cggsvd3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
352 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ,
353 $ WORK, LWORK, RWORK, IWORK, INFO )
360 CHARACTER JOBQ, JOBU, JOBV
361 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P,
366 REAL ALPHA( * ), BETA( * ), RWORK( * )
367 COMPLEX A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
368 $ u( ldu, * ), v( ldv, * ), work( * )
374 LOGICAL WANTQ, WANTU, WANTV, LQUERY
375 INTEGER I, IBND, ISUB, J, NCYCLE, LWKOPT
376 REAL ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
381 EXTERNAL lsame, clange, slamch
393 wantu = lsame( jobu,
'U' )
394 wantv = lsame( jobv,
'V' )
395 wantq = lsame( jobq,
'Q' )
396 lquery = ( lwork.EQ.-1 )
402 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
404 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
406 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
408 ELSE IF( m.LT.0 )
THEN
410 ELSE IF( n.LT.0 )
THEN
412 ELSE IF( p.LT.0 )
THEN
414 ELSE IF( lda.LT.max( 1, m ) )
THEN
416 ELSE IF( ldb.LT.max( 1, p ) )
THEN
418 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
420 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
422 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
424 ELSE IF( lwork.LT.1 .AND. .NOT.lquery )
THEN
431 CALL cggsvp3( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
432 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork,
433 $ work, work, -1, info )
434 lwkopt = n + int( work( 1 ) )
435 lwkopt = max( 2*n, lwkopt )
436 lwkopt = max( 1, lwkopt )
437 work( 1 ) = cmplx( lwkopt )
441 CALL xerbla(
'CGGSVD3', -info )
450 anorm = clange(
'1', m, n, a, lda, rwork )
451 bnorm = clange(
'1', p, n, b, ldb, rwork )
456 ulp = slamch(
'Precision' )
457 unfl = slamch(
'Safe Minimum' )
458 tola = max( m, n )*max( anorm, unfl )*ulp
459 tolb = max( p, n )*max( bnorm, unfl )*ulp
461 CALL cggsvp3( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
462 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork,
463 $ work, work( n+1 ), lwork-n, info )
467 CALL ctgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
468 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
469 $ work, ncycle, info )
474 CALL scopy( n, alpha, 1, rwork, 1 )
482 DO 10 j = i + 1, ibnd
484 IF( temp.GT.smax )
THEN
490 rwork( k+isub ) = rwork( k+i )
492 iwork( k+i ) = k + isub
498 work( 1 ) = cmplx( lwkopt )
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine cggsvd3(jobu, jobv, jobq, m, n, p, k, l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, lwork, rwork, iwork, info)
CGGSVD3 computes the singular value decomposition (SVD) for OTHER matrices
subroutine cggsvp3(jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola, tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, rwork, tau, work, lwork, info)
CGGSVP3
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