332 INTEGER info, lda, ldv, lwork, m, mv, n
333 CHARACTER*1 joba, jobu, jobv
336 REAL a( lda, * ), sva( n ), v( ldv, * ),
344 parameter ( zero = 0.0e0, half = 0.5e0, one = 1.0e0)
346 parameter ( nsweep = 30 )
349 REAL aapp, aapp0, aapq, aaqq, apoaq, aqoap, big,
350 $ bigtheta, cs, ctol, epsln, large, mxaapq,
351 $ mxsinj, rootbig, rooteps, rootsfmin, roottol,
352 $ skl, sfmin, small, sn, t, temp1, theta,
354 INTEGER blskip, emptsw, i, ibr, ierr, igl, ijblsk, ir1,
355 $ iswrot, jbc, jgl, kbl, lkahead, mvl, n2, n34,
356 $ n4, nbl, notrot, p, pskipped, q, rowskip,
358 LOGICAL applv, goscale, lower, lsvec, noscale, rotok,
359 $ rsvec, uctol, upper
365 INTRINSIC abs, max, min, float, sign, sqrt
393 lsvec =
lsame( jobu,
'U' )
394 uctol =
lsame( jobu,
'C' )
395 rsvec =
lsame( jobv,
'V' )
396 applv =
lsame( jobv,
'A' )
397 upper =
lsame( joba,
'U' )
398 lower =
lsame( joba,
'L' )
400 IF( .NOT.( upper .OR. lower .OR.
lsame( joba,
'G' ) ) )
THEN
402 ELSE IF( .NOT.( lsvec .OR. uctol .OR.
lsame( jobu,
'N' ) ) )
THEN
404 ELSE IF( .NOT.( rsvec .OR. applv .OR.
lsame( jobv,
'N' ) ) )
THEN
406 ELSE IF( m.LT.0 )
THEN
408 ELSE IF( ( n.LT.0 ) .OR. ( n.GT.m ) )
THEN
410 ELSE IF( lda.LT.m )
THEN
412 ELSE IF( mv.LT.0 )
THEN
414 ELSE IF( ( rsvec .AND. ( ldv.LT.n ) ) .OR.
415 $ ( applv .AND. ( ldv.LT.mv ) ) )
THEN
417 ELSE IF( uctol .AND. ( work( 1 ).LE.one ) )
THEN
419 ELSE IF( lwork.LT.max( m+n, 6 ) )
THEN
427 CALL xerbla(
'SGESVJ', -info )
433 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
RETURN
447 IF( lsvec .OR. rsvec .OR. applv )
THEN
448 ctol = sqrt( float( m ) )
456 epsln =
slamch(
'Epsilon' )
457 rooteps = sqrt( epsln )
458 sfmin =
slamch(
'SafeMinimum' )
459 rootsfmin = sqrt( sfmin )
460 small = sfmin / epsln
461 big =
slamch(
'Overflow' )
463 rootbig = one / rootsfmin
464 large = big / sqrt( float( m*n ) )
465 bigtheta = one / rooteps
468 roottol = sqrt( tol )
470 IF( float( m )*epsln.GE.one )
THEN
472 CALL xerbla(
'SGESVJ', -info )
480 CALL slaset(
'A', mvl, n, zero, one, v, ldv )
481 ELSE IF( applv )
THEN
484 rsvec = rsvec .OR. applv
495 skl = one / sqrt( float( m )*float( n ) )
504 CALL slassq( m-p+1, a( p, p ), 1, aapp, aaqq )
505 IF( aapp.GT.big )
THEN
507 CALL xerbla(
'SGESVJ', -info )
511 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
515 sva( p ) = aapp*( aaqq*skl )
519 sva( q ) = sva( q )*skl
524 ELSE IF( upper )
THEN
529 CALL slassq( p, a( 1, p ), 1, aapp, aaqq )
530 IF( aapp.GT.big )
THEN
532 CALL xerbla(
'SGESVJ', -info )
536 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
540 sva( p ) = aapp*( aaqq*skl )
544 sva( q ) = sva( q )*skl
554 CALL slassq( m, a( 1, p ), 1, aapp, aaqq )
555 IF( aapp.GT.big )
THEN
557 CALL xerbla(
'SGESVJ', -info )
561 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
565 sva( p ) = aapp*( aaqq*skl )
569 sva( q ) = sva( q )*skl
576 IF( noscale )skl = one
585 IF( sva( p ).NE.zero )aaqq = min( aaqq, sva( p ) )
586 aapp = max( aapp, sva( p ) )
591 IF( aapp.EQ.zero )
THEN
592 IF( lsvec )
CALL slaset(
'G', m, n, zero, one, a, lda )
605 IF( lsvec )
CALL slascl(
'G', 0, 0, sva( 1 ), skl, m, 1,
606 $ a( 1, 1 ), lda, ierr )
607 work( 1 ) = one / skl
608 IF( sva( 1 ).GE.sfmin )
THEN
623 sn = sqrt( sfmin / epsln )
624 temp1 = sqrt( big / float( n ) )
625 IF( ( aapp.LE.sn ) .OR. ( aaqq.GE.temp1 ) .OR.
626 $ ( ( sn.LE.aaqq ) .AND. ( aapp.LE.temp1 ) ) )
THEN
627 temp1 = min( big, temp1 / aapp )
630 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.LE.temp1 ) )
THEN
631 temp1 = min( sn / aaqq, big / ( aapp*sqrt( float( n ) ) ) )
634 ELSE IF( ( aaqq.GE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
635 temp1 = max( sn / aaqq, temp1 / aapp )
638 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
639 temp1 = min( sn / aaqq, big / ( sqrt( float( n ) )*aapp ) )
648 IF( temp1.NE.one )
THEN
649 CALL slascl(
'G', 0, 0, one, temp1, n, 1, sva, n, ierr )
652 IF( skl.NE.one )
THEN
653 CALL slascl( joba, 0, 0, one, skl, m, n, a, lda, ierr )
659 emptsw = ( n*( n-1 ) ) / 2
687 IF( ( nbl*kbl ).NE.n )nbl = nbl + 1
692 rowskip = min( 5, kbl )
703 IF( ( lower .OR. upper ) .AND. ( n.GT.max( 64, 4*kbl ) ) )
THEN
725 CALL sgsvj0( jobv, m-n34, n-n34, a( n34+1, n34+1 ), lda,
726 $ work( n34+1 ), sva( n34+1 ), mvl,
727 $ v( n34*q+1, n34+1 ), ldv, epsln, sfmin, tol,
728 $ 2, work( n+1 ), lwork-n, ierr )
730 CALL sgsvj0( jobv, m-n2, n34-n2, a( n2+1, n2+1 ), lda,
731 $ work( n2+1 ), sva( n2+1 ), mvl,
732 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 2,
733 $ work( n+1 ), lwork-n, ierr )
735 CALL sgsvj1( jobv, m-n2, n-n2, n4, a( n2+1, n2+1 ), lda,
736 $ work( n2+1 ), sva( n2+1 ), mvl,
737 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
738 $ work( n+1 ), lwork-n, ierr )
740 CALL sgsvj0( jobv, m-n4, n2-n4, a( n4+1, n4+1 ), lda,
741 $ work( n4+1 ), sva( n4+1 ), mvl,
742 $ v( n4*q+1, n4+1 ), ldv, epsln, sfmin, tol, 1,
743 $ work( n+1 ), lwork-n, ierr )
745 CALL sgsvj0( jobv, m, n4, a, lda, work, sva, mvl, v, ldv,
746 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
749 CALL sgsvj1( jobv, m, n2, n4, a, lda, work, sva, mvl, v,
750 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
754 ELSE IF( upper )
THEN
757 CALL sgsvj0( jobv, n4, n4, a, lda, work, sva, mvl, v, ldv,
758 $ epsln, sfmin, tol, 2, work( n+1 ), lwork-n,
761 CALL sgsvj0( jobv, n2, n4, a( 1, n4+1 ), lda, work( n4+1 ),
762 $ sva( n4+1 ), mvl, v( n4*q+1, n4+1 ), ldv,
763 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
766 CALL sgsvj1( jobv, n2, n2, n4, a, lda, work, sva, mvl, v,
767 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
770 CALL sgsvj0( jobv, n2+n4, n4, a( 1, n2+1 ), lda,
771 $ work( n2+1 ), sva( n2+1 ), mvl,
772 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
773 $ work( n+1 ), lwork-n, ierr )
781 DO 1993 i = 1, nsweep
799 igl = ( ibr-1 )*kbl + 1
801 DO 1002 ir1 = 0, min( lkahead, nbl-ibr )
805 DO 2001 p = igl, min( igl+kbl-1, n-1 )
809 q =
isamax( n-p+1, sva( p ), 1 ) + p - 1
811 CALL sswap( m, a( 1, p ), 1, a( 1, q ), 1 )
812 IF( rsvec )
CALL sswap( mvl, v( 1, p ), 1,
818 work( p ) = work( q )
836 IF( ( sva( p ).LT.rootbig ) .AND.
837 $ ( sva( p ).GT.rootsfmin ) )
THEN
838 sva( p ) =
snrm2( m, a( 1, p ), 1 )*work( p )
842 CALL slassq( m, a( 1, p ), 1, temp1, aapp )
843 sva( p ) = temp1*sqrt( aapp )*work( p )
850 IF( aapp.GT.zero )
THEN
854 DO 2002 q = p + 1, min( igl+kbl-1, n )
858 IF( aaqq.GT.zero )
THEN
861 IF( aaqq.GE.one )
THEN
862 rotok = ( small*aapp ).LE.aaqq
863 IF( aapp.LT.( big / aaqq ) )
THEN
864 aapq = (
sdot( m, a( 1, p ), 1, a( 1,
865 $ q ), 1 )*work( p )*work( q ) /
868 CALL scopy( m, a( 1, p ), 1,
870 CALL slascl(
'G', 0, 0, aapp,
872 $ work( n+1 ), lda, ierr )
873 aapq =
sdot( m, work( n+1 ), 1,
874 $ a( 1, q ), 1 )*work( q ) / aaqq
877 rotok = aapp.LE.( aaqq / small )
878 IF( aapp.GT.( small / aaqq ) )
THEN
879 aapq = (
sdot( m, a( 1, p ), 1, a( 1,
880 $ q ), 1 )*work( p )*work( q ) /
883 CALL scopy( m, a( 1, q ), 1,
885 CALL slascl(
'G', 0, 0, aaqq,
887 $ work( n+1 ), lda, ierr )
888 aapq =
sdot( m, work( n+1 ), 1,
889 $ a( 1, p ), 1 )*work( p ) / aapp
893 mxaapq = max( mxaapq, abs( aapq ) )
897 IF( abs( aapq ).GT.tol )
THEN
912 theta = -half*abs( aqoap-apoaq ) / aapq
914 IF( abs( theta ).GT.bigtheta )
THEN
917 fastr( 3 ) = t*work( p ) / work( q )
918 fastr( 4 ) = -t*work( q ) /
920 CALL srotm( m, a( 1, p ), 1,
921 $ a( 1, q ), 1, fastr )
922 IF( rsvec )
CALL srotm( mvl,
926 sva( q ) = aaqq*sqrt( max( zero,
927 $ one+t*apoaq*aapq ) )
928 aapp = aapp*sqrt( max( zero,
929 $ one-t*aqoap*aapq ) )
930 mxsinj = max( mxsinj, abs( t ) )
936 thsign = -sign( one, aapq )
937 t = one / ( theta+thsign*
938 $ sqrt( one+theta*theta ) )
939 cs = sqrt( one / ( one+t*t ) )
942 mxsinj = max( mxsinj, abs( sn ) )
943 sva( q ) = aaqq*sqrt( max( zero,
944 $ one+t*apoaq*aapq ) )
945 aapp = aapp*sqrt( max( zero,
946 $ one-t*aqoap*aapq ) )
948 apoaq = work( p ) / work( q )
949 aqoap = work( q ) / work( p )
950 IF( work( p ).GE.one )
THEN
951 IF( work( q ).GE.one )
THEN
953 fastr( 4 ) = -t*aqoap
954 work( p ) = work( p )*cs
955 work( q ) = work( q )*cs
956 CALL srotm( m, a( 1, p ), 1,
959 IF( rsvec )
CALL srotm( mvl,
960 $ v( 1, p ), 1, v( 1, q ),
963 CALL saxpy( m, -t*aqoap,
966 CALL saxpy( m, cs*sn*apoaq,
969 work( p ) = work( p )*cs
970 work( q ) = work( q ) / cs
972 CALL saxpy( mvl, -t*aqoap,
982 IF( work( q ).GE.one )
THEN
983 CALL saxpy( m, t*apoaq,
986 CALL saxpy( m, -cs*sn*aqoap,
989 work( p ) = work( p ) / cs
990 work( q ) = work( q )*cs
992 CALL saxpy( mvl, t*apoaq,
1001 IF( work( p ).GE.work( q ) )
1003 CALL saxpy( m, -t*aqoap,
1006 CALL saxpy( m, cs*sn*apoaq,
1009 work( p ) = work( p )*cs
1010 work( q ) = work( q ) / cs
1022 CALL saxpy( m, t*apoaq,
1029 work( p ) = work( p ) / cs
1030 work( q ) = work( q )*cs
1033 $ t*apoaq, v( 1, p ),
1047 CALL scopy( m, a( 1, p ), 1,
1049 CALL slascl(
'G', 0, 0, aapp, one, m,
1050 $ 1, work( n+1 ), lda,
1052 CALL slascl(
'G', 0, 0, aaqq, one, m,
1053 $ 1, a( 1, q ), lda, ierr )
1054 temp1 = -aapq*work( p ) / work( q )
1055 CALL saxpy( m, temp1, work( n+1 ), 1,
1057 CALL slascl(
'G', 0, 0, one, aaqq, m,
1058 $ 1, a( 1, q ), lda, ierr )
1059 sva( q ) = aaqq*sqrt( max( zero,
1061 mxsinj = max( mxsinj, sfmin )
1068 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1070 IF( ( aaqq.LT.rootbig ) .AND.
1071 $ ( aaqq.GT.rootsfmin ) )
THEN
1072 sva( q ) =
snrm2( m, a( 1, q ), 1 )*
1077 CALL slassq( m, a( 1, q ), 1, t,
1079 sva( q ) = t*sqrt( aaqq )*work( q )
1082 IF( ( aapp / aapp0 ).LE.rooteps )
THEN
1083 IF( ( aapp.LT.rootbig ) .AND.
1084 $ ( aapp.GT.rootsfmin ) )
THEN
1085 aapp =
snrm2( m, a( 1, p ), 1 )*
1090 CALL slassq( m, a( 1, p ), 1, t,
1092 aapp = t*sqrt( aapp )*work( p )
1099 IF( ir1.EQ.0 )notrot = notrot + 1
1101 pskipped = pskipped + 1
1105 IF( ir1.EQ.0 )notrot = notrot + 1
1106 pskipped = pskipped + 1
1109 IF( ( i.LE.swband ) .AND.
1110 $ ( pskipped.GT.rowskip ) )
THEN
1111 IF( ir1.EQ.0 )aapp = -aapp
1126 IF( ( ir1.EQ.0 ) .AND. ( aapp.EQ.zero ) )
1127 $ notrot = notrot + min( igl+kbl-1, n ) - p
1138 igl = ( ibr-1 )*kbl + 1
1140 DO 2010 jbc = ibr + 1, nbl
1142 jgl = ( jbc-1 )*kbl + 1
1147 DO 2100 p = igl, min( igl+kbl-1, n )
1150 IF( aapp.GT.zero )
THEN
1154 DO 2200 q = jgl, min( jgl+kbl-1, n )
1157 IF( aaqq.GT.zero )
THEN
1164 IF( aaqq.GE.one )
THEN
1165 IF( aapp.GE.aaqq )
THEN
1166 rotok = ( small*aapp ).LE.aaqq
1168 rotok = ( small*aaqq ).LE.aapp
1170 IF( aapp.LT.( big / aaqq ) )
THEN
1171 aapq = (
sdot( m, a( 1, p ), 1, a( 1,
1172 $ q ), 1 )*work( p )*work( q ) /
1175 CALL scopy( m, a( 1, p ), 1,
1177 CALL slascl(
'G', 0, 0, aapp,
1179 $ work( n+1 ), lda, ierr )
1180 aapq =
sdot( m, work( n+1 ), 1,
1181 $ a( 1, q ), 1 )*work( q ) / aaqq
1184 IF( aapp.GE.aaqq )
THEN
1185 rotok = aapp.LE.( aaqq / small )
1187 rotok = aaqq.LE.( aapp / small )
1189 IF( aapp.GT.( small / aaqq ) )
THEN
1190 aapq = (
sdot( m, a( 1, p ), 1, a( 1,
1191 $ q ), 1 )*work( p )*work( q ) /
1194 CALL scopy( m, a( 1, q ), 1,
1196 CALL slascl(
'G', 0, 0, aaqq,
1198 $ work( n+1 ), lda, ierr )
1199 aapq =
sdot( m, work( n+1 ), 1,
1200 $ a( 1, p ), 1 )*work( p ) / aapp
1204 mxaapq = max( mxaapq, abs( aapq ) )
1208 IF( abs( aapq ).GT.tol )
THEN
1218 theta = -half*abs( aqoap-apoaq ) / aapq
1219 IF( aaqq.GT.aapp0 )theta = -theta
1221 IF( abs( theta ).GT.bigtheta )
THEN
1223 fastr( 3 ) = t*work( p ) / work( q )
1224 fastr( 4 ) = -t*work( q ) /
1226 CALL srotm( m, a( 1, p ), 1,
1227 $ a( 1, q ), 1, fastr )
1228 IF( rsvec )
CALL srotm( mvl,
1232 sva( q ) = aaqq*sqrt( max( zero,
1233 $ one+t*apoaq*aapq ) )
1234 aapp = aapp*sqrt( max( zero,
1235 $ one-t*aqoap*aapq ) )
1236 mxsinj = max( mxsinj, abs( t ) )
1241 thsign = -sign( one, aapq )
1242 IF( aaqq.GT.aapp0 )thsign = -thsign
1243 t = one / ( theta+thsign*
1244 $ sqrt( one+theta*theta ) )
1245 cs = sqrt( one / ( one+t*t ) )
1247 mxsinj = max( mxsinj, abs( sn ) )
1248 sva( q ) = aaqq*sqrt( max( zero,
1249 $ one+t*apoaq*aapq ) )
1250 aapp = aapp*sqrt( max( zero,
1251 $ one-t*aqoap*aapq ) )
1253 apoaq = work( p ) / work( q )
1254 aqoap = work( q ) / work( p )
1255 IF( work( p ).GE.one )
THEN
1257 IF( work( q ).GE.one )
THEN
1258 fastr( 3 ) = t*apoaq
1259 fastr( 4 ) = -t*aqoap
1260 work( p ) = work( p )*cs
1261 work( q ) = work( q )*cs
1262 CALL srotm( m, a( 1, p ), 1,
1265 IF( rsvec )
CALL srotm( mvl,
1266 $ v( 1, p ), 1, v( 1, q ),
1269 CALL saxpy( m, -t*aqoap,
1272 CALL saxpy( m, cs*sn*apoaq,
1276 CALL saxpy( mvl, -t*aqoap,
1284 work( p ) = work( p )*cs
1285 work( q ) = work( q ) / cs
1288 IF( work( q ).GE.one )
THEN
1289 CALL saxpy( m, t*apoaq,
1292 CALL saxpy( m, -cs*sn*aqoap,
1296 CALL saxpy( mvl, t*apoaq,
1304 work( p ) = work( p ) / cs
1305 work( q ) = work( q )*cs
1307 IF( work( p ).GE.work( q ) )
1309 CALL saxpy( m, -t*aqoap,
1312 CALL saxpy( m, cs*sn*apoaq,
1315 work( p ) = work( p )*cs
1316 work( q ) = work( q ) / cs
1328 CALL saxpy( m, t*apoaq,
1335 work( p ) = work( p ) / cs
1336 work( q ) = work( q )*cs
1339 $ t*apoaq, v( 1, p ),
1352 IF( aapp.GT.aaqq )
THEN
1353 CALL scopy( m, a( 1, p ), 1,
1355 CALL slascl(
'G', 0, 0, aapp, one,
1356 $ m, 1, work( n+1 ), lda,
1358 CALL slascl(
'G', 0, 0, aaqq, one,
1359 $ m, 1, a( 1, q ), lda,
1361 temp1 = -aapq*work( p ) / work( q )
1362 CALL saxpy( m, temp1, work( n+1 ),
1364 CALL slascl(
'G', 0, 0, one, aaqq,
1365 $ m, 1, a( 1, q ), lda,
1367 sva( q ) = aaqq*sqrt( max( zero,
1369 mxsinj = max( mxsinj, sfmin )
1371 CALL scopy( m, a( 1, q ), 1,
1373 CALL slascl(
'G', 0, 0, aaqq, one,
1374 $ m, 1, work( n+1 ), lda,
1376 CALL slascl(
'G', 0, 0, aapp, one,
1377 $ m, 1, a( 1, p ), lda,
1379 temp1 = -aapq*work( q ) / work( p )
1380 CALL saxpy( m, temp1, work( n+1 ),
1382 CALL slascl(
'G', 0, 0, one, aapp,
1383 $ m, 1, a( 1, p ), lda,
1385 sva( p ) = aapp*sqrt( max( zero,
1387 mxsinj = max( mxsinj, sfmin )
1394 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1396 IF( ( aaqq.LT.rootbig ) .AND.
1397 $ ( aaqq.GT.rootsfmin ) )
THEN
1398 sva( q ) =
snrm2( m, a( 1, q ), 1 )*
1403 CALL slassq( m, a( 1, q ), 1, t,
1405 sva( q ) = t*sqrt( aaqq )*work( q )
1408 IF( ( aapp / aapp0 )**2.LE.rooteps )
THEN
1409 IF( ( aapp.LT.rootbig ) .AND.
1410 $ ( aapp.GT.rootsfmin ) )
THEN
1411 aapp =
snrm2( m, a( 1, p ), 1 )*
1416 CALL slassq( m, a( 1, p ), 1, t,
1418 aapp = t*sqrt( aapp )*work( p )
1426 pskipped = pskipped + 1
1431 pskipped = pskipped + 1
1435 IF( ( i.LE.swband ) .AND. ( ijblsk.GE.blskip ) )
1441 IF( ( i.LE.swband ) .AND.
1442 $ ( pskipped.GT.rowskip ) )
THEN
1456 IF( aapp.EQ.zero )notrot = notrot +
1457 $ min( jgl+kbl-1, n ) - jgl + 1
1458 IF( aapp.LT.zero )notrot = 0
1468 DO 2012 p = igl, min( igl+kbl-1, n )
1469 sva( p ) = abs( sva( p ) )
1476 IF( ( sva( n ).LT.rootbig ) .AND. ( sva( n ).GT.rootsfmin ) )
1478 sva( n ) =
snrm2( m, a( 1, n ), 1 )*work( n )
1482 CALL slassq( m, a( 1, n ), 1, t, aapp )
1483 sva( n ) = t*sqrt( aapp )*work( n )
1488 IF( ( i.LT.swband ) .AND. ( ( mxaapq.LE.roottol ) .OR.
1489 $ ( iswrot.LE.n ) ) )swband = i
1491 IF( ( i.GT.swband+1 ) .AND. ( mxaapq.LT.sqrt( float( n ) )*
1492 $ tol ) .AND. ( float( n )*mxaapq*mxsinj.LT.tol ) )
THEN
1496 IF( notrot.GE.emptsw )
GO TO 1994
1518 DO 5991 p = 1, n - 1
1519 q =
isamax( n-p+1, sva( p ), 1 ) + p - 1
1525 work( p ) = work( q )
1527 CALL sswap( m, a( 1, p ), 1, a( 1, q ), 1 )
1528 IF( rsvec )
CALL sswap( mvl, v( 1, p ), 1, v( 1, q ), 1 )
1530 IF( sva( p ).NE.zero )
THEN
1532 IF( sva( p )*skl.GT.sfmin )n2 = n2 + 1
1535 IF( sva( n ).NE.zero )
THEN
1537 IF( sva( n )*skl.GT.sfmin )n2 = n2 + 1
1542 IF( lsvec .OR. uctol )
THEN
1544 CALL sscal( m, work( p ) / sva( p ), a( 1, p ), 1 )
1553 CALL sscal( mvl, work( p ), v( 1, p ), 1 )
1557 temp1 = one /
snrm2( mvl, v( 1, p ), 1 )
1558 CALL sscal( mvl, temp1, v( 1, p ), 1 )
1564 IF( ( ( skl.GT.one ) .AND. ( sva( 1 ).LT.( big / skl ) ) )
1565 $ .OR. ( ( skl.LT.one ) .AND. ( sva( max( n2, 1 ) ) .GT.
1566 $ ( sfmin / skl ) ) ) )
THEN
1568 sva( p ) = skl*sva( p )
1578 work( 2 ) = float( n4 )
1581 work( 3 ) = float( n2 )
1586 work( 4 ) = float( i )
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
real function sdot(N, SX, INCX, SY, INCY)
SDOT
integer function isamax(N, SX, INCX)
ISAMAX
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 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 xerbla(SRNAME, INFO)
XERBLA
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...
real function snrm2(N, X, INCX)
SNRM2
subroutine saxpy(N, SA, SX, INCX, SY, INCY)
SAXPY
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 sscal(N, SA, SX, INCX)
SSCAL
subroutine sswap(N, SX, INCX, SY, INCY)
SSWAP
real function slamch(CMACH)
SLAMCH
logical function lsame(CA, CB)
LSAME
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY