329 SUBROUTINE sggsvd( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
330 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,
338 CHARACTER JOBQ, JOBU, JOBV
339 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
343 REAL A( LDA, * ), ALPHA( * ), B( LDB, * ),
344 $ beta( * ), q( ldq, * ), u( ldu, * ),
345 $ v( ldv, * ), work( * )
351 LOGICAL WANTQ, WANTU, WANTV
352 INTEGER I, IBND, ISUB, J, NCYCLE
353 REAL ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
358 EXTERNAL lsame, slamch, slange
370 wantu = lsame( jobu,
'U' )
371 wantv = lsame( jobv,
'V' )
372 wantq = lsame( jobq,
'Q' )
375 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
377 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
379 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
381 ELSE IF( m.LT.0 )
THEN
383 ELSE IF( n.LT.0 )
THEN
385 ELSE IF( p.LT.0 )
THEN
387 ELSE IF( lda.LT.max( 1, m ) )
THEN
389 ELSE IF( ldb.LT.max( 1, p ) )
THEN
391 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
393 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
395 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
399 CALL xerbla(
'SGGSVD', -info )
405 anorm = slange(
'1', m, n, a, lda, work )
406 bnorm = slange(
'1', p, n, b, ldb, work )
411 ulp = slamch(
'Precision' )
412 unfl = slamch(
'Safe Minimum' )
413 tola = max( m, n )*max( anorm, unfl )*ulp
414 tolb = max( p, n )*max( bnorm, unfl )*ulp
418 CALL sggsvp( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
419 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, work,
420 $ work( n+1 ), info )
424 CALL stgsja( jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
425 $ tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq,
426 $ work, ncycle, info )
431 CALL scopy( n, alpha, 1, work, 1 )
439 DO 10 j = i + 1, ibnd
441 IF( temp.GT.smax )
THEN
447 work( k+isub ) = work( k+i )
449 iwork( k+i ) = k + isub
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
subroutine sggsvd(jobu, jobv, jobq, m, n, p, k, l, a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q, ldq, work, iwork, info)
SGGSVD computes the singular value decomposition (SVD) for OTHER matrices
subroutine sggsvp(jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola, tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, tau, work, info)
SGGSVP