335 SUBROUTINE dgesvj( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V,
336 $ LDV, WORK, LWORK, INFO )
343 INTEGER INFO, LDA, LDV, LWORK, M, MV, N
344 CHARACTER*1 JOBA, JOBU, JOBV
347 DOUBLE PRECISION A( LDA, * ), SVA( N ), V( LDV, * ),
354 DOUBLE PRECISION ZERO, HALF, ONE
355 parameter( zero = 0.0d0, half = 0.5d0, one = 1.0d0)
357 parameter( nsweep = 30 )
360 DOUBLE PRECISION AAPP, AAPP0, AAPQ, AAQQ, APOAQ, AQOAP, BIG,
361 $ bigtheta, cs, ctol, epsln, large, mxaapq,
362 $ mxsinj, rootbig, rooteps, rootsfmin, roottol,
363 $ skl, sfmin, small, sn, t, temp1, theta,
365 INTEGER BLSKIP, EMPTSW, i, ibr, IERR, igl, IJBLSK, ir1,
366 $ iswrot, jbc, jgl, kbl, lkahead, mvl, n2, n34,
367 $ n4, nbl, notrot, p, pskipped, q, rowskip,
369 LOGICAL APPLV, GOSCALE, LOWER, LSVEC, NOSCALE, ROTOK,
370 $ rsvec, uctol, upper
373 DOUBLE PRECISION FASTR( 5 )
376 INTRINSIC dabs, max, min, dble, dsign, dsqrt
381 DOUBLE PRECISION DDOT, DNRM2
386 DOUBLE PRECISION DLAMCH
404 lsvec = lsame( jobu,
'U' )
405 uctol = lsame( jobu,
'C' )
406 rsvec = lsame( jobv,
'V' )
407 applv = lsame( jobv,
'A' )
408 upper = lsame( joba,
'U' )
409 lower = lsame( joba,
'L' )
411 IF( .NOT.( upper .OR. lower .OR. lsame( joba,
'G' ) ) )
THEN
413 ELSE IF( .NOT.( lsvec .OR. uctol .OR. lsame( jobu,
'N' ) ) )
THEN
415 ELSE IF( .NOT.( rsvec .OR. applv .OR. lsame( jobv,
'N' ) ) )
THEN
417 ELSE IF( m.LT.0 )
THEN
419 ELSE IF( ( n.LT.0 ) .OR. ( n.GT.m ) )
THEN
421 ELSE IF( lda.LT.m )
THEN
423 ELSE IF( mv.LT.0 )
THEN
425 ELSE IF( ( rsvec .AND. ( ldv.LT.n ) ) .OR.
426 $ ( applv .AND. ( ldv.LT.mv ) ) )
THEN
428 ELSE IF( uctol .AND. ( work( 1 ).LE.one ) )
THEN
430 ELSE IF( lwork.LT.max( m+n, 6 ) )
THEN
438 CALL xerbla(
'DGESVJ', -info )
444 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
RETURN
458 IF( lsvec .OR. rsvec .OR. applv )
THEN
459 ctol = dsqrt( dble( m ) )
467 epsln = dlamch(
'Epsilon' )
468 rooteps = dsqrt( epsln )
469 sfmin = dlamch(
'SafeMinimum' )
470 rootsfmin = dsqrt( sfmin )
471 small = sfmin / epsln
472 big = dlamch(
'Overflow' )
474 rootbig = one / rootsfmin
475 large = big / dsqrt( dble( m*n ) )
476 bigtheta = one / rooteps
479 roottol = dsqrt( tol )
481 IF( dble( m )*epsln.GE.one )
THEN
483 CALL xerbla(
'DGESVJ', -info )
491 CALL dlaset(
'A', mvl, n, zero, one, v, ldv )
492 ELSE IF( applv )
THEN
495 rsvec = rsvec .OR. applv
506 skl= one / dsqrt( dble( m )*dble( n ) )
515 CALL dlassq( m-p+1, a( p, p ), 1, aapp, aaqq )
516 IF( aapp.GT.big )
THEN
518 CALL xerbla(
'DGESVJ', -info )
522 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
526 sva( p ) = aapp*( aaqq*skl)
530 sva( q ) = sva( q )*skl
535 ELSE IF( upper )
THEN
540 CALL dlassq( p, a( 1, p ), 1, aapp, aaqq )
541 IF( aapp.GT.big )
THEN
543 CALL xerbla(
'DGESVJ', -info )
547 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
551 sva( p ) = aapp*( aaqq*skl)
555 sva( q ) = sva( q )*skl
565 CALL dlassq( m, a( 1, p ), 1, aapp, aaqq )
566 IF( aapp.GT.big )
THEN
568 CALL xerbla(
'DGESVJ', -info )
572 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
576 sva( p ) = aapp*( aaqq*skl)
580 sva( q ) = sva( q )*skl
587 IF( noscale )skl= one
596 IF( sva( p ).NE.zero )aaqq = min( aaqq, sva( p ) )
597 aapp = max( aapp, sva( p ) )
602 IF( aapp.EQ.zero )
THEN
603 IF( lsvec )
CALL dlaset(
'G', m, n, zero, one, a, lda )
616 IF( lsvec )
CALL dlascl(
'G', 0, 0, sva( 1 ), skl, m, 1,
617 $ a( 1, 1 ), lda, ierr )
618 work( 1 ) = one / skl
619 IF( sva( 1 ).GE.sfmin )
THEN
634 sn = dsqrt( sfmin / epsln )
635 temp1 = dsqrt( big / dble( n ) )
636 IF( ( aapp.LE.sn ) .OR. ( aaqq.GE.temp1 ) .OR.
637 $ ( ( sn.LE.aaqq ) .AND. ( aapp.LE.temp1 ) ) )
THEN
638 temp1 = min( big, temp1 / aapp )
641 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.LE.temp1 ) )
THEN
642 temp1 = min( sn / aaqq, big / ( aapp*dsqrt( dble( n ) ) ) )
645 ELSE IF( ( aaqq.GE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
646 temp1 = max( sn / aaqq, temp1 / aapp )
649 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
650 temp1 = min( sn / aaqq, big / ( dsqrt( dble( n ) )*aapp ) )
659 IF( temp1.NE.one )
THEN
660 CALL dlascl(
'G', 0, 0, one, temp1, n, 1, sva, n, ierr )
663 IF( skl.NE.one )
THEN
664 CALL dlascl( joba, 0, 0, one, skl, m, n, a, lda, ierr )
670 emptsw = ( n*( n-1 ) ) / 2
698 IF( ( nbl*kbl ).NE.n )nbl = nbl + 1
703 rowskip = min( 5, kbl )
714 IF( ( lower .OR. upper ) .AND. ( n.GT.max( 64, 4*kbl ) ) )
THEN
736 CALL dgsvj0( jobv, m-n34, n-n34, a( n34+1, n34+1 ), lda,
737 $ work( n34+1 ), sva( n34+1 ), mvl,
738 $ v( n34*q+1, n34+1 ), ldv, epsln, sfmin, tol,
739 $ 2, work( n+1 ), lwork-n, ierr )
741 CALL dgsvj0( jobv, m-n2, n34-n2, a( n2+1, n2+1 ), lda,
742 $ work( n2+1 ), sva( n2+1 ), mvl,
743 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 2,
744 $ work( n+1 ), lwork-n, ierr )
746 CALL dgsvj1( jobv, m-n2, n-n2, n4, a( n2+1, n2+1 ), lda,
747 $ work( n2+1 ), sva( n2+1 ), mvl,
748 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
749 $ work( n+1 ), lwork-n, ierr )
751 CALL dgsvj0( jobv, m-n4, n2-n4, a( n4+1, n4+1 ), lda,
752 $ work( n4+1 ), sva( n4+1 ), mvl,
753 $ v( n4*q+1, n4+1 ), ldv, epsln, sfmin, tol, 1,
754 $ work( n+1 ), lwork-n, ierr )
756 CALL dgsvj0( jobv, m, n4, a, lda, work, sva, mvl, v, ldv,
757 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
760 CALL dgsvj1( jobv, m, n2, n4, a, lda, work, sva, mvl, v,
761 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
765 ELSE IF( upper )
THEN
768 CALL dgsvj0( jobv, n4, n4, a, lda, work, sva, mvl, v, ldv,
769 $ epsln, sfmin, tol, 2, work( n+1 ), lwork-n,
772 CALL dgsvj0( jobv, n2, n4, a( 1, n4+1 ), lda, work( n4+1 ),
773 $ sva( n4+1 ), mvl, v( n4*q+1, n4+1 ), ldv,
774 $ epsln, sfmin, tol, 1, work( n+1 ), lwork-n,
777 CALL dgsvj1( jobv, n2, n2, n4, a, lda, work, sva, mvl, v,
778 $ ldv, epsln, sfmin, tol, 1, work( n+1 ),
781 CALL dgsvj0( jobv, n2+n4, n4, a( 1, n2+1 ), lda,
782 $ work( n2+1 ), sva( n2+1 ), mvl,
783 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
784 $ work( n+1 ), lwork-n, ierr )
792 DO 1993 i = 1, nsweep
810 igl = ( ibr-1 )*kbl + 1
812 DO 1002 ir1 = 0, min( lkahead, nbl-ibr )
816 DO 2001 p = igl, min( igl+kbl-1, n-1 )
820 q = idamax( n-p+1, sva( p ), 1 ) + p - 1
822 CALL dswap( m, a( 1, p ), 1, a( 1, q ), 1 )
823 IF( rsvec )
CALL dswap( mvl, v( 1, p ), 1,
829 work( p ) = work( q )
847 IF( ( sva( p ).LT.rootbig ) .AND.
848 $ ( sva( p ).GT.rootsfmin ) )
THEN
849 sva( p ) = dnrm2( m, a( 1, p ), 1 )*work( p )
853 CALL dlassq( m, a( 1, p ), 1, temp1, aapp )
854 sva( p ) = temp1*dsqrt( aapp )*work( p )
861 IF( aapp.GT.zero )
THEN
865 DO 2002 q = p + 1, min( igl+kbl-1, n )
869 IF( aaqq.GT.zero )
THEN
872 IF( aaqq.GE.one )
THEN
873 rotok = ( small*aapp ).LE.aaqq
874 IF( aapp.LT.( big / aaqq ) )
THEN
875 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
876 $ q ), 1 )*work( p )*work( q ) /
879 CALL dcopy( m, a( 1, p ), 1,
881 CALL dlascl(
'G', 0, 0, aapp,
883 $ work( n+1 ), lda, ierr )
884 aapq = ddot( m, work( n+1 ), 1,
885 $ a( 1, q ), 1 )*work( q ) / aaqq
888 rotok = aapp.LE.( aaqq / small )
889 IF( aapp.GT.( small / aaqq ) )
THEN
890 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
891 $ q ), 1 )*work( p )*work( q ) /
894 CALL dcopy( m, a( 1, q ), 1,
896 CALL dlascl(
'G', 0, 0, aaqq,
898 $ work( n+1 ), lda, ierr )
899 aapq = ddot( m, work( n+1 ), 1,
900 $ a( 1, p ), 1 )*work( p ) / aapp
904 mxaapq = max( mxaapq, dabs( aapq ) )
908 IF( dabs( aapq ).GT.tol )
THEN
923 theta = -half*dabs(aqoap-apoaq)/aapq
925 IF( dabs( theta ).GT.bigtheta )
THEN
928 fastr( 3 ) = t*work( p ) / work( q )
929 fastr( 4 ) = -t*work( q ) /
931 CALL drotm( m, a( 1, p ), 1,
932 $ a( 1, q ), 1, fastr )
933 IF( rsvec )
CALL drotm( mvl,
937 sva( q ) = aaqq*dsqrt( max( zero,
938 $ one+t*apoaq*aapq ) )
939 aapp = aapp*dsqrt( max( zero,
940 $ one-t*aqoap*aapq ) )
941 mxsinj = max( mxsinj, dabs( t ) )
947 thsign = -dsign( one, aapq )
948 t = one / ( theta+thsign*
949 $ dsqrt( one+theta*theta ) )
950 cs = dsqrt( one / ( one+t*t ) )
953 mxsinj = max( mxsinj, dabs( sn ) )
954 sva( q ) = aaqq*dsqrt( max( zero,
955 $ one+t*apoaq*aapq ) )
956 aapp = aapp*dsqrt( max( zero,
957 $ one-t*aqoap*aapq ) )
959 apoaq = work( p ) / work( q )
960 aqoap = work( q ) / work( p )
961 IF( work( p ).GE.one )
THEN
962 IF( work( q ).GE.one )
THEN
964 fastr( 4 ) = -t*aqoap
965 work( p ) = work( p )*cs
966 work( q ) = work( q )*cs
967 CALL drotm( m, a( 1, p ), 1,
970 IF( rsvec )
CALL drotm( mvl,
971 $ v( 1, p ), 1, v( 1, q ),
974 CALL daxpy( m, -t*aqoap,
977 CALL daxpy( m, cs*sn*apoaq,
980 work( p ) = work( p )*cs
981 work( q ) = work( q ) / cs
983 CALL daxpy( mvl, -t*aqoap,
993 IF( work( q ).GE.one )
THEN
994 CALL daxpy( m, t*apoaq,
997 CALL daxpy( m, -cs*sn*aqoap,
1000 work( p ) = work( p ) / cs
1001 work( q ) = work( q )*cs
1003 CALL daxpy( mvl, t*apoaq,
1012 IF( work( p ).GE.work( q ) )
1014 CALL daxpy( m, -t*aqoap,
1017 CALL daxpy( m, cs*sn*apoaq,
1020 work( p ) = work( p )*cs
1021 work( q ) = work( q ) / cs
1033 CALL daxpy( m, t*apoaq,
1040 work( p ) = work( p ) / cs
1041 work( q ) = work( q )*cs
1044 $ t*apoaq, v( 1, p ),
1058 CALL dcopy( m, a( 1, p ), 1,
1060 CALL dlascl(
'G', 0, 0, aapp, one, m,
1061 $ 1, work( n+1 ), lda,
1063 CALL dlascl(
'G', 0, 0, aaqq, one, m,
1064 $ 1, a( 1, q ), lda, ierr )
1065 temp1 = -aapq*work( p ) / work( q )
1066 CALL daxpy( m, temp1, work( n+1 ), 1,
1068 CALL dlascl(
'G', 0, 0, one, aaqq, m,
1069 $ 1, a( 1, q ), lda, ierr )
1070 sva( q ) = aaqq*dsqrt( max( zero,
1072 mxsinj = max( mxsinj, sfmin )
1079 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1081 IF( ( aaqq.LT.rootbig ) .AND.
1082 $ ( aaqq.GT.rootsfmin ) )
THEN
1083 sva( q ) = dnrm2( m, a( 1, q ), 1 )*
1088 CALL dlassq( m, a( 1, q ), 1, t,
1090 sva( q ) = t*dsqrt( aaqq )*work( q )
1093 IF( ( aapp / aapp0 ).LE.rooteps )
THEN
1094 IF( ( aapp.LT.rootbig ) .AND.
1095 $ ( aapp.GT.rootsfmin ) )
THEN
1096 aapp = dnrm2( m, a( 1, p ), 1 )*
1101 CALL dlassq( m, a( 1, p ), 1, t,
1103 aapp = t*dsqrt( aapp )*work( p )
1110 IF( ir1.EQ.0 )notrot = notrot + 1
1112 pskipped = pskipped + 1
1116 IF( ir1.EQ.0 )notrot = notrot + 1
1117 pskipped = pskipped + 1
1120 IF( ( i.LE.swband ) .AND.
1121 $ ( pskipped.GT.rowskip ) )
THEN
1122 IF( ir1.EQ.0 )aapp = -aapp
1137 IF( ( ir1.EQ.0 ) .AND. ( aapp.EQ.zero ) )
1138 $ notrot = notrot + min( igl+kbl-1, n ) - p
1149 igl = ( ibr-1 )*kbl + 1
1151 DO 2010 jbc = ibr + 1, nbl
1153 jgl = ( jbc-1 )*kbl + 1
1158 DO 2100 p = igl, min( igl+kbl-1, n )
1161 IF( aapp.GT.zero )
THEN
1165 DO 2200 q = jgl, min( jgl+kbl-1, n )
1168 IF( aaqq.GT.zero )
THEN
1175 IF( aaqq.GE.one )
THEN
1176 IF( aapp.GE.aaqq )
THEN
1177 rotok = ( small*aapp ).LE.aaqq
1179 rotok = ( small*aaqq ).LE.aapp
1181 IF( aapp.LT.( big / aaqq ) )
THEN
1182 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
1183 $ q ), 1 )*work( p )*work( q ) /
1186 CALL dcopy( m, a( 1, p ), 1,
1188 CALL dlascl(
'G', 0, 0, aapp,
1190 $ work( n+1 ), lda, ierr )
1191 aapq = ddot( m, work( n+1 ), 1,
1192 $ a( 1, q ), 1 )*work( q ) / aaqq
1195 IF( aapp.GE.aaqq )
THEN
1196 rotok = aapp.LE.( aaqq / small )
1198 rotok = aaqq.LE.( aapp / small )
1200 IF( aapp.GT.( small / aaqq ) )
THEN
1201 aapq = ( ddot( m, a( 1, p ), 1, a( 1,
1202 $ q ), 1 )*work( p )*work( q ) /
1205 CALL dcopy( m, a( 1, q ), 1,
1207 CALL dlascl(
'G', 0, 0, aaqq,
1209 $ work( n+1 ), lda, ierr )
1210 aapq = ddot( m, work( n+1 ), 1,
1211 $ a( 1, p ), 1 )*work( p ) / aapp
1215 mxaapq = max( mxaapq, dabs( aapq ) )
1219 IF( dabs( aapq ).GT.tol )
THEN
1229 theta = -half*dabs(aqoap-apoaq)/aapq
1230 IF( aaqq.GT.aapp0 )theta = -theta
1232 IF( dabs( theta ).GT.bigtheta )
THEN
1234 fastr( 3 ) = t*work( p ) / work( q )
1235 fastr( 4 ) = -t*work( q ) /
1237 CALL drotm( m, a( 1, p ), 1,
1238 $ a( 1, q ), 1, fastr )
1239 IF( rsvec )
CALL drotm( mvl,
1243 sva( q ) = aaqq*dsqrt( max( zero,
1244 $ one+t*apoaq*aapq ) )
1245 aapp = aapp*dsqrt( max( zero,
1246 $ one-t*aqoap*aapq ) )
1247 mxsinj = max( mxsinj, dabs( t ) )
1252 thsign = -dsign( one, aapq )
1253 IF( aaqq.GT.aapp0 )thsign = -thsign
1254 t = one / ( theta+thsign*
1255 $ dsqrt( one+theta*theta ) )
1256 cs = dsqrt( one / ( one+t*t ) )
1258 mxsinj = max( mxsinj, dabs( sn ) )
1259 sva( q ) = aaqq*dsqrt( max( zero,
1260 $ one+t*apoaq*aapq ) )
1261 aapp = aapp*dsqrt( max( zero,
1262 $ one-t*aqoap*aapq ) )
1264 apoaq = work( p ) / work( q )
1265 aqoap = work( q ) / work( p )
1266 IF( work( p ).GE.one )
THEN
1268 IF( work( q ).GE.one )
THEN
1269 fastr( 3 ) = t*apoaq
1270 fastr( 4 ) = -t*aqoap
1271 work( p ) = work( p )*cs
1272 work( q ) = work( q )*cs
1273 CALL drotm( m, a( 1, p ), 1,
1276 IF( rsvec )
CALL drotm( mvl,
1277 $ v( 1, p ), 1, v( 1, q ),
1280 CALL daxpy( m, -t*aqoap,
1283 CALL daxpy( m, cs*sn*apoaq,
1287 CALL daxpy( mvl, -t*aqoap,
1295 work( p ) = work( p )*cs
1296 work( q ) = work( q ) / cs
1299 IF( work( q ).GE.one )
THEN
1300 CALL daxpy( m, t*apoaq,
1303 CALL daxpy( m, -cs*sn*aqoap,
1307 CALL daxpy( mvl, t*apoaq,
1315 work( p ) = work( p ) / cs
1316 work( q ) = work( q )*cs
1318 IF( work( p ).GE.work( q ) )
1320 CALL daxpy( m, -t*aqoap,
1323 CALL daxpy( m, cs*sn*apoaq,
1326 work( p ) = work( p )*cs
1327 work( q ) = work( q ) / cs
1339 CALL daxpy( m, t*apoaq,
1346 work( p ) = work( p ) / cs
1347 work( q ) = work( q )*cs
1350 $ t*apoaq, v( 1, p ),
1363 IF( aapp.GT.aaqq )
THEN
1364 CALL dcopy( m, a( 1, p ), 1,
1366 CALL dlascl(
'G', 0, 0, aapp, one,
1367 $ m, 1, work( n+1 ), lda,
1369 CALL dlascl(
'G', 0, 0, aaqq, one,
1370 $ m, 1, a( 1, q ), lda,
1372 temp1 = -aapq*work( p ) / work( q )
1373 CALL daxpy( m, temp1, work( n+1 ),
1375 CALL dlascl(
'G', 0, 0, one, aaqq,
1376 $ m, 1, a( 1, q ), lda,
1378 sva( q ) = aaqq*dsqrt( max( zero,
1380 mxsinj = max( mxsinj, sfmin )
1382 CALL dcopy( m, a( 1, q ), 1,
1384 CALL dlascl(
'G', 0, 0, aaqq, one,
1385 $ m, 1, work( n+1 ), lda,
1387 CALL dlascl(
'G', 0, 0, aapp, one,
1388 $ m, 1, a( 1, p ), lda,
1390 temp1 = -aapq*work( q ) / work( p )
1391 CALL daxpy( m, temp1, work( n+1 ),
1393 CALL dlascl(
'G', 0, 0, one, aapp,
1394 $ m, 1, a( 1, p ), lda,
1396 sva( p ) = aapp*dsqrt( max( zero,
1398 mxsinj = max( mxsinj, sfmin )
1405 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1407 IF( ( aaqq.LT.rootbig ) .AND.
1408 $ ( aaqq.GT.rootsfmin ) )
THEN
1409 sva( q ) = dnrm2( m, a( 1, q ), 1 )*
1414 CALL dlassq( m, a( 1, q ), 1, t,
1416 sva( q ) = t*dsqrt( aaqq )*work( q )
1419 IF( ( aapp / aapp0 )**2.LE.rooteps )
THEN
1420 IF( ( aapp.LT.rootbig ) .AND.
1421 $ ( aapp.GT.rootsfmin ) )
THEN
1422 aapp = dnrm2( m, a( 1, p ), 1 )*
1427 CALL dlassq( m, a( 1, p ), 1, t,
1429 aapp = t*dsqrt( aapp )*work( p )
1437 pskipped = pskipped + 1
1442 pskipped = pskipped + 1
1446 IF( ( i.LE.swband ) .AND. ( ijblsk.GE.blskip ) )
1452 IF( ( i.LE.swband ) .AND.
1453 $ ( pskipped.GT.rowskip ) )
THEN
1467 IF( aapp.EQ.zero )notrot = notrot +
1468 $ min( jgl+kbl-1, n ) - jgl + 1
1469 IF( aapp.LT.zero )notrot = 0
1479 DO 2012 p = igl, min( igl+kbl-1, n )
1480 sva( p ) = dabs( sva( p ) )
1487 IF( ( sva( n ).LT.rootbig ) .AND. ( sva( n ).GT.rootsfmin ) )
1489 sva( n ) = dnrm2( m, a( 1, n ), 1 )*work( n )
1493 CALL dlassq( m, a( 1, n ), 1, t, aapp )
1494 sva( n ) = t*dsqrt( aapp )*work( n )
1499 IF( ( i.LT.swband ) .AND. ( ( mxaapq.LE.roottol ) .OR.
1500 $ ( iswrot.LE.n ) ) )swband = i
1502 IF( ( i.GT.swband+1 ) .AND. ( mxaapq.LT.dsqrt( dble( n ) )*
1503 $ tol ) .AND. ( dble( n )*mxaapq*mxsinj.LT.tol ) )
THEN
1507 IF( notrot.GE.emptsw )
GO TO 1994
1529 DO 5991 p = 1, n - 1
1530 q = idamax( n-p+1, sva( p ), 1 ) + p - 1
1536 work( p ) = work( q )
1538 CALL dswap( m, a( 1, p ), 1, a( 1, q ), 1 )
1539 IF( rsvec )
CALL dswap( mvl, v( 1, p ), 1, v( 1, q ), 1 )
1541 IF( sva( p ).NE.zero )
THEN
1543 IF( sva( p )*skl.GT.sfmin )n2 = n2 + 1
1546 IF( sva( n ).NE.zero )
THEN
1548 IF( sva( n )*skl.GT.sfmin )n2 = n2 + 1
1553 IF( lsvec .OR. uctol )
THEN
1555 CALL dscal( m, work( p ) / sva( p ), a( 1, p ), 1 )
1564 CALL dscal( mvl, work( p ), v( 1, p ), 1 )
1568 temp1 = one / dnrm2( mvl, v( 1, p ), 1 )
1569 CALL dscal( mvl, temp1, v( 1, p ), 1 )
1575 IF( ( ( skl.GT.one ) .AND. ( sva( 1 ).LT.( big / skl) ) )
1576 $ .OR. ( ( skl.LT.one ) .AND. ( sva( max( n2, 1 ) ) .GT.
1577 $ ( sfmin / skl) ) ) )
THEN
1579 sva( p ) = skl*sva( p )
1589 work( 2 ) = dble( n4 )
1592 work( 3 ) = dble( n2 )
1597 work( 4 ) = dble( i )
subroutine xerbla(srname, info)
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
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 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 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...
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 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 dlassq(n, x, incx, scale, sumsq)
DLASSQ updates a sum of squares represented in scaled form.
subroutine drotm(n, dx, incx, dy, incy, dparam)
DROTM
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP