337 SUBROUTINE dgesvj( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V,
338 $ ldv, work, lwork, info )
346 INTEGER INFO, LDA, LDV, LWORK, M, MV, N
347 CHARACTER*1 JOBA, JOBU, JOBV
350 DOUBLE PRECISION A( lda, * ), SVA( n ), V( ldv, * ),
357 DOUBLE PRECISION ZERO, HALF, ONE
358 parameter ( zero = 0.0d0, half = 0.5d0, one = 1.0d0)
360 parameter ( nsweep = 30 )
363 DOUBLE PRECISION AAPP, AAPP0, AAPQ, AAQQ, APOAQ, AQOAP, BIG,
364 $ bigtheta, cs, ctol, epsln, large, mxaapq,
365 $ mxsinj, rootbig, rooteps, rootsfmin, roottol,
366 $ skl, sfmin, small, sn, t, temp1, theta,
368 INTEGER BLSKIP, EMPTSW, i, ibr, IERR, igl, IJBLSK, ir1,
369 $ iswrot, jbc, jgl, kbl, lkahead, mvl, n2, n34,
370 $ n4, nbl, notrot, p, pskipped, q, rowskip,
372 LOGICAL APPLV, GOSCALE, LOWER, LSVEC, NOSCALE, ROTOK,
373 $ rsvec, uctol, upper
376 DOUBLE PRECISION FASTR( 5 )
379 INTRINSIC dabs, max, min, dble, dsign, dsqrt
384 DOUBLE PRECISION DDOT, DNRM2
389 DOUBLE PRECISION DLAMCH
407 lsvec = lsame( jobu,
'U' )
408 uctol = lsame( jobu,
'C' )
409 rsvec = lsame( jobv,
'V' )
410 applv = lsame( jobv,
'A' )
411 upper = lsame( joba,
'U' )
412 lower = lsame( joba,
'L' )
414 IF( .NOT.( upper .OR. lower .OR. lsame( joba,
'G' ) ) )
THEN
416 ELSE IF( .NOT.( lsvec .OR. uctol .OR. lsame( jobu,
'N' ) ) )
THEN
418 ELSE IF( .NOT.( rsvec .OR. applv .OR. lsame( jobv,
'N' ) ) )
THEN
420 ELSE IF( m.LT.0 )
THEN
422 ELSE IF( ( n.LT.0 ) .OR. ( n.GT.m ) )
THEN
424 ELSE IF( lda.LT.m )
THEN
426 ELSE IF( mv.LT.0 )
THEN
428 ELSE IF( ( rsvec .AND. ( ldv.LT.n ) ) .OR.
429 $ ( applv .AND. ( ldv.LT.mv ) ) )
THEN
431 ELSE IF( uctol .AND. ( work( 1 ).LE.one ) )
THEN
433 ELSE IF( lwork.LT.max( m+n, 6 ) )
THEN
441 CALL xerbla(
'DGESVJ', -info )
447 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
RETURN
461 IF( lsvec .OR. rsvec .OR. applv )
THEN
462 ctol = dsqrt( dble( m ) )
470 epsln = dlamch(
'Epsilon' )
471 rooteps = dsqrt( epsln )
472 sfmin = dlamch(
'SafeMinimum' )
473 rootsfmin = dsqrt( sfmin )
474 small = sfmin / epsln
475 big = dlamch(
'Overflow' )
477 rootbig = one / rootsfmin
478 large = big / dsqrt( dble( m*n ) )
479 bigtheta = one / rooteps
482 roottol = dsqrt( tol )
484 IF( dble( m )*epsln.GE.one )
THEN
486 CALL xerbla(
'DGESVJ', -info )
494 CALL dlaset(
'A', mvl, n, zero, one, v, ldv )
495 ELSE IF( applv )
THEN
498 rsvec = rsvec .OR. applv
509 skl= one / dsqrt( dble( m )*dble( n ) )
518 CALL dlassq( m-p+1, a( p, p ), 1, aapp, aaqq )
519 IF( aapp.GT.big )
THEN
521 CALL xerbla(
'DGESVJ', -info )
525 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
529 sva( p ) = aapp*( aaqq*skl)
533 sva( q ) = sva( q )*skl
538 ELSE IF( upper )
THEN
543 CALL dlassq( p, a( 1, p ), 1, aapp, aaqq )
544 IF( aapp.GT.big )
THEN
546 CALL xerbla(
'DGESVJ', -info )
550 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
554 sva( p ) = aapp*( aaqq*skl)
558 sva( q ) = sva( q )*skl
568 CALL dlassq( m, a( 1, p ), 1, aapp, aaqq )
569 IF( aapp.GT.big )
THEN
571 CALL xerbla(
'DGESVJ', -info )
575 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
579 sva( p ) = aapp*( aaqq*skl)
583 sva( q ) = sva( q )*skl
590 IF( noscale )skl= one
599 IF( sva( p ).NE.zero )aaqq = min( aaqq, sva( p ) )
600 aapp = max( aapp, sva( p ) )
605 IF( aapp.EQ.zero )
THEN
606 IF( lsvec )
CALL dlaset(
'G', m, n, zero, one, a, lda )
619 IF( lsvec )
CALL dlascl(
'G', 0, 0, sva( 1 ), skl, m, 1,
620 $ a( 1, 1 ), lda, ierr )
621 work( 1 ) = one / skl
622 IF( sva( 1 ).GE.sfmin )
THEN
637 sn = dsqrt( sfmin / epsln )
638 temp1 = dsqrt( big / dble( n ) )
639 IF( ( aapp.LE.sn ) .OR. ( aaqq.GE.temp1 ) .OR.
640 $ ( ( sn.LE.aaqq ) .AND. ( aapp.LE.temp1 ) ) )
THEN
641 temp1 = min( big, temp1 / aapp )
644 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.LE.temp1 ) )
THEN
645 temp1 = min( sn / aaqq, big / ( aapp*dsqrt( dble( n ) ) ) )
648 ELSE IF( ( aaqq.GE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
649 temp1 = max( sn / aaqq, temp1 / aapp )
652 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
653 temp1 = min( sn / aaqq, big / ( dsqrt( dble( n ) )*aapp ) )
662 IF( temp1.NE.one )
THEN
663 CALL dlascl(
'G', 0, 0, one, temp1, n, 1, sva, n, ierr )
666 IF( skl.NE.one )
THEN
667 CALL dlascl( joba, 0, 0, one, skl, m, n, a, lda, ierr )
673 emptsw = ( n*( n-1 ) ) / 2
701 IF( ( nbl*kbl ).NE.n )nbl = nbl + 1
706 rowskip = min( 5, kbl )
717 IF( ( lower .OR. upper ) .AND. ( n.GT.max( 64, 4*kbl ) ) )
THEN
739 CALL dgsvj0( jobv, m-n34, n-n34, a( n34+1, n34+1 ), lda,
740 $ work( n34+1 ), sva( n34+1 ), mvl,
741 $ v( n34*q+1, n34+1 ), ldv, epsln, sfmin, tol,
742 $ 2, work( n+1 ), lwork-n, ierr )
744 CALL dgsvj0( jobv, m-n2, n34-n2, a( n2+1, n2+1 ), lda,
745 $ work( n2+1 ), sva( n2+1 ), mvl,
746 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 2,
747 $ work( n+1 ), lwork-n, ierr )
749 CALL dgsvj1( jobv, m-n2, n-n2, n4, a( n2+1, n2+1 ), lda,
750 $ work( n2+1 ), sva( n2+1 ), mvl,
751 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
752 $ work( n+1 ), lwork-n, ierr )
754 CALL dgsvj0( jobv, m-n4, n2-n4, a( n4+1, n4+1 ), lda,
755 $ work( n4+1 ), sva( n4+1 ), mvl,
756 $ v( n4*q+1, n4+1 ), ldv, epsln, sfmin, tol, 1,
757 $ work( n+1 ), lwork-n, ierr )
759 CALL dgsvj0( jobv, m, n4, a, lda, work, sva, mvl, v, ldv,
760 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
763 CALL dgsvj1( jobv, m, n2, n4, a, lda, work, sva, mvl, v,
764 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
768 ELSE IF( upper )
THEN
771 CALL dgsvj0( jobv, n4, n4, a, lda, work, sva, mvl, v, ldv,
772 $ epsln, sfmin, tol, 2, work( n+1 ), lwork-n,
775 CALL dgsvj0( jobv, n2, n4, a( 1, n4+1 ), lda, work( n4+1 ),
776 $ sva( n4+1 ), mvl, v( n4*q+1, n4+1 ), ldv,
777 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
780 CALL dgsvj1( jobv, n2, n2, n4, a, lda, work, sva, mvl, v,
781 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
784 CALL dgsvj0( jobv, n2+n4, n4, a( 1, n2+1 ), lda,
785 $ work( n2+1 ), sva( n2+1 ), mvl,
786 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
787 $ work( n+1 ), lwork-n, ierr )
795 DO 1993 i = 1, nsweep
813 igl = ( ibr-1 )*kbl + 1
815 DO 1002 ir1 = 0, min( lkahead, nbl-ibr )
819 DO 2001 p = igl, min( igl+kbl-1, n-1 )
823 q = idamax( n-p+1, sva( p ), 1 ) + p - 1
825 CALL dswap( m, a( 1, p ), 1, a( 1, q ), 1 )
826 IF( rsvec )
CALL dswap( mvl, v( 1, p ), 1,
832 work( p ) = work( q )
850 IF( ( sva( p ).LT.rootbig ) .AND.
851 $ ( sva( p ).GT.rootsfmin ) )
THEN
852 sva( p ) = dnrm2( m, a( 1, p ), 1 )*work( p )
856 CALL dlassq( m, a( 1, p ), 1, temp1, aapp )
857 sva( p ) = temp1*dsqrt( aapp )*work( p )
864 IF( aapp.GT.zero )
THEN
868 DO 2002 q = p + 1, min( igl+kbl-1, n )
872 IF( aaqq.GT.zero )
THEN
875 IF( aaqq.GE.one )
THEN
876 rotok = ( small*aapp ).LE.aaqq
877 IF( aapp.LT.( big / aaqq ) )
THEN
878 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
879 $ q ), 1 )*work( p )*work( q ) /
882 CALL dcopy( m, a( 1, p ), 1,
884 CALL dlascl(
'G', 0, 0, aapp,
886 $ work( n+1 ), lda, ierr )
887 aapq = ddot( m, work( n+1 ), 1,
888 $ a( 1, q ), 1 )*work( q ) / aaqq
891 rotok = aapp.LE.( aaqq / small )
892 IF( aapp.GT.( small / aaqq ) )
THEN
893 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
894 $ q ), 1 )*work( p )*work( q ) /
897 CALL dcopy( m, a( 1, q ), 1,
899 CALL dlascl(
'G', 0, 0, aaqq,
901 $ work( n+1 ), lda, ierr )
902 aapq = ddot( m, work( n+1 ), 1,
903 $ a( 1, p ), 1 )*work( p ) / aapp
907 mxaapq = max( mxaapq, dabs( aapq ) )
911 IF( dabs( aapq ).GT.tol )
THEN
926 theta = -half*dabs(aqoap-apoaq)/aapq
928 IF( dabs( theta ).GT.bigtheta )
THEN
931 fastr( 3 ) = t*work( p ) / work( q )
932 fastr( 4 ) = -t*work( q ) /
934 CALL drotm( m, a( 1, p ), 1,
935 $ a( 1, q ), 1, fastr )
936 IF( rsvec )
CALL drotm( mvl,
940 sva( q ) = aaqq*dsqrt( max( zero,
941 $ one+t*apoaq*aapq ) )
942 aapp = aapp*dsqrt( max( zero,
943 $ one-t*aqoap*aapq ) )
944 mxsinj = max( mxsinj, dabs( t ) )
950 thsign = -dsign( one, aapq )
951 t = one / ( theta+thsign*
952 $ dsqrt( one+theta*theta ) )
953 cs = dsqrt( one / ( one+t*t ) )
956 mxsinj = max( mxsinj, dabs( sn ) )
957 sva( q ) = aaqq*dsqrt( max( zero,
958 $ one+t*apoaq*aapq ) )
959 aapp = aapp*dsqrt( max( zero,
960 $ one-t*aqoap*aapq ) )
962 apoaq = work( p ) / work( q )
963 aqoap = work( q ) / work( p )
964 IF( work( p ).GE.one )
THEN
965 IF( work( q ).GE.one )
THEN
967 fastr( 4 ) = -t*aqoap
968 work( p ) = work( p )*cs
969 work( q ) = work( q )*cs
970 CALL drotm( m, a( 1, p ), 1,
973 IF( rsvec )
CALL drotm( mvl,
974 $ v( 1, p ), 1, v( 1, q ),
977 CALL daxpy( m, -t*aqoap,
980 CALL daxpy( m, cs*sn*apoaq,
983 work( p ) = work( p )*cs
984 work( q ) = work( q ) / cs
986 CALL daxpy( mvl, -t*aqoap,
996 IF( work( q ).GE.one )
THEN
997 CALL daxpy( m, t*apoaq,
1000 CALL daxpy( m, -cs*sn*aqoap,
1003 work( p ) = work( p ) / cs
1004 work( q ) = work( q )*cs
1006 CALL daxpy( mvl, t*apoaq,
1015 IF( work( p ).GE.work( q ) )
1017 CALL daxpy( m, -t*aqoap,
1020 CALL daxpy( m, cs*sn*apoaq,
1023 work( p ) = work( p )*cs
1024 work( q ) = work( q ) / cs
1036 CALL daxpy( m, t*apoaq,
1043 work( p ) = work( p ) / cs
1044 work( q ) = work( q )*cs
1047 $ t*apoaq, v( 1, p ),
1061 CALL dcopy( m, a( 1, p ), 1,
1063 CALL dlascl(
'G', 0, 0, aapp, one, m,
1064 $ 1, work( n+1 ), lda,
1066 CALL dlascl(
'G', 0, 0, aaqq, one, m,
1067 $ 1, a( 1, q ), lda, ierr )
1068 temp1 = -aapq*work( p ) / work( q )
1069 CALL daxpy( m, temp1, work( n+1 ), 1,
1071 CALL dlascl(
'G', 0, 0, one, aaqq, m,
1072 $ 1, a( 1, q ), lda, ierr )
1073 sva( q ) = aaqq*dsqrt( max( zero,
1075 mxsinj = max( mxsinj, sfmin )
1082 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1084 IF( ( aaqq.LT.rootbig ) .AND.
1085 $ ( aaqq.GT.rootsfmin ) )
THEN
1086 sva( q ) = dnrm2( m, a( 1, q ), 1 )*
1091 CALL dlassq( m, a( 1, q ), 1, t,
1093 sva( q ) = t*dsqrt( aaqq )*work( q )
1096 IF( ( aapp / aapp0 ).LE.rooteps )
THEN
1097 IF( ( aapp.LT.rootbig ) .AND.
1098 $ ( aapp.GT.rootsfmin ) )
THEN
1099 aapp = dnrm2( m, a( 1, p ), 1 )*
1104 CALL dlassq( m, a( 1, p ), 1, t,
1106 aapp = t*dsqrt( aapp )*work( p )
1113 IF( ir1.EQ.0 )notrot = notrot + 1
1115 pskipped = pskipped + 1
1119 IF( ir1.EQ.0 )notrot = notrot + 1
1120 pskipped = pskipped + 1
1123 IF( ( i.LE.swband ) .AND.
1124 $ ( pskipped.GT.rowskip ) )
THEN
1125 IF( ir1.EQ.0 )aapp = -aapp
1140 IF( ( ir1.EQ.0 ) .AND. ( aapp.EQ.zero ) )
1141 $ notrot = notrot + min( igl+kbl-1, n ) - p
1152 igl = ( ibr-1 )*kbl + 1
1154 DO 2010 jbc = ibr + 1, nbl
1156 jgl = ( jbc-1 )*kbl + 1
1161 DO 2100 p = igl, min( igl+kbl-1, n )
1164 IF( aapp.GT.zero )
THEN
1168 DO 2200 q = jgl, min( jgl+kbl-1, n )
1171 IF( aaqq.GT.zero )
THEN
1178 IF( aaqq.GE.one )
THEN
1179 IF( aapp.GE.aaqq )
THEN
1180 rotok = ( small*aapp ).LE.aaqq
1182 rotok = ( small*aaqq ).LE.aapp
1184 IF( aapp.LT.( big / aaqq ) )
THEN
1185 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
1186 $ q ), 1 )*work( p )*work( q ) /
1189 CALL dcopy( m, a( 1, p ), 1,
1191 CALL dlascl(
'G', 0, 0, aapp,
1193 $ work( n+1 ), lda, ierr )
1194 aapq = ddot( m, work( n+1 ), 1,
1195 $ a( 1, q ), 1 )*work( q ) / aaqq
1198 IF( aapp.GE.aaqq )
THEN
1199 rotok = aapp.LE.( aaqq / small )
1201 rotok = aaqq.LE.( aapp / small )
1203 IF( aapp.GT.( small / aaqq ) )
THEN
1204 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
1205 $ q ), 1 )*work( p )*work( q ) /
1208 CALL dcopy( m, a( 1, q ), 1,
1210 CALL dlascl(
'G', 0, 0, aaqq,
1212 $ work( n+1 ), lda, ierr )
1213 aapq = ddot( m, work( n+1 ), 1,
1214 $ a( 1, p ), 1 )*work( p ) / aapp
1218 mxaapq = max( mxaapq, dabs( aapq ) )
1222 IF( dabs( aapq ).GT.tol )
THEN
1232 theta = -half*dabs(aqoap-apoaq)/aapq
1233 IF( aaqq.GT.aapp0 )theta = -theta
1235 IF( dabs( theta ).GT.bigtheta )
THEN
1237 fastr( 3 ) = t*work( p ) / work( q )
1238 fastr( 4 ) = -t*work( q ) /
1240 CALL drotm( m, a( 1, p ), 1,
1241 $ a( 1, q ), 1, fastr )
1242 IF( rsvec )
CALL drotm( mvl,
1246 sva( q ) = aaqq*dsqrt( max( zero,
1247 $ one+t*apoaq*aapq ) )
1248 aapp = aapp*dsqrt( max( zero,
1249 $ one-t*aqoap*aapq ) )
1250 mxsinj = max( mxsinj, dabs( t ) )
1255 thsign = -dsign( one, aapq )
1256 IF( aaqq.GT.aapp0 )thsign = -thsign
1257 t = one / ( theta+thsign*
1258 $ dsqrt( one+theta*theta ) )
1259 cs = dsqrt( one / ( one+t*t ) )
1261 mxsinj = max( mxsinj, dabs( sn ) )
1262 sva( q ) = aaqq*dsqrt( max( zero,
1263 $ one+t*apoaq*aapq ) )
1264 aapp = aapp*dsqrt( max( zero,
1265 $ one-t*aqoap*aapq ) )
1267 apoaq = work( p ) / work( q )
1268 aqoap = work( q ) / work( p )
1269 IF( work( p ).GE.one )
THEN
1271 IF( work( q ).GE.one )
THEN
1272 fastr( 3 ) = t*apoaq
1273 fastr( 4 ) = -t*aqoap
1274 work( p ) = work( p )*cs
1275 work( q ) = work( q )*cs
1276 CALL drotm( m, a( 1, p ), 1,
1279 IF( rsvec )
CALL drotm( mvl,
1280 $ v( 1, p ), 1, v( 1, q ),
1283 CALL daxpy( m, -t*aqoap,
1286 CALL daxpy( m, cs*sn*apoaq,
1290 CALL daxpy( mvl, -t*aqoap,
1298 work( p ) = work( p )*cs
1299 work( q ) = work( q ) / cs
1302 IF( work( q ).GE.one )
THEN
1303 CALL daxpy( m, t*apoaq,
1306 CALL daxpy( m, -cs*sn*aqoap,
1310 CALL daxpy( mvl, t*apoaq,
1318 work( p ) = work( p ) / cs
1319 work( q ) = work( q )*cs
1321 IF( work( p ).GE.work( q ) )
1323 CALL daxpy( m, -t*aqoap,
1326 CALL daxpy( m, cs*sn*apoaq,
1329 work( p ) = work( p )*cs
1330 work( q ) = work( q ) / cs
1342 CALL daxpy( m, t*apoaq,
1349 work( p ) = work( p ) / cs
1350 work( q ) = work( q )*cs
1353 $ t*apoaq, v( 1, p ),
1366 IF( aapp.GT.aaqq )
THEN
1367 CALL dcopy( m, a( 1, p ), 1,
1369 CALL dlascl(
'G', 0, 0, aapp, one,
1370 $ m, 1, work( n+1 ), lda,
1372 CALL dlascl(
'G', 0, 0, aaqq, one,
1373 $ m, 1, a( 1, q ), lda,
1375 temp1 = -aapq*work( p ) / work( q )
1376 CALL daxpy( m, temp1, work( n+1 ),
1378 CALL dlascl(
'G', 0, 0, one, aaqq,
1379 $ m, 1, a( 1, q ), lda,
1381 sva( q ) = aaqq*dsqrt( max( zero,
1383 mxsinj = max( mxsinj, sfmin )
1385 CALL dcopy( m, a( 1, q ), 1,
1387 CALL dlascl(
'G', 0, 0, aaqq, one,
1388 $ m, 1, work( n+1 ), lda,
1390 CALL dlascl(
'G', 0, 0, aapp, one,
1391 $ m, 1, a( 1, p ), lda,
1393 temp1 = -aapq*work( q ) / work( p )
1394 CALL daxpy( m, temp1, work( n+1 ),
1396 CALL dlascl(
'G', 0, 0, one, aapp,
1397 $ m, 1, a( 1, p ), lda,
1399 sva( p ) = aapp*dsqrt( max( zero,
1401 mxsinj = max( mxsinj, sfmin )
1408 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1410 IF( ( aaqq.LT.rootbig ) .AND.
1411 $ ( aaqq.GT.rootsfmin ) )
THEN
1412 sva( q ) = dnrm2( m, a( 1, q ), 1 )*
1417 CALL dlassq( m, a( 1, q ), 1, t,
1419 sva( q ) = t*dsqrt( aaqq )*work( q )
1422 IF( ( aapp / aapp0 )**2.LE.rooteps )
THEN
1423 IF( ( aapp.LT.rootbig ) .AND.
1424 $ ( aapp.GT.rootsfmin ) )
THEN
1425 aapp = dnrm2( m, a( 1, p ), 1 )*
1430 CALL dlassq( m, a( 1, p ), 1, t,
1432 aapp = t*dsqrt( aapp )*work( p )
1440 pskipped = pskipped + 1
1445 pskipped = pskipped + 1
1449 IF( ( i.LE.swband ) .AND. ( ijblsk.GE.blskip ) )
1455 IF( ( i.LE.swband ) .AND.
1456 $ ( pskipped.GT.rowskip ) )
THEN
1470 IF( aapp.EQ.zero )notrot = notrot +
1471 $ min( jgl+kbl-1, n ) - jgl + 1
1472 IF( aapp.LT.zero )notrot = 0
1482 DO 2012 p = igl, min( igl+kbl-1, n )
1483 sva( p ) = dabs( sva( p ) )
1490 IF( ( sva( n ).LT.rootbig ) .AND. ( sva( n ).GT.rootsfmin ) )
1492 sva( n ) = dnrm2( m, a( 1, n ), 1 )*work( n )
1496 CALL dlassq( m, a( 1, n ), 1, t, aapp )
1497 sva( n ) = t*dsqrt( aapp )*work( n )
1502 IF( ( i.LT.swband ) .AND. ( ( mxaapq.LE.roottol ) .OR.
1503 $ ( iswrot.LE.n ) ) )swband = i
1505 IF( ( i.GT.swband+1 ) .AND. ( mxaapq.LT.dsqrt( dble( n ) )*
1506 $ tol ) .AND. ( dble( n )*mxaapq*mxsinj.LT.tol ) )
THEN
1510 IF( notrot.GE.emptsw )
GO TO 1994
1532 DO 5991 p = 1, n - 1
1533 q = idamax( n-p+1, sva( p ), 1 ) + p - 1
1539 work( p ) = work( q )
1541 CALL dswap( m, a( 1, p ), 1, a( 1, q ), 1 )
1542 IF( rsvec )
CALL dswap( mvl, v( 1, p ), 1, v( 1, q ), 1 )
1544 IF( sva( p ).NE.zero )
THEN
1546 IF( sva( p )*skl.GT.sfmin )n2 = n2 + 1
1549 IF( sva( n ).NE.zero )
THEN
1551 IF( sva( n )*skl.GT.sfmin )n2 = n2 + 1
1556 IF( lsvec .OR. uctol )
THEN
1558 CALL dscal( m, work( p ) / sva( p ), a( 1, p ), 1 )
1567 CALL dscal( mvl, work( p ), v( 1, p ), 1 )
1571 temp1 = one / dnrm2( mvl, v( 1, p ), 1 )
1572 CALL dscal( mvl, temp1, v( 1, p ), 1 )
1578 IF( ( ( skl.GT.one ) .AND. ( sva( 1 ).LT.( big / skl) ) )
1579 $ .OR. ( ( skl.LT.one ) .AND. ( sva( max( n2, 1 ) ) .GT.
1580 $ ( sfmin / skl) ) ) )
THEN
1582 sva( p ) = skl*sva( p )
1592 work( 2 ) = dble( n4 )
1595 work( 3 ) = dble( n2 )
1600 work( 4 ) = dble( i )
subroutine dlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
subroutine dgsvj0(JOBV, M, N, A, LDA, D, SVA, MV, V, LDV, EPS, SFMIN, TOL, NSWEEP, WORK, LWORK, INFO)
DGSVJ0 pre-processor for the routine dgesvj.
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
subroutine dgesvj(JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, LDV, WORK, LWORK, INFO)
DGESVJ
subroutine dlascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
DAXPY
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dswap(N, DX, INCX, DY, INCY)
DSWAP
subroutine drotm(N, DX, INCX, DY, INCY, DPARAM)
DROTM
subroutine dscal(N, DA, DX, INCX)
DSCAL
subroutine dlassq(N, X, INCX, SCALE, SUMSQ)
DLASSQ updates a sum of squares represented in scaled form.
subroutine dgsvj1(JOBV, M, N, N1, A, LDA, D, SVA, MV, V, LDV, EPS, SFMIN, TOL, NSWEEP, WORK, LWORK, INFO)
DGSVJ1 pre-processor for the routine dgesvj, applies Jacobi rotations targeting only particular pivot...