346 SUBROUTINE sggsvd3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
347 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ,
348 $ WORK, LWORK, IWORK, INFO )
355 CHARACTER JOBQ, JOBU, JOBV
356 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P,
361 REAL A( LDA, * ), ALPHA( * ), B( LDB, * ),
362 $ beta( * ), q( ldq, * ), u( ldu, * ),
363 $ v( ldv, * ), work( * )
369 LOGICAL WANTQ, WANTU, WANTV, LQUERY
370 INTEGER I, IBND, ISUB, J, NCYCLE, LWKOPT
371 REAL ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
375 REAL SLAMCH, SLANGE, SROUNDUP_LWORK
376 EXTERNAL lsame, slamch, slange, sroundup_lwork
388 wantu = lsame( jobu,
'U' )
389 wantv = lsame( jobv,
'V' )
390 wantq = lsame( jobq,
'Q' )
391 lquery = ( lwork.EQ.-1 )
397 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
399 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
401 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
403 ELSE IF( m.LT.0 )
THEN
405 ELSE IF( n.LT.0 )
THEN
407 ELSE IF( p.LT.0 )
THEN
409 ELSE IF( lda.LT.max( 1, m ) )
THEN
411 ELSE IF( ldb.LT.max( 1, p ) )
THEN
413 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
415 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
417 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
419 ELSE IF( lwork.LT.1 .AND. .NOT.lquery )
THEN
426 CALL sggsvp3( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
427 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, work,
429 lwkopt = n + int( work( 1 ) )
430 lwkopt = max( 2*n, lwkopt )
431 lwkopt = max( 1, lwkopt )
432 work( 1 ) = sroundup_lwork( lwkopt )
436 CALL xerbla(
'SGGSVD3', -info )
445 anorm = slange(
'1', m, n, a, lda, work )
446 bnorm = slange(
'1', p, n, b, ldb, work )
451 ulp = slamch(
'Precision' )
452 unfl = slamch(
'Safe Minimum' )
453 tola = max( m, n )*max( anorm, unfl )*ulp
454 tolb = max( p, n )*max( bnorm, unfl )*ulp
458 CALL sggsvp3( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
459 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, work,
460 $ work( n+1 ), lwork-n, info )
464 CALL stgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
465 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
466 $ work, ncycle, info )
471 CALL scopy( n, alpha, 1, work, 1 )
479 DO 10 j = i + 1, ibnd
481 IF( temp.GT.smax )
THEN
487 work( k+isub ) = work( k+i )
489 iwork( k+i ) = k + isub
495 work( 1 ) = sroundup_lwork( lwkopt )
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sggsvd3(jobu, jobv, jobq, m, n, p, k, l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, lwork, iwork, info)
SGGSVD3 computes the singular value decomposition (SVD) for OTHER matrices
subroutine sggsvp3(jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola, tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, tau, work, lwork, info)
SGGSVP3
subroutine stgsja(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)
STGSJA