326 SUBROUTINE sbbcsd( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P,
328 $ THETA, PHI, U1, LDU1, U2, LDU2, V1T, LDV1T,
329 $ V2T, LDV2T, B11D, B11E, B12D, B12E, B21D, B21E,
330 $ B22D, B22E, WORK, LWORK, INFO )
337 CHARACTER JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS
338 INTEGER INFO, LDU1, LDU2, LDV1T, LDV2T, LWORK, M, P, Q
341 REAL B11D( * ), B11E( * ), B12D( * ), B12E( * ),
342 $ b21d( * ), b21e( * ), b22d( * ), b22e( * ),
343 $ phi( * ), theta( * ), work( * )
344 REAL U1( LDU1, * ), U2( LDU2, * ), V1T( LDV1T, * ),
352 PARAMETER ( MAXITR = 6 )
353 real hundred, meighth, one, ten, zero
354 parameter( hundred = 100.0e0, meighth = -0.125e0,
355 $ one = 1.0e0, ten = 10.0e0, zero = 0.0e0 )
357 parameter( negone = -1.0e0 )
359 PARAMETER ( PIOVER2 = 1.57079632679489661923132169163975144210e0 )
362 LOGICAL COLMAJOR, LQUERY, RESTART11, RESTART12,
363 $ restart21, restart22, wantu1, wantu2, wantv1t,
365 INTEGER I, IMIN, IMAX, ITER, IU1CS, IU1SN, IU2CS,
366 $ iu2sn, iv1tcs, iv1tsn, iv2tcs, iv2tsn, j,
367 $ lworkmin, lworkopt, maxit, mini
368 REAL B11BULGE, B12BULGE, B21BULGE, B22BULGE, DUMMY,
369 $ eps, mu, nu, r, sigma11, sigma21,
370 $ temp, thetamax, thetamin, thresh, tol, tolmul,
371 $ unfl, x1, x2, y1, y2
381 EXTERNAL LSAME, SLAMCH
384 INTRINSIC abs, atan2, cos, max, min, sin, sqrt
391 lquery = lwork .EQ. -1
392 wantu1 = lsame( jobu1,
'Y' )
393 wantu2 = lsame( jobu2,
'Y' )
394 wantv1t = lsame( jobv1t,
'Y' )
395 wantv2t = lsame( jobv2t,
'Y' )
396 colmajor = .NOT. lsame( trans,
'T' )
400 ELSE IF( p .LT. 0 .OR. p .GT. m )
THEN
402 ELSE IF( q .LT. 0 .OR. q .GT. m )
THEN
404 ELSE IF( q .GT. p .OR. q .GT. m-p .OR. q .GT. m-q )
THEN
406 ELSE IF( wantu1 .AND. ldu1 .LT. p )
THEN
408 ELSE IF( wantu2 .AND. ldu2 .LT. m-p )
THEN
410 ELSE IF( wantv1t .AND. ldv1t .LT. q )
THEN
412 ELSE IF( wantv2t .AND. ldv2t .LT. m-q )
THEN
418 IF( info .EQ. 0 .AND. q .EQ. 0 )
THEN
420 work(1) = real( lworkmin )
426 IF( info .EQ. 0 )
THEN
435 lworkopt = iv2tsn + q - 1
437 work(1) = real( lworkopt )
438 IF( lwork .LT. lworkmin .AND. .NOT. lquery )
THEN
443 IF( info .NE. 0 )
THEN
444 CALL xerbla(
'SBBCSD', -info )
446 ELSE IF( lquery )
THEN
452 eps = slamch(
'Epsilon' )
453 unfl = slamch(
'Safe minimum' )
454 tolmul = max( ten, min( hundred, eps**meighth ) )
456 thresh = max( tol, real( maxitr*q*q )*unfl )
461 IF( theta(i) .LT. thresh )
THEN
463 ELSE IF( theta(i) .GT. piover2-thresh )
THEN
468 IF( phi(i) .LT. thresh )
THEN
470 ELSE IF( phi(i) .GT. piover2-thresh )
THEN
478 DO WHILE( imax .GT. 1 )
479 IF( phi(imax-1) .NE. zero )
THEN
485 IF ( imin .GT. 1 )
THEN
486 DO WHILE( phi(imin-1) .NE. zero )
488 IF ( imin .LE. 1 )
EXIT
499 DO WHILE( imax .GT. 1 )
503 b11d(imin) = cos( theta(imin) )
504 b21d(imin) = -sin( theta(imin) )
505 DO i = imin, imax - 1
506 b11e(i) = -sin( theta(i) ) * sin( phi(i) )
507 b11d(i+1) = cos( theta(i+1) ) * cos( phi(i) )
508 b12d(i) = sin( theta(i) ) * cos( phi(i) )
509 b12e(i) = cos( theta(i+1) ) * sin( phi(i) )
510 b21e(i) = -cos( theta(i) ) * sin( phi(i) )
511 b21d(i+1) = -sin( theta(i+1) ) * cos( phi(i) )
512 b22d(i) = cos( theta(i) ) * cos( phi(i) )
513 b22e(i) = -sin( theta(i+1) ) * sin( phi(i) )
515 b12d(imax) = sin( theta(imax) )
516 b22d(imax) = cos( theta(imax) )
520 IF( iter .GT. maxit )
THEN
523 IF( phi(i) .NE. zero )
529 iter = iter + imax - imin
533 thetamax = theta(imin)
534 thetamin = theta(imin)
536 IF( theta(i) > thetamax )
537 $ thetamax = theta(i)
538 IF( theta(i) < thetamin )
539 $ thetamin = theta(i)
542 IF( thetamax .GT. piover2 - thresh )
THEN
550 ELSE IF( thetamin .LT. thresh )
THEN
562 CALL slas2( b11d(imax-1), b11e(imax-1), b11d(imax),
565 CALL slas2( b21d(imax-1), b21e(imax-1), b21d(imax),
569 IF( sigma11 .LE. sigma21 )
THEN
571 nu = sqrt( one - mu**2 )
572 IF( mu .LT. thresh )
THEN
578 mu = sqrt( 1.0 - nu**2 )
579 IF( nu .LT. thresh )
THEN
588 IF( mu .LE. nu )
THEN
589 CALL slartgs( b11d(imin), b11e(imin), mu,
590 $ work(iv1tcs+imin-1), work(iv1tsn+imin-1) )
592 CALL slartgs( b21d(imin), b21e(imin), nu,
593 $ work(iv1tcs+imin-1), work(iv1tsn+imin-1) )
596 temp = work(iv1tcs+imin-1)*b11d(imin) +
597 $ work(iv1tsn+imin-1)*b11e(imin)
598 b11e(imin) = work(iv1tcs+imin-1)*b11e(imin) -
599 $ work(iv1tsn+imin-1)*b11d(imin)
601 b11bulge = work(iv1tsn+imin-1)*b11d(imin+1)
602 b11d(imin+1) = work(iv1tcs+imin-1)*b11d(imin+1)
603 temp = work(iv1tcs+imin-1)*b21d(imin) +
604 $ work(iv1tsn+imin-1)*b21e(imin)
605 b21e(imin) = work(iv1tcs+imin-1)*b21e(imin) -
606 $ work(iv1tsn+imin-1)*b21d(imin)
608 b21bulge = work(iv1tsn+imin-1)*b21d(imin+1)
609 b21d(imin+1) = work(iv1tcs+imin-1)*b21d(imin+1)
613 theta( imin ) = atan2( sqrt( b21d(imin)**2+b21bulge**2 ),
614 $ sqrt( b11d(imin)**2+b11bulge**2 ) )
618 IF( b11d(imin)**2+b11bulge**2 .GT. thresh**2 )
THEN
619 CALL slartgp( b11bulge, b11d(imin), work(iu1sn+imin-1),
620 $ work(iu1cs+imin-1), r )
621 ELSE IF( mu .LE. nu )
THEN
622 CALL slartgs( b11e( imin ), b11d( imin + 1 ), mu,
623 $ work(iu1cs+imin-1), work(iu1sn+imin-1) )
625 CALL slartgs( b12d( imin ), b12e( imin ), nu,
626 $ work(iu1cs+imin-1), work(iu1sn+imin-1) )
628 IF( b21d(imin)**2+b21bulge**2 .GT. thresh**2 )
THEN
629 CALL slartgp( b21bulge, b21d(imin), work(iu2sn+imin-1),
630 $ work(iu2cs+imin-1), r )
631 ELSE IF( nu .LT. mu )
THEN
632 CALL slartgs( b21e( imin ), b21d( imin + 1 ), nu,
633 $ work(iu2cs+imin-1), work(iu2sn+imin-1) )
635 CALL slartgs( b22d(imin), b22e(imin), mu,
636 $ work(iu2cs+imin-1), work(iu2sn+imin-1) )
638 work(iu2cs+imin-1) = -work(iu2cs+imin-1)
639 work(iu2sn+imin-1) = -work(iu2sn+imin-1)
641 temp = work(iu1cs+imin-1)*b11e(imin) +
642 $ work(iu1sn+imin-1)*b11d(imin+1)
643 b11d(imin+1) = work(iu1cs+imin-1)*b11d(imin+1) -
644 $ work(iu1sn+imin-1)*b11e(imin)
646 IF( imax .GT. imin+1 )
THEN
647 b11bulge = work(iu1sn+imin-1)*b11e(imin+1)
648 b11e(imin+1) = work(iu1cs+imin-1)*b11e(imin+1)
650 temp = work(iu1cs+imin-1)*b12d(imin) +
651 $ work(iu1sn+imin-1)*b12e(imin)
652 b12e(imin) = work(iu1cs+imin-1)*b12e(imin) -
653 $ work(iu1sn+imin-1)*b12d(imin)
655 b12bulge = work(iu1sn+imin-1)*b12d(imin+1)
656 b12d(imin+1) = work(iu1cs+imin-1)*b12d(imin+1)
657 temp = work(iu2cs+imin-1)*b21e(imin) +
658 $ work(iu2sn+imin-1)*b21d(imin+1)
659 b21d(imin+1) = work(iu2cs+imin-1)*b21d(imin+1) -
660 $ work(iu2sn+imin-1)*b21e(imin)
662 IF( imax .GT. imin+1 )
THEN
663 b21bulge = work(iu2sn+imin-1)*b21e(imin+1)
664 b21e(imin+1) = work(iu2cs+imin-1)*b21e(imin+1)
666 temp = work(iu2cs+imin-1)*b22d(imin) +
667 $ work(iu2sn+imin-1)*b22e(imin)
668 b22e(imin) = work(iu2cs+imin-1)*b22e(imin) -
669 $ work(iu2sn+imin-1)*b22d(imin)
671 b22bulge = work(iu2sn+imin-1)*b22d(imin+1)
672 b22d(imin+1) = work(iu2cs+imin-1)*b22d(imin+1)
678 DO i = imin+1, imax-1
682 x1 = sin(theta(i-1))*b11e(i-1) + cos(theta(i-1))*b21e(i-1)
683 x2 = sin(theta(i-1))*b11bulge + cos(theta(i-1))*b21bulge
684 y1 = sin(theta(i-1))*b12d(i-1) + cos(theta(i-1))*b22d(i-1)
685 y2 = sin(theta(i-1))*b12bulge + cos(theta(i-1))*b22bulge
687 phi(i-1) = atan2( sqrt(x1**2+x2**2), sqrt(y1**2+y2**2) )
692 restart11 = b11e(i-1)**2 + b11bulge**2 .LE. thresh**2
693 restart21 = b21e(i-1)**2 + b21bulge**2 .LE. thresh**2
694 restart12 = b12d(i-1)**2 + b12bulge**2 .LE. thresh**2
695 restart22 = b22d(i-1)**2 + b22bulge**2 .LE. thresh**2
701 IF( .NOT. restart11 .AND. .NOT. restart21 )
THEN
702 CALL slartgp( x2, x1, work(iv1tsn+i-1),
705 ELSE IF( .NOT. restart11 .AND. restart21 )
THEN
706 CALL slartgp( b11bulge, b11e(i-1), work(iv1tsn+i-1),
707 $ work(iv1tcs+i-1), r )
708 ELSE IF( restart11 .AND. .NOT. restart21 )
THEN
709 CALL slartgp( b21bulge, b21e(i-1), work(iv1tsn+i-1),
710 $ work(iv1tcs+i-1), r )
711 ELSE IF( mu .LE. nu )
THEN
712 CALL slartgs( b11d(i), b11e(i), mu, work(iv1tcs+i-1),
715 CALL slartgs( b21d(i), b21e(i), nu, work(iv1tcs+i-1),
718 work(iv1tcs+i-1) = -work(iv1tcs+i-1)
719 work(iv1tsn+i-1) = -work(iv1tsn+i-1)
720 IF( .NOT. restart12 .AND. .NOT. restart22 )
THEN
721 CALL slartgp( y2, y1, work(iv2tsn+i-1-1),
722 $ work(iv2tcs+i-1-1), r )
723 ELSE IF( .NOT. restart12 .AND. restart22 )
THEN
724 CALL slartgp( b12bulge, b12d(i-1), work(iv2tsn+i-1-1),
725 $ work(iv2tcs+i-1-1), r )
726 ELSE IF( restart12 .AND. .NOT. restart22 )
THEN
727 CALL slartgp( b22bulge, b22d(i-1), work(iv2tsn+i-1-1),
728 $ work(iv2tcs+i-1-1), r )
729 ELSE IF( nu .LT. mu )
THEN
730 CALL slartgs( b12e(i-1), b12d(i), nu,
731 $ work(iv2tcs+i-1-1),
732 $ work(iv2tsn+i-1-1) )
734 CALL slartgs( b22e(i-1), b22d(i), mu,
735 $ work(iv2tcs+i-1-1),
736 $ work(iv2tsn+i-1-1) )
739 temp = work(iv1tcs+i-1)*b11d(i) + work(iv1tsn+i-1)*b11e(i)
740 b11e(i) = work(iv1tcs+i-1)*b11e(i) -
741 $ work(iv1tsn+i-1)*b11d(i)
743 b11bulge = work(iv1tsn+i-1)*b11d(i+1)
744 b11d(i+1) = work(iv1tcs+i-1)*b11d(i+1)
745 temp = work(iv1tcs+i-1)*b21d(i) + work(iv1tsn+i-1)*b21e(i)
746 b21e(i) = work(iv1tcs+i-1)*b21e(i) -
747 $ work(iv1tsn+i-1)*b21d(i)
749 b21bulge = work(iv1tsn+i-1)*b21d(i+1)
750 b21d(i+1) = work(iv1tcs+i-1)*b21d(i+1)
751 temp = work(iv2tcs+i-1-1)*b12e(i-1) +
752 $ work(iv2tsn+i-1-1)*b12d(i)
753 b12d(i) = work(iv2tcs+i-1-1)*b12d(i) -
754 $ work(iv2tsn+i-1-1)*b12e(i-1)
756 b12bulge = work(iv2tsn+i-1-1)*b12e(i)
757 b12e(i) = work(iv2tcs+i-1-1)*b12e(i)
758 temp = work(iv2tcs+i-1-1)*b22e(i-1) +
759 $ work(iv2tsn+i-1-1)*b22d(i)
760 b22d(i) = work(iv2tcs+i-1-1)*b22d(i) -
761 $ work(iv2tsn+i-1-1)*b22e(i-1)
763 b22bulge = work(iv2tsn+i-1-1)*b22e(i)
764 b22e(i) = work(iv2tcs+i-1-1)*b22e(i)
768 x1 = cos(phi(i-1))*b11d(i) + sin(phi(i-1))*b12e(i-1)
769 x2 = cos(phi(i-1))*b11bulge + sin(phi(i-1))*b12bulge
770 y1 = cos(phi(i-1))*b21d(i) + sin(phi(i-1))*b22e(i-1)
771 y2 = cos(phi(i-1))*b21bulge + sin(phi(i-1))*b22bulge
773 theta(i) = atan2( sqrt(y1**2+y2**2), sqrt(x1**2+x2**2) )
778 restart11 = b11d(i)**2 + b11bulge**2 .LE. thresh**2
779 restart12 = b12e(i-1)**2 + b12bulge**2 .LE. thresh**2
780 restart21 = b21d(i)**2 + b21bulge**2 .LE. thresh**2
781 restart22 = b22e(i-1)**2 + b22bulge**2 .LE. thresh**2
787 IF( .NOT. restart11 .AND. .NOT. restart12 )
THEN
788 CALL slartgp( x2, x1, work(iu1sn+i-1),
791 ELSE IF( .NOT. restart11 .AND. restart12 )
THEN
792 CALL slartgp( b11bulge, b11d(i), work(iu1sn+i-1),
793 $ work(iu1cs+i-1), r )
794 ELSE IF( restart11 .AND. .NOT. restart12 )
THEN
795 CALL slartgp( b12bulge, b12e(i-1), work(iu1sn+i-1),
796 $ work(iu1cs+i-1), r )
797 ELSE IF( mu .LE. nu )
THEN
798 CALL slartgs( b11e(i), b11d(i+1), mu, work(iu1cs+i-1),
801 CALL slartgs( b12d(i), b12e(i), nu, work(iu1cs+i-1),
804 IF( .NOT. restart21 .AND. .NOT. restart22 )
THEN
805 CALL slartgp( y2, y1, work(iu2sn+i-1),
808 ELSE IF( .NOT. restart21 .AND. restart22 )
THEN
809 CALL slartgp( b21bulge, b21d(i), work(iu2sn+i-1),
810 $ work(iu2cs+i-1), r )
811 ELSE IF( restart21 .AND. .NOT. restart22 )
THEN
812 CALL slartgp( b22bulge, b22e(i-1), work(iu2sn+i-1),
813 $ work(iu2cs+i-1), r )
814 ELSE IF( nu .LT. mu )
THEN
815 CALL slartgs( b21e(i), b21e(i+1), nu, work(iu2cs+i-1),
818 CALL slartgs( b22d(i), b22e(i), mu, work(iu2cs+i-1),
821 work(iu2cs+i-1) = -work(iu2cs+i-1)
822 work(iu2sn+i-1) = -work(iu2sn+i-1)
824 temp = work(iu1cs+i-1)*b11e(i) + work(iu1sn+i-1)*b11d(i+1)
825 b11d(i+1) = work(iu1cs+i-1)*b11d(i+1) -
826 $ work(iu1sn+i-1)*b11e(i)
828 IF( i .LT. imax - 1 )
THEN
829 b11bulge = work(iu1sn+i-1)*b11e(i+1)
830 b11e(i+1) = work(iu1cs+i-1)*b11e(i+1)
832 temp = work(iu2cs+i-1)*b21e(i) + work(iu2sn+i-1)*b21d(i+1)
833 b21d(i+1) = work(iu2cs+i-1)*b21d(i+1) -
834 $ work(iu2sn+i-1)*b21e(i)
836 IF( i .LT. imax - 1 )
THEN
837 b21bulge = work(iu2sn+i-1)*b21e(i+1)
838 b21e(i+1) = work(iu2cs+i-1)*b21e(i+1)
840 temp = work(iu1cs+i-1)*b12d(i) + work(iu1sn+i-1)*b12e(i)
841 b12e(i) = work(iu1cs+i-1)*b12e(i) - work(iu1sn+i-1)*b12d(i)
843 b12bulge = work(iu1sn+i-1)*b12d(i+1)
844 b12d(i+1) = work(iu1cs+i-1)*b12d(i+1)
845 temp = work(iu2cs+i-1)*b22d(i) + work(iu2sn+i-1)*b22e(i)
846 b22e(i) = work(iu2cs+i-1)*b22e(i) - work(iu2sn+i-1)*b22d(i)
848 b22bulge = work(iu2sn+i-1)*b22d(i+1)
849 b22d(i+1) = work(iu2cs+i-1)*b22d(i+1)
855 x1 = sin(theta(imax-1))*b11e(imax-1) +
856 $ cos(theta(imax-1))*b21e(imax-1)
857 y1 = sin(theta(imax-1))*b12d(imax-1) +
858 $ cos(theta(imax-1))*b22d(imax-1)
859 y2 = sin(theta(imax-1))*b12bulge + cos(theta(imax-1))*b22bulge
861 phi(imax-1) = atan2( abs(x1), sqrt(y1**2+y2**2) )
865 restart12 = b12d(imax-1)**2 + b12bulge**2 .LE. thresh**2
866 restart22 = b22d(imax-1)**2 + b22bulge**2 .LE. thresh**2
868 IF( .NOT. restart12 .AND. .NOT. restart22 )
THEN
869 CALL slartgp( y2, y1, work(iv2tsn+imax-1-1),
870 $ work(iv2tcs+imax-1-1), r )
871 ELSE IF( .NOT. restart12 .AND. restart22 )
THEN
872 CALL slartgp( b12bulge, b12d(imax-1),
873 $ work(iv2tsn+imax-1-1),
874 $ work(iv2tcs+imax-1-1), r )
875 ELSE IF( restart12 .AND. .NOT. restart22 )
THEN
876 CALL slartgp( b22bulge, b22d(imax-1),
877 $ work(iv2tsn+imax-1-1),
878 $ work(iv2tcs+imax-1-1), r )
879 ELSE IF( nu .LT. mu )
THEN
880 CALL slartgs( b12e(imax-1), b12d(imax), nu,
881 $ work(iv2tcs+imax-1-1), work(iv2tsn+imax-1-1) )
883 CALL slartgs( b22e(imax-1), b22d(imax), mu,
884 $ work(iv2tcs+imax-1-1), work(iv2tsn+imax-1-1) )
887 temp = work(iv2tcs+imax-1-1)*b12e(imax-1) +
888 $ work(iv2tsn+imax-1-1)*b12d(imax)
889 b12d(imax) = work(iv2tcs+imax-1-1)*b12d(imax) -
890 $ work(iv2tsn+imax-1-1)*b12e(imax-1)
892 temp = work(iv2tcs+imax-1-1)*b22e(imax-1) +
893 $ work(iv2tsn+imax-1-1)*b22d(imax)
894 b22d(imax) = work(iv2tcs+imax-1-1)*b22d(imax) -
895 $ work(iv2tsn+imax-1-1)*b22e(imax-1)
902 CALL slasr(
'R',
'V',
'F', p, imax-imin+1,
903 $ work(iu1cs+imin-1), work(iu1sn+imin-1),
906 CALL slasr(
'L',
'V',
'F', imax-imin+1, p,
907 $ work(iu1cs+imin-1), work(iu1sn+imin-1),
913 CALL slasr(
'R',
'V',
'F', m-p, imax-imin+1,
914 $ work(iu2cs+imin-1), work(iu2sn+imin-1),
917 CALL slasr(
'L',
'V',
'F', imax-imin+1, m-p,
918 $ work(iu2cs+imin-1), work(iu2sn+imin-1),
924 CALL slasr(
'L',
'V',
'F', imax-imin+1, q,
925 $ work(iv1tcs+imin-1), work(iv1tsn+imin-1),
926 $ v1t(imin,1), ldv1t )
928 CALL slasr(
'R',
'V',
'F', q, imax-imin+1,
929 $ work(iv1tcs+imin-1), work(iv1tsn+imin-1),
930 $ v1t(1,imin), ldv1t )
935 CALL slasr(
'L',
'V',
'F', imax-imin+1, m-q,
936 $ work(iv2tcs+imin-1), work(iv2tsn+imin-1),
937 $ v2t(imin,1), ldv2t )
939 CALL slasr(
'R',
'V',
'F', m-q, imax-imin+1,
940 $ work(iv2tcs+imin-1), work(iv2tsn+imin-1),
941 $ v2t(1,imin), ldv2t )
947 IF( b11e(imax-1)+b21e(imax-1) .GT. 0 )
THEN
948 b11d(imax) = -b11d(imax)
949 b21d(imax) = -b21d(imax)
952 CALL sscal( q, negone, v1t(imax,1), ldv1t )
954 CALL sscal( q, negone, v1t(1,imax), 1 )
961 x1 = cos(phi(imax-1))*b11d(imax) +
962 $ sin(phi(imax-1))*b12e(imax-1)
963 y1 = cos(phi(imax-1))*b21d(imax) +
964 $ sin(phi(imax-1))*b22e(imax-1)
966 theta(imax) = atan2( abs(y1), abs(x1) )
971 IF( b11d(imax)+b12e(imax-1) .LT. 0 )
THEN
972 b12d(imax) = -b12d(imax)
975 CALL sscal( p, negone, u1(1,imax), 1 )
977 CALL sscal( p, negone, u1(imax,1), ldu1 )
981 IF( b21d(imax)+b22e(imax-1) .GT. 0 )
THEN
982 b22d(imax) = -b22d(imax)
985 CALL sscal( m-p, negone, u2(1,imax), 1 )
987 CALL sscal( m-p, negone, u2(imax,1), ldu2 )
994 IF( b12d(imax)+b22d(imax) .LT. 0 )
THEN
997 CALL sscal( m-q, negone, v2t(imax,1), ldv2t )
999 CALL sscal( m-q, negone, v2t(1,imax), 1 )
1007 IF( theta(i) .LT. thresh )
THEN
1009 ELSE IF( theta(i) .GT. piover2-thresh )
THEN
1014 IF( phi(i) .LT. thresh )
THEN
1016 ELSE IF( phi(i) .GT. piover2-thresh )
THEN
1023 IF (imax .GT. 1)
THEN
1024 DO WHILE( phi(imax-1) .EQ. zero )
1026 IF (imax .LE. 1)
EXIT
1029 IF( imin .GT. imax - 1 )
1031 IF (imin .GT. 1)
THEN
1032 DO WHILE (phi(imin-1) .NE. zero)
1034 IF (imin .LE. 1)
EXIT
1049 IF( theta(j) .LT. thetamin )
THEN
1055 IF( mini .NE. i )
THEN
1056 theta(mini) = theta(i)
1060 $
CALL sswap( p, u1(1,i), 1, u1(1,mini), 1 )
1062 $
CALL sswap( m-p, u2(1,i), 1, u2(1,mini), 1 )
1064 $
CALL sswap( q, v1t(i,1), ldv1t, v1t(mini,1),
1067 $
CALL sswap( m-q, v2t(i,1), ldv2t, v2t(mini,1),
1071 $
CALL sswap( p, u1(i,1), ldu1, u1(mini,1), ldu1 )
1073 $
CALL sswap( m-p, u2(i,1), ldu2, u2(mini,1), ldu2 )
1075 $
CALL sswap( q, v1t(1,i), 1, v1t(1,mini), 1 )
1077 $
CALL sswap( m-q, v2t(1,i), 1, v2t(1,mini), 1 )