331 SUBROUTINE sggsvd( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B,
332 $ LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,
340 CHARACTER JOBQ, JOBU, JOBV
341 INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
345 REAL A( LDA, * ), ALPHA( * ), B( LDB, * ),
346 $ beta( * ), q( ldq, * ), u( ldu, * ),
347 $ v( ldv, * ), work( * )
353 LOGICAL WANTQ, WANTU, WANTV
354 INTEGER I, IBND, ISUB, J, NCYCLE
355 REAL ANORM, BNORM, SMAX, TEMP, TOLA, TOLB, ULP, UNFL
360 EXTERNAL lsame, slamch, slange
372 wantu = lsame( jobu,
'U' )
373 wantv = lsame( jobv,
'V' )
374 wantq = lsame( jobq,
'Q' )
377 IF( .NOT.( wantu .OR. lsame( jobu,
'N' ) ) )
THEN
379 ELSE IF( .NOT.( wantv .OR. lsame( jobv,
'N' ) ) )
THEN
381 ELSE IF( .NOT.( wantq .OR. lsame( jobq,
'N' ) ) )
THEN
383 ELSE IF( m.LT.0 )
THEN
385 ELSE IF( n.LT.0 )
THEN
387 ELSE IF( p.LT.0 )
THEN
389 ELSE IF( lda.LT.max( 1, m ) )
THEN
391 ELSE IF( ldb.LT.max( 1, p ) )
THEN
393 ELSE IF( ldu.LT.1 .OR. ( wantu .AND. ldu.LT.m ) )
THEN
395 ELSE IF( ldv.LT.1 .OR. ( wantv .AND. ldv.LT.p ) )
THEN
397 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
401 CALL xerbla(
'SGGSVD', -info )
407 anorm = slange(
'1', m, n, a, lda, work )
408 bnorm = slange(
'1', p, n, b, ldb, work )
413 ulp = slamch(
'Precision' )
414 unfl = slamch(
'Safe Minimum' )
415 tola = max( m, n )*max( anorm, unfl )*ulp
416 tolb = max( p, n )*max( bnorm, unfl )*ulp
420 CALL sggsvp( jobu, jobv, jobq, m, p, n, a, lda, b, ldb, tola,
421 $ tolb, k, l, u, ldu, v, ldv, q, ldq, iwork, work,
422 $ work( n+1 ), info )
426 CALL stgsja( 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, work, 1 )
441 DO 10 j = i + 1, ibnd
443 IF( temp.GT.smax )
THEN
449 work( k+isub ) = work( k+i )
451 iwork( k+i ) = k + isub
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
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