321 SUBROUTINE sgesvj( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V,
322 $ LDV, WORK, LWORK, INFO )
329 INTEGER INFO, LDA, LDV, LWORK, M, MV, N
330 CHARACTER*1 JOBA, JOBU, JOBV
333 REAL A( LDA, * ), SVA( N ), V( LDV, * ),
341 parameter( zero = 0.0e0, half = 0.5e0, one = 1.0e0)
343 parameter( nsweep = 30 )
346 REAL AAPP, AAPP0, AAPQ, AAQQ, APOAQ, AQOAP, BIG,
347 $ bigtheta, cs, ctol, epsln, large, mxaapq,
348 $ mxsinj, rootbig, rooteps, rootsfmin, roottol,
349 $ skl, sfmin, small, sn, t, temp1, theta,
351 INTEGER BLSKIP, EMPTSW, i, ibr, IERR, igl, IJBLSK, ir1,
352 $ iswrot, jbc, jgl, kbl, lkahead, mvl, n2, n34,
353 $ n4, nbl, notrot, p, pskipped, q, rowskip,
355 LOGICAL APPLV, GOSCALE, LOWER, LSVEC, NOSCALE, ROTOK,
356 $ rsvec, uctol, upper
362 INTRINSIC abs, max, min, float, sign, sqrt
390 lsvec = lsame( jobu,
'U' )
391 uctol = lsame( jobu,
'C' )
392 rsvec = lsame( jobv,
'V' )
393 applv = lsame( jobv,
'A' )
394 upper = lsame( joba,
'U' )
395 lower = lsame( joba,
'L' )
397 IF( .NOT.( upper .OR. lower .OR. lsame( joba,
'G' ) ) )
THEN
399 ELSE IF( .NOT.( lsvec .OR. uctol .OR. lsame( jobu,
'N' ) ) )
THEN
401 ELSE IF( .NOT.( rsvec .OR. applv .OR. lsame( jobv,
'N' ) ) )
THEN
403 ELSE IF( m.LT.0 )
THEN
405 ELSE IF( ( n.LT.0 ) .OR. ( n.GT.m ) )
THEN
407 ELSE IF( lda.LT.m )
THEN
409 ELSE IF( mv.LT.0 )
THEN
411 ELSE IF( ( rsvec .AND. ( ldv.LT.n ) ) .OR.
412 $ ( applv .AND. ( ldv.LT.mv ) ) )
THEN
414 ELSE IF( uctol .AND. ( work( 1 ).LE.one ) )
THEN
416 ELSE IF( lwork.LT.max( m+n, 6 ) )
THEN
424 CALL xerbla(
'SGESVJ', -info )
430 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
RETURN
444 IF( lsvec .OR. rsvec .OR. applv )
THEN
445 ctol = sqrt( float( m ) )
453 epsln = slamch(
'Epsilon' )
454 rooteps = sqrt( epsln )
455 sfmin = slamch(
'SafeMinimum' )
456 rootsfmin = sqrt( sfmin )
457 small = sfmin / epsln
458 big = slamch(
'Overflow' )
460 rootbig = one / rootsfmin
461 large = big / sqrt( float( m*n ) )
462 bigtheta = one / rooteps
465 roottol = sqrt( tol )
467 IF( float( m )*epsln.GE.one )
THEN
469 CALL xerbla(
'SGESVJ', -info )
477 CALL slaset(
'A', mvl, n, zero, one, v, ldv )
478 ELSE IF( applv )
THEN
481 rsvec = rsvec .OR. applv
492 skl = one / sqrt( float( m )*float( n ) )
501 CALL slassq( m-p+1, a( p, p ), 1, aapp, aaqq )
502 IF( aapp.GT.big )
THEN
504 CALL xerbla(
'SGESVJ', -info )
508 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
512 sva( p ) = aapp*( aaqq*skl )
516 sva( q ) = sva( q )*skl
521 ELSE IF( upper )
THEN
526 CALL slassq( p, a( 1, p ), 1, aapp, aaqq )
527 IF( aapp.GT.big )
THEN
529 CALL xerbla(
'SGESVJ', -info )
533 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
537 sva( p ) = aapp*( aaqq*skl )
541 sva( q ) = sva( q )*skl
551 CALL slassq( m, a( 1, p ), 1, aapp, aaqq )
552 IF( aapp.GT.big )
THEN
554 CALL xerbla(
'SGESVJ', -info )
558 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
562 sva( p ) = aapp*( aaqq*skl )
566 sva( q ) = sva( q )*skl
573 IF( noscale )skl = one
582 IF( sva( p ).NE.zero )aaqq = min( aaqq, sva( p ) )
583 aapp = max( aapp, sva( p ) )
588 IF( aapp.EQ.zero )
THEN
589 IF( lsvec )
CALL slaset(
'G', m, n, zero, one, a, lda )
602 IF( lsvec )
CALL slascl(
'G', 0, 0, sva( 1 ), skl, m, 1,
603 $ a( 1, 1 ), lda, ierr )
604 work( 1 ) = one / skl
605 IF( sva( 1 ).GE.sfmin )
THEN
620 sn = sqrt( sfmin / epsln )
621 temp1 = sqrt( big / float( n ) )
622 IF( ( aapp.LE.sn ) .OR. ( aaqq.GE.temp1 ) .OR.
623 $ ( ( sn.LE.aaqq ) .AND. ( aapp.LE.temp1 ) ) )
THEN
624 temp1 = min( big, temp1 / aapp )
627 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.LE.temp1 ) )
THEN
628 temp1 = min( sn / aaqq, big / ( aapp*sqrt( float( n ) ) ) )
631 ELSE IF( ( aaqq.GE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
632 temp1 = max( sn / aaqq, temp1 / aapp )
635 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
636 temp1 = min( sn / aaqq, big / ( sqrt( float( n ) )*aapp ) )
645 IF( temp1.NE.one )
THEN
646 CALL slascl(
'G', 0, 0, one, temp1, n, 1, sva, n, ierr )
649 IF( skl.NE.one )
THEN
650 CALL slascl( joba, 0, 0, one, skl, m, n, a, lda, ierr )
656 emptsw = ( n*( n-1 ) ) / 2
684 IF( ( nbl*kbl ).NE.n )nbl = nbl + 1
689 rowskip = min( 5, kbl )
700 IF( ( lower .OR. upper ) .AND. ( n.GT.max( 64, 4*kbl ) ) )
THEN
722 CALL sgsvj0( jobv, m-n34, n-n34, a( n34+1, n34+1 ), lda,
723 $ work( n34+1 ), sva( n34+1 ), mvl,
724 $ v( n34*q+1, n34+1 ), ldv, epsln, sfmin, tol,
725 $ 2, work( n+1 ), lwork-n, ierr )
727 CALL sgsvj0( jobv, m-n2, n34-n2, a( n2+1, n2+1 ), lda,
728 $ work( n2+1 ), sva( n2+1 ), mvl,
729 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 2,
730 $ work( n+1 ), lwork-n, ierr )
732 CALL sgsvj1( jobv, m-n2, n-n2, n4, a( n2+1, n2+1 ), lda,
733 $ work( n2+1 ), sva( n2+1 ), mvl,
734 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
735 $ work( n+1 ), lwork-n, ierr )
737 CALL sgsvj0( jobv, m-n4, n2-n4, a( n4+1, n4+1 ), lda,
738 $ work( n4+1 ), sva( n4+1 ), mvl,
739 $ v( n4*q+1, n4+1 ), ldv, epsln, sfmin, tol, 1,
740 $ work( n+1 ), lwork-n, ierr )
742 CALL sgsvj0( jobv, m, n4, a, lda, work, sva, mvl, v, ldv,
743 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
746 CALL sgsvj1( jobv, m, n2, n4, a, lda, work, sva, mvl, v,
747 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
751 ELSE IF( upper )
THEN
754 CALL sgsvj0( jobv, n4, n4, a, lda, work, sva, mvl, v, ldv,
755 $ epsln, sfmin, tol, 2, work( n+1 ), lwork-n,
758 CALL sgsvj0( jobv, n2, n4, a( 1, n4+1 ), lda, work( n4+1 ),
759 $ sva( n4+1 ), mvl, v( n4*q+1, n4+1 ), ldv,
760 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
763 CALL sgsvj1( jobv, n2, n2, n4, a, lda, work, sva, mvl, v,
764 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
767 CALL sgsvj0( jobv, n2+n4, n4, a( 1, n2+1 ), lda,
768 $ work( n2+1 ), sva( n2+1 ), mvl,
769 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
770 $ work( n+1 ), lwork-n, ierr )
778 DO 1993 i = 1, nsweep
796 igl = ( ibr-1 )*kbl + 1
798 DO 1002 ir1 = 0, min( lkahead, nbl-ibr )
802 DO 2001 p = igl, min( igl+kbl-1, n-1 )
806 q = isamax( n-p+1, sva( p ), 1 ) + p - 1
808 CALL sswap( m, a( 1, p ), 1, a( 1, q ), 1 )
809 IF( rsvec )
CALL sswap( mvl, v( 1, p ), 1,
815 work( p ) = work( q )
833 IF( ( sva( p ).LT.rootbig ) .AND.
834 $ ( sva( p ).GT.rootsfmin ) )
THEN
835 sva( p ) = snrm2( m, a( 1, p ), 1 )*work( p )
839 CALL slassq( m, a( 1, p ), 1, temp1, aapp )
840 sva( p ) = temp1*sqrt( aapp )*work( p )
847 IF( aapp.GT.zero )
THEN
851 DO 2002 q = p + 1, min( igl+kbl-1, n )
855 IF( aaqq.GT.zero )
THEN
858 IF( aaqq.GE.one )
THEN
859 rotok = ( small*aapp ).LE.aaqq
860 IF( aapp.LT.( big / aaqq ) )
THEN
861 aapq = ( sdot( m, a( 1, p ), 1, a( 1,
862 $ q ), 1 )*work( p )*work( q ) /
865 CALL scopy( m, a( 1, p ), 1,
867 CALL slascl(
'G', 0, 0, aapp,
869 $ work( n+1 ), lda, ierr )
870 aapq = sdot( m, work( n+1 ), 1,
871 $ a( 1, q ), 1 )*work( q ) / aaqq
874 rotok = aapp.LE.( aaqq / small )
875 IF( aapp.GT.( small / aaqq ) )
THEN
876 aapq = ( sdot( m, a( 1, p ), 1, a( 1,
877 $ q ), 1 )*work( p )*work( q ) /
880 CALL scopy( m, a( 1, q ), 1,
882 CALL slascl(
'G', 0, 0, aaqq,
884 $ work( n+1 ), lda, ierr )
885 aapq = sdot( m, work( n+1 ), 1,
886 $ a( 1, p ), 1 )*work( p ) / aapp
890 mxaapq = max( mxaapq, abs( aapq ) )
894 IF( abs( aapq ).GT.tol )
THEN
909 theta = -half*abs( aqoap-apoaq ) / aapq
911 IF( abs( theta ).GT.bigtheta )
THEN
914 fastr( 3 ) = t*work( p ) / work( q )
915 fastr( 4 ) = -t*work( q ) /
917 CALL srotm( m, a( 1, p ), 1,
918 $ a( 1, q ), 1, fastr )
919 IF( rsvec )
CALL srotm( mvl,
923 sva( q ) = aaqq*sqrt( max( zero,
924 $ one+t*apoaq*aapq ) )
925 aapp = aapp*sqrt( max( zero,
926 $ one-t*aqoap*aapq ) )
927 mxsinj = max( mxsinj, abs( t ) )
933 thsign = -sign( one, aapq )
934 t = one / ( theta+thsign*
935 $ sqrt( one+theta*theta ) )
936 cs = sqrt( one / ( one+t*t ) )
939 mxsinj = max( mxsinj, abs( sn ) )
940 sva( q ) = aaqq*sqrt( max( zero,
941 $ one+t*apoaq*aapq ) )
942 aapp = aapp*sqrt( max( zero,
943 $ one-t*aqoap*aapq ) )
945 apoaq = work( p ) / work( q )
946 aqoap = work( q ) / work( p )
947 IF( work( p ).GE.one )
THEN
948 IF( work( q ).GE.one )
THEN
950 fastr( 4 ) = -t*aqoap
951 work( p ) = work( p )*cs
952 work( q ) = work( q )*cs
953 CALL srotm( m, a( 1, p ), 1,
956 IF( rsvec )
CALL srotm( mvl,
957 $ v( 1, p ), 1, v( 1, q ),
960 CALL saxpy( m, -t*aqoap,
963 CALL saxpy( m, cs*sn*apoaq,
966 work( p ) = work( p )*cs
967 work( q ) = work( q ) / cs
969 CALL saxpy( mvl, -t*aqoap,
979 IF( work( q ).GE.one )
THEN
980 CALL saxpy( m, t*apoaq,
983 CALL saxpy( m, -cs*sn*aqoap,
986 work( p ) = work( p ) / cs
987 work( q ) = work( q )*cs
989 CALL saxpy( mvl, t*apoaq,
998 IF( work( p ).GE.work( q ) )
1000 CALL saxpy( m, -t*aqoap,
1003 CALL saxpy( m, cs*sn*apoaq,
1006 work( p ) = work( p )*cs
1007 work( q ) = work( q ) / cs
1019 CALL saxpy( m, t*apoaq,
1026 work( p ) = work( p ) / cs
1027 work( q ) = work( q )*cs
1030 $ t*apoaq, v( 1, p ),
1044 CALL scopy( m, a( 1, p ), 1,
1046 CALL slascl(
'G', 0, 0, aapp, one, m,
1047 $ 1, work( n+1 ), lda,
1049 CALL slascl(
'G', 0, 0, aaqq, one, m,
1050 $ 1, a( 1, q ), lda, ierr )
1051 temp1 = -aapq*work( p ) / work( q )
1052 CALL saxpy( m, temp1, work( n+1 ), 1,
1054 CALL slascl(
'G', 0, 0, one, aaqq, m,
1055 $ 1, a( 1, q ), lda, ierr )
1056 sva( q ) = aaqq*sqrt( max( zero,
1058 mxsinj = max( mxsinj, sfmin )
1065 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1067 IF( ( aaqq.LT.rootbig ) .AND.
1068 $ ( aaqq.GT.rootsfmin ) )
THEN
1069 sva( q ) = snrm2( m, a( 1, q ), 1 )*
1074 CALL slassq( m, a( 1, q ), 1, t,
1076 sva( q ) = t*sqrt( aaqq )*work( q )
1079 IF( ( aapp / aapp0 ).LE.rooteps )
THEN
1080 IF( ( aapp.LT.rootbig ) .AND.
1081 $ ( aapp.GT.rootsfmin ) )
THEN
1082 aapp = snrm2( m, a( 1, p ), 1 )*
1087 CALL slassq( m, a( 1, p ), 1, t,
1089 aapp = t*sqrt( aapp )*work( p )
1096 IF( ir1.EQ.0 )notrot = notrot + 1
1098 pskipped = pskipped + 1
1102 IF( ir1.EQ.0 )notrot = notrot + 1
1103 pskipped = pskipped + 1
1106 IF( ( i.LE.swband ) .AND.
1107 $ ( pskipped.GT.rowskip ) )
THEN
1108 IF( ir1.EQ.0 )aapp = -aapp
1123 IF( ( ir1.EQ.0 ) .AND. ( aapp.EQ.zero ) )
1124 $ notrot = notrot + min( igl+kbl-1, n ) - p
1135 igl = ( ibr-1 )*kbl + 1
1137 DO 2010 jbc = ibr + 1, nbl
1139 jgl = ( jbc-1 )*kbl + 1
1144 DO 2100 p = igl, min( igl+kbl-1, n )
1147 IF( aapp.GT.zero )
THEN
1151 DO 2200 q = jgl, min( jgl+kbl-1, n )
1154 IF( aaqq.GT.zero )
THEN
1161 IF( aaqq.GE.one )
THEN
1162 IF( aapp.GE.aaqq )
THEN
1163 rotok = ( small*aapp ).LE.aaqq
1165 rotok = ( small*aaqq ).LE.aapp
1167 IF( aapp.LT.( big / aaqq ) )
THEN
1168 aapq = ( sdot( m, a( 1, p ), 1, a( 1,
1169 $ q ), 1 )*work( p )*work( q ) /
1172 CALL scopy( m, a( 1, p ), 1,
1174 CALL slascl(
'G', 0, 0, aapp,
1176 $ work( n+1 ), lda, ierr )
1177 aapq = sdot( m, work( n+1 ), 1,
1178 $ a( 1, q ), 1 )*work( q ) / aaqq
1181 IF( aapp.GE.aaqq )
THEN
1182 rotok = aapp.LE.( aaqq / small )
1184 rotok = aaqq.LE.( aapp / small )
1186 IF( aapp.GT.( small / aaqq ) )
THEN
1187 aapq = ( sdot( m, a( 1, p ), 1, a( 1,
1188 $ q ), 1 )*work( p )*work( q ) /
1191 CALL scopy( m, a( 1, q ), 1,
1193 CALL slascl(
'G', 0, 0, aaqq,
1195 $ work( n+1 ), lda, ierr )
1196 aapq = sdot( m, work( n+1 ), 1,
1197 $ a( 1, p ), 1 )*work( p ) / aapp
1201 mxaapq = max( mxaapq, abs( aapq ) )
1205 IF( abs( aapq ).GT.tol )
THEN
1215 theta = -half*abs( aqoap-apoaq ) / aapq
1216 IF( aaqq.GT.aapp0 )theta = -theta
1218 IF( abs( theta ).GT.bigtheta )
THEN
1220 fastr( 3 ) = t*work( p ) / work( q )
1221 fastr( 4 ) = -t*work( q ) /
1223 CALL srotm( m, a( 1, p ), 1,
1224 $ a( 1, q ), 1, fastr )
1225 IF( rsvec )
CALL srotm( mvl,
1229 sva( q ) = aaqq*sqrt( max( zero,
1230 $ one+t*apoaq*aapq ) )
1231 aapp = aapp*sqrt( max( zero,
1232 $ one-t*aqoap*aapq ) )
1233 mxsinj = max( mxsinj, abs( t ) )
1238 thsign = -sign( one, aapq )
1239 IF( aaqq.GT.aapp0 )thsign = -thsign
1240 t = one / ( theta+thsign*
1241 $ sqrt( one+theta*theta ) )
1242 cs = sqrt( one / ( one+t*t ) )
1244 mxsinj = max( mxsinj, abs( sn ) )
1245 sva( q ) = aaqq*sqrt( max( zero,
1246 $ one+t*apoaq*aapq ) )
1247 aapp = aapp*sqrt( max( zero,
1248 $ one-t*aqoap*aapq ) )
1250 apoaq = work( p ) / work( q )
1251 aqoap = work( q ) / work( p )
1252 IF( work( p ).GE.one )
THEN
1254 IF( work( q ).GE.one )
THEN
1255 fastr( 3 ) = t*apoaq
1256 fastr( 4 ) = -t*aqoap
1257 work( p ) = work( p )*cs
1258 work( q ) = work( q )*cs
1259 CALL srotm( m, a( 1, p ), 1,
1262 IF( rsvec )
CALL srotm( mvl,
1263 $ v( 1, p ), 1, v( 1, q ),
1266 CALL saxpy( m, -t*aqoap,
1269 CALL saxpy( m, cs*sn*apoaq,
1273 CALL saxpy( mvl, -t*aqoap,
1281 work( p ) = work( p )*cs
1282 work( q ) = work( q ) / cs
1285 IF( work( q ).GE.one )
THEN
1286 CALL saxpy( m, t*apoaq,
1289 CALL saxpy( m, -cs*sn*aqoap,
1293 CALL saxpy( mvl, t*apoaq,
1301 work( p ) = work( p ) / cs
1302 work( q ) = work( q )*cs
1304 IF( work( p ).GE.work( q ) )
1306 CALL saxpy( m, -t*aqoap,
1309 CALL saxpy( m, cs*sn*apoaq,
1312 work( p ) = work( p )*cs
1313 work( q ) = work( q ) / cs
1325 CALL saxpy( m, t*apoaq,
1332 work( p ) = work( p ) / cs
1333 work( q ) = work( q )*cs
1336 $ t*apoaq, v( 1, p ),
1349 IF( aapp.GT.aaqq )
THEN
1350 CALL scopy( m, a( 1, p ), 1,
1352 CALL slascl(
'G', 0, 0, aapp, one,
1353 $ m, 1, work( n+1 ), lda,
1355 CALL slascl(
'G', 0, 0, aaqq, one,
1356 $ m, 1, a( 1, q ), lda,
1358 temp1 = -aapq*work( p ) / work( q )
1359 CALL saxpy( m, temp1, work( n+1 ),
1361 CALL slascl(
'G', 0, 0, one, aaqq,
1362 $ m, 1, a( 1, q ), lda,
1364 sva( q ) = aaqq*sqrt( max( zero,
1366 mxsinj = max( mxsinj, sfmin )
1368 CALL scopy( m, a( 1, q ), 1,
1370 CALL slascl(
'G', 0, 0, aaqq, one,
1371 $ m, 1, work( n+1 ), lda,
1373 CALL slascl(
'G', 0, 0, aapp, one,
1374 $ m, 1, a( 1, p ), lda,
1376 temp1 = -aapq*work( q ) / work( p )
1377 CALL saxpy( m, temp1, work( n+1 ),
1379 CALL slascl(
'G', 0, 0, one, aapp,
1380 $ m, 1, a( 1, p ), lda,
1382 sva( p ) = aapp*sqrt( max( zero,
1384 mxsinj = max( mxsinj, sfmin )
1391 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1393 IF( ( aaqq.LT.rootbig ) .AND.
1394 $ ( aaqq.GT.rootsfmin ) )
THEN
1395 sva( q ) = snrm2( m, a( 1, q ), 1 )*
1400 CALL slassq( m, a( 1, q ), 1, t,
1402 sva( q ) = t*sqrt( aaqq )*work( q )
1405 IF( ( aapp / aapp0 )**2.LE.rooteps )
THEN
1406 IF( ( aapp.LT.rootbig ) .AND.
1407 $ ( aapp.GT.rootsfmin ) )
THEN
1408 aapp = snrm2( m, a( 1, p ), 1 )*
1413 CALL slassq( m, a( 1, p ), 1, t,
1415 aapp = t*sqrt( aapp )*work( p )
1423 pskipped = pskipped + 1
1428 pskipped = pskipped + 1
1432 IF( ( i.LE.swband ) .AND. ( ijblsk.GE.blskip ) )
1438 IF( ( i.LE.swband ) .AND.
1439 $ ( pskipped.GT.rowskip ) )
THEN
1453 IF( aapp.EQ.zero )notrot = notrot +
1454 $ min( jgl+kbl-1, n ) - jgl + 1
1455 IF( aapp.LT.zero )notrot = 0
1465 DO 2012 p = igl, min( igl+kbl-1, n )
1466 sva( p ) = abs( sva( p ) )
1473 IF( ( sva( n ).LT.rootbig ) .AND. ( sva( n ).GT.rootsfmin ) )
1475 sva( n ) = snrm2( m, a( 1, n ), 1 )*work( n )
1479 CALL slassq( m, a( 1, n ), 1, t, aapp )
1480 sva( n ) = t*sqrt( aapp )*work( n )
1485 IF( ( i.LT.swband ) .AND. ( ( mxaapq.LE.roottol ) .OR.
1486 $ ( iswrot.LE.n ) ) )swband = i
1488 IF( ( i.GT.swband+1 ) .AND. ( mxaapq.LT.sqrt( float( n ) )*
1489 $ tol ) .AND. ( float( n )*mxaapq*mxsinj.LT.tol ) )
THEN
1493 IF( notrot.GE.emptsw )
GO TO 1994
1515 DO 5991 p = 1, n - 1
1516 q = isamax( n-p+1, sva( p ), 1 ) + p - 1
1522 work( p ) = work( q )
1524 CALL sswap( m, a( 1, p ), 1, a( 1, q ), 1 )
1525 IF( rsvec )
CALL sswap( mvl, v( 1, p ), 1, v( 1, q ), 1 )
1527 IF( sva( p ).NE.zero )
THEN
1529 IF( sva( p )*skl.GT.sfmin )n2 = n2 + 1
1532 IF( sva( n ).NE.zero )
THEN
1534 IF( sva( n )*skl.GT.sfmin )n2 = n2 + 1
1539 IF( lsvec .OR. uctol )
THEN
1541 CALL sscal( m, work( p ) / sva( p ), a( 1, p ), 1 )
1550 CALL sscal( mvl, work( p ), v( 1, p ), 1 )
1554 temp1 = one / snrm2( mvl, v( 1, p ), 1 )
1555 CALL sscal( mvl, temp1, v( 1, p ), 1 )
1561 IF( ( ( skl.GT.one ) .AND. ( sva( 1 ).LT.( big / skl ) ) )
1562 $ .OR. ( ( skl.LT.one ) .AND. ( sva( max( n2, 1 ) ) .GT.
1563 $ ( sfmin / skl ) ) ) )
THEN
1565 sva( p ) = skl*sva( p )
1575 work( 2 ) = float( n4 )
1578 work( 3 ) = float( n2 )
1583 work( 4 ) = float( i )
subroutine xerbla(srname, info)
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgesvj(joba, jobu, jobv, m, n, a, lda, sva, mv, v, ldv, work, lwork, info)
SGESVJ
subroutine sgsvj0(jobv, m, n, a, lda, d, sva, mv, v, ldv, eps, sfmin, tol, nsweep, work, lwork, info)
SGSVJ0 pre-processor for the routine sgesvj.
subroutine sgsvj1(jobv, m, n, n1, a, lda, d, sva, mv, v, ldv, eps, sfmin, tol, nsweep, work, lwork, info)
SGSVJ1 pre-processor for the routine sgesvj, applies Jacobi rotations targeting only particular pivot...
subroutine slascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine slassq(n, x, incx, scale, sumsq)
SLASSQ updates a sum of squares represented in scaled form.
subroutine srotm(n, sx, incx, sy, incy, sparam)
SROTM
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sswap(n, sx, incx, sy, incy)
SSWAP