161 SUBROUTINE chbgst( VECT, UPLO, N, KA, KB, AB, LDAB, BB, LDBB,
163 $ LDX, WORK, RWORK, INFO )
171 INTEGER INFO, KA, KB, LDAB, LDBB, LDX, N
175 COMPLEX AB( LDAB, * ), BB( LDBB, * ), WORK( * ),
184 parameter( czero = ( 0.0e+0, 0.0e+0 ),
185 $ cone = ( 1.0e+0, 0.0e+0 ), one = 1.0e+0 )
188 LOGICAL UPDATE, UPPER, WANTX
189 INTEGER I, I0, I1, I2, INCA, J, J1, J1T, J2, J2T, K,
190 $ ka1, kb1, kbt, l, m, nr, nrt, nx
204 INTRINSIC conjg, max, min, real
210 wantx = lsame( vect,
'V' )
211 upper = lsame( uplo,
'U' )
215 IF( .NOT.wantx .AND. .NOT.lsame( vect,
'N' ) )
THEN
217 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
219 ELSE IF( n.LT.0 )
THEN
221 ELSE IF( ka.LT.0 )
THEN
223 ELSE IF( kb.LT.0 .OR. kb.GT.ka )
THEN
225 ELSE IF( ldab.LT.ka+1 )
THEN
227 ELSE IF( ldbb.LT.kb+1 )
THEN
229 ELSE IF( ldx.LT.1 .OR. wantx .AND. ldx.LT.max( 1, n ) )
THEN
233 CALL xerbla(
'CHBGST', -info )
247 $
CALL claset(
'Full', n, n, czero, cone, x, ldx )
345 bii = real( bb( kb1, i ) )
346 ab( ka1, i ) = ( real( ab( ka1, i ) ) / bii ) / bii
348 ab( i-j+ka1, j ) = ab( i-j+ka1, j ) / bii
350 DO 30 j = max( 1, i-ka ), i - 1
351 ab( j-i+ka1, i ) = ab( j-i+ka1, i ) / bii
353 DO 60 k = i - kbt, i - 1
355 ab( j-k+ka1, k ) = ab( j-k+ka1, k ) -
357 $ conjg( ab( k-i+ka1, i ) ) -
358 $ conjg( bb( k-i+kb1, i ) )*
360 $ real( ab( ka1, i ) )*
362 $ conjg( bb( k-i+kb1, i ) )
364 DO 50 j = max( 1, i-ka ), i - kbt - 1
365 ab( j-k+ka1, k ) = ab( j-k+ka1, k ) -
366 $ conjg( bb( k-i+kb1, i ) )*
371 DO 70 k = max( j-ka, i-kbt ), i - 1
372 ab( k-j+ka1, j ) = ab( k-j+ka1, j ) -
373 $ bb( k-i+kb1, i )*ab( i-j+ka1, j )
381 CALL csscal( n-m, one / bii, x( m+1, i ), 1 )
383 $
CALL cgerc( n-m, kbt, -cone, x( m+1, i ), 1,
384 $ bb( kb1-kbt, i ), 1, x( m+1, i-kbt ),
390 ra1 = ab( i-i1+ka1, i1 )
403 IF( i-k+ka.LT.n .AND. i-k.GT.1 )
THEN
407 CALL clartg( ab( k+1, i-k+ka ), ra1,
408 $ rwork( i-k+ka-m ), work( i-k+ka-m ), ra )
413 t = -bb( kb1-k, i )*ra1
414 work( i-k ) = rwork( i-k+ka-m )*t -
415 $ conjg( work( i-k+ka-m ) )*
417 ab( 1, i-k+ka ) = work( i-k+ka-m )*t +
418 $ rwork( i-k+ka-m )*ab( 1, i-k+ka )
422 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
423 nr = ( n-j2+ka ) / ka1
424 j1 = j2 + ( nr-1 )*ka1
426 j2t = max( j2, i+2*ka-k+1 )
430 nrt = ( n-j2t+ka ) / ka1
431 DO 90 j = j2t, j1, ka1
436 work( j-m ) = work( j-m )*ab( 1, j+1 )
437 ab( 1, j+1 ) = rwork( j-m )*ab( 1, j+1 )
444 $
CALL clargv( nrt, ab( 1, j2t ), inca, work( j2t-m ),
446 $ rwork( j2t-m ), ka1 )
452 CALL clartv( nr, ab( ka1-l, j2 ), inca,
453 $ ab( ka-l, j2+1 ), inca, rwork( j2-m ),
454 $ work( j2-m ), ka1 )
460 CALL clar2v( nr, ab( ka1, j2 ), ab( ka1, j2+1 ),
461 $ ab( ka, j2+1 ), inca, rwork( j2-m ),
462 $ work( j2-m ), ka1 )
464 CALL clacgv( nr, work( j2-m ), ka1 )
469 DO 110 l = ka - 1, kb - k + 1, -1
470 nrt = ( n-j2+l ) / ka1
472 $
CALL clartv( nrt, ab( l, j2+ka1-l ), inca,
473 $ ab( l+1, j2+ka1-l ), inca, rwork( j2-m ),
474 $ work( j2-m ), ka1 )
481 DO 120 j = j2, j1, ka1
482 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
483 $ rwork( j-m ), conjg( work( j-m ) ) )
489 IF( i2.LE.n .AND. kbt.GT.0 )
THEN
494 work( i-kbt ) = -bb( kb1-kbt, i )*ra1
500 j2 = i - k - 1 + max( 2, k-i0+1 )*ka1
502 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
507 DO 140 l = kb - k, 1, -1
508 nrt = ( n-j2+ka+l ) / ka1
510 $
CALL clartv( nrt, ab( l, j2-l+1 ), inca,
511 $ ab( l+1, j2-l+1 ), inca, rwork( j2-ka ),
512 $ work( j2-ka ), ka1 )
514 nr = ( n-j2+ka ) / ka1
515 j1 = j2 + ( nr-1 )*ka1
516 DO 150 j = j1, j2, -ka1
517 work( j ) = work( j-ka )
518 rwork( j ) = rwork( j-ka )
520 DO 160 j = j2, j1, ka1
525 work( j ) = work( j )*ab( 1, j+1 )
526 ab( 1, j+1 ) = rwork( j )*ab( 1, j+1 )
529 IF( i-k.LT.n-ka .AND. k.LE.kbt )
530 $ work( i-k+ka ) = work( i-k )
535 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
536 nr = ( n-j2+ka ) / ka1
537 j1 = j2 + ( nr-1 )*ka1
543 CALL clargv( nr, ab( 1, j2 ), inca, work( j2 ), ka1,
549 CALL clartv( nr, ab( ka1-l, j2 ), inca,
550 $ ab( ka-l, j2+1 ), inca, rwork( j2 ),
557 CALL clar2v( nr, ab( ka1, j2 ), ab( ka1, j2+1 ),
558 $ ab( ka, j2+1 ), inca, rwork( j2 ),
561 CALL clacgv( nr, work( j2 ), ka1 )
566 DO 190 l = ka - 1, kb - k + 1, -1
567 nrt = ( n-j2+l ) / ka1
569 $
CALL clartv( nrt, ab( l, j2+ka1-l ), inca,
570 $ ab( l+1, j2+ka1-l ), inca, rwork( j2 ),
578 DO 200 j = j2, j1, ka1
579 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
580 $ rwork( j ), conjg( work( j ) ) )
586 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
590 DO 220 l = kb - k, 1, -1
591 nrt = ( n-j2+l ) / ka1
593 $
CALL clartv( nrt, ab( l, j2+ka1-l ), inca,
594 $ ab( l+1, j2+ka1-l ), inca, rwork( j2-m ),
595 $ work( j2-m ), ka1 )
600 DO 240 j = n - 1, j2 + ka, -1
601 rwork( j-m ) = rwork( j-ka-m )
602 work( j-m ) = work( j-ka-m )
614 bii = real( bb( 1, i ) )
615 ab( 1, i ) = ( real( ab( 1, i ) ) / bii ) / bii
617 ab( j-i+1, i ) = ab( j-i+1, i ) / bii
619 DO 260 j = max( 1, i-ka ), i - 1
620 ab( i-j+1, j ) = ab( i-j+1, j ) / bii
622 DO 290 k = i - kbt, i - 1
623 DO 270 j = i - kbt, k
624 ab( k-j+1, j ) = ab( k-j+1, j ) -
625 $ bb( i-j+1, j )*conjg( ab( i-k+1,
626 $ k ) ) - conjg( bb( i-k+1, k ) )*
627 $ ab( i-j+1, j ) + real( ab( 1, i ) )*
628 $ bb( i-j+1, j )*conjg( bb( i-k+1,
631 DO 280 j = max( 1, i-ka ), i - kbt - 1
632 ab( k-j+1, j ) = ab( k-j+1, j ) -
633 $ conjg( bb( i-k+1, k ) )*
638 DO 300 k = max( j-ka, i-kbt ), i - 1
639 ab( j-k+1, k ) = ab( j-k+1, k ) -
640 $ bb( i-k+1, k )*ab( j-i+1, i )
648 CALL csscal( n-m, one / bii, x( m+1, i ), 1 )
650 $
CALL cgeru( n-m, kbt, -cone, x( m+1, i ), 1,
651 $ bb( kbt+1, i-kbt ), ldbb-1,
652 $ x( m+1, i-kbt ), ldx )
657 ra1 = ab( i1-i+1, i )
670 IF( i-k+ka.LT.n .AND. i-k.GT.1 )
THEN
674 CALL clartg( ab( ka1-k, i ), ra1,
676 $ work( i-k+ka-m ), ra )
681 t = -bb( k+1, i-k )*ra1
682 work( i-k ) = rwork( i-k+ka-m )*t -
683 $ conjg( work( i-k+ka-m ) )*ab( ka1, i-k )
684 ab( ka1, i-k ) = work( i-k+ka-m )*t +
685 $ rwork( i-k+ka-m )*ab( ka1, i-k )
689 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
690 nr = ( n-j2+ka ) / ka1
691 j1 = j2 + ( nr-1 )*ka1
693 j2t = max( j2, i+2*ka-k+1 )
697 nrt = ( n-j2t+ka ) / ka1
698 DO 320 j = j2t, j1, ka1
703 work( j-m ) = work( j-m )*ab( ka1, j-ka+1 )
704 ab( ka1, j-ka+1 ) = rwork( j-m )*ab( ka1, j-ka+1 )
711 $
CALL clargv( nrt, ab( ka1, j2t-ka ), inca,
713 $ ka1, rwork( j2t-m ), ka1 )
719 CALL clartv( nr, ab( l+1, j2-l ), inca,
720 $ ab( l+2, j2-l ), inca, rwork( j2-m ),
721 $ work( j2-m ), ka1 )
727 CALL clar2v( nr, ab( 1, j2 ), ab( 1, j2+1 ), ab( 2,
729 $ inca, rwork( j2-m ), work( j2-m ), ka1 )
731 CALL clacgv( nr, work( j2-m ), ka1 )
736 DO 340 l = ka - 1, kb - k + 1, -1
737 nrt = ( n-j2+l ) / ka1
739 $
CALL clartv( nrt, ab( ka1-l+1, j2 ), inca,
740 $ ab( ka1-l, j2+1 ), inca, rwork( j2-m ),
741 $ work( j2-m ), ka1 )
748 DO 350 j = j2, j1, ka1
749 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
750 $ rwork( j-m ), work( j-m ) )
756 IF( i2.LE.n .AND. kbt.GT.0 )
THEN
761 work( i-kbt ) = -bb( kbt+1, i-kbt )*ra1
767 j2 = i - k - 1 + max( 2, k-i0+1 )*ka1
769 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
774 DO 370 l = kb - k, 1, -1
775 nrt = ( n-j2+ka+l ) / ka1
777 $
CALL clartv( nrt, ab( ka1-l+1, j2-ka ), inca,
778 $ ab( ka1-l, j2-ka+1 ), inca,
779 $ rwork( j2-ka ), work( j2-ka ), ka1 )
781 nr = ( n-j2+ka ) / ka1
782 j1 = j2 + ( nr-1 )*ka1
783 DO 380 j = j1, j2, -ka1
784 work( j ) = work( j-ka )
785 rwork( j ) = rwork( j-ka )
787 DO 390 j = j2, j1, ka1
792 work( j ) = work( j )*ab( ka1, j-ka+1 )
793 ab( ka1, j-ka+1 ) = rwork( j )*ab( ka1, j-ka+1 )
796 IF( i-k.LT.n-ka .AND. k.LE.kbt )
797 $ work( i-k+ka ) = work( i-k )
802 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
803 nr = ( n-j2+ka ) / ka1
804 j1 = j2 + ( nr-1 )*ka1
810 CALL clargv( nr, ab( ka1, j2-ka ), inca, work( j2 ),
817 CALL clartv( nr, ab( l+1, j2-l ), inca,
818 $ ab( l+2, j2-l ), inca, rwork( j2 ),
825 CALL clar2v( nr, ab( 1, j2 ), ab( 1, j2+1 ), ab( 2,
827 $ inca, rwork( j2 ), work( j2 ), ka1 )
829 CALL clacgv( nr, work( j2 ), ka1 )
834 DO 420 l = ka - 1, kb - k + 1, -1
835 nrt = ( n-j2+l ) / ka1
837 $
CALL clartv( nrt, ab( ka1-l+1, j2 ), inca,
838 $ ab( ka1-l, j2+1 ), inca, rwork( j2 ),
846 DO 430 j = j2, j1, ka1
847 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
848 $ rwork( j ), work( j ) )
854 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
858 DO 450 l = kb - k, 1, -1
859 nrt = ( n-j2+l ) / ka1
861 $
CALL clartv( nrt, ab( ka1-l+1, j2 ), inca,
862 $ ab( ka1-l, j2+1 ), inca, rwork( j2-m ),
863 $ work( j2-m ), ka1 )
868 DO 470 j = n - 1, j2 + ka, -1
869 rwork( j-m ) = rwork( j-ka-m )
870 work( j-m ) = work( j-ka-m )
919 IF( i.LT.m-kbt )
THEN
933 bii = real( bb( kb1, i ) )
934 ab( ka1, i ) = ( real( ab( ka1, i ) ) / bii ) / bii
936 ab( j-i+ka1, i ) = ab( j-i+ka1, i ) / bii
938 DO 510 j = i + 1, min( n, i+ka )
939 ab( i-j+ka1, j ) = ab( i-j+ka1, j ) / bii
941 DO 540 k = i + 1, i + kbt
942 DO 520 j = k, i + kbt
943 ab( k-j+ka1, j ) = ab( k-j+ka1, j ) -
945 $ conjg( ab( i-k+ka1, k ) ) -
946 $ conjg( bb( i-k+kb1, k ) )*
948 $ real( ab( ka1, i ) )*
950 $ conjg( bb( i-k+kb1, k ) )
952 DO 530 j = i + kbt + 1, min( n, i+ka )
953 ab( k-j+ka1, j ) = ab( k-j+ka1, j ) -
954 $ conjg( bb( i-k+kb1, k ) )*
959 DO 550 k = i + 1, min( j+ka, i+kbt )
960 ab( j-k+ka1, k ) = ab( j-k+ka1, k ) -
961 $ bb( i-k+kb1, k )*ab( j-i+ka1, i )
969 CALL csscal( nx, one / bii, x( 1, i ), 1 )
971 $
CALL cgeru( nx, kbt, -cone, x( 1, i ), 1,
972 $ bb( kb, i+1 ), ldbb-1, x( 1, i+1 ), ldx )
977 ra1 = ab( i1-i+ka1, i )
989 IF( i+k-ka1.GT.0 .AND. i+k.LT.m )
THEN
993 CALL clartg( ab( k+1, i ), ra1, rwork( i+k-ka ),
994 $ work( i+k-ka ), ra )
999 t = -bb( kb1-k, i+k )*ra1
1000 work( m-kb+i+k ) = rwork( i+k-ka )*t -
1001 $ conjg( work( i+k-ka ) )*
1003 ab( 1, i+k ) = work( i+k-ka )*t +
1004 $ rwork( i+k-ka )*ab( 1, i+k )
1008 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1009 nr = ( j2+ka-1 ) / ka1
1010 j1 = j2 - ( nr-1 )*ka1
1012 j2t = min( j2, i-2*ka+k-1 )
1016 nrt = ( j2t+ka-1 ) / ka1
1017 DO 570 j = j1, j2t, ka1
1022 work( j ) = work( j )*ab( 1, j+ka-1 )
1023 ab( 1, j+ka-1 ) = rwork( j )*ab( 1, j+ka-1 )
1030 $
CALL clargv( nrt, ab( 1, j1+ka ), inca, work( j1 ),
1032 $ rwork( j1 ), ka1 )
1037 DO 580 l = 1, ka - 1
1038 CALL clartv( nr, ab( ka1-l, j1+l ), inca,
1039 $ ab( ka-l, j1+l ), inca, rwork( j1 ),
1046 CALL clar2v( nr, ab( ka1, j1 ), ab( ka1, j1-1 ),
1047 $ ab( ka, j1 ), inca, rwork( j1 ), work( j1 ),
1050 CALL clacgv( nr, work( j1 ), ka1 )
1055 DO 590 l = ka - 1, kb - k + 1, -1
1056 nrt = ( j2+l-1 ) / ka1
1057 j1t = j2 - ( nrt-1 )*ka1
1059 $
CALL clartv( nrt, ab( l, j1t ), inca,
1060 $ ab( l+1, j1t-1 ), inca, rwork( j1t ),
1061 $ work( j1t ), ka1 )
1068 DO 600 j = j1, j2, ka1
1069 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1070 $ rwork( j ), work( j ) )
1076 IF( i2.GT.0 .AND. kbt.GT.0 )
THEN
1081 work( m-kb+i+kbt ) = -bb( kb1-kbt, i+kbt )*ra1
1085 DO 650 k = kb, 1, -1
1087 j2 = i + k + 1 - max( 2, k+i0-m )*ka1
1089 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1094 DO 620 l = kb - k, 1, -1
1095 nrt = ( j2+ka+l-1 ) / ka1
1096 j1t = j2 - ( nrt-1 )*ka1
1098 $
CALL clartv( nrt, ab( l, j1t+ka ), inca,
1099 $ ab( l+1, j1t+ka-1 ), inca,
1100 $ rwork( m-kb+j1t+ka ),
1101 $ work( m-kb+j1t+ka ), ka1 )
1103 nr = ( j2+ka-1 ) / ka1
1104 j1 = j2 - ( nr-1 )*ka1
1105 DO 630 j = j1, j2, ka1
1106 work( m-kb+j ) = work( m-kb+j+ka )
1107 rwork( m-kb+j ) = rwork( m-kb+j+ka )
1109 DO 640 j = j1, j2, ka1
1114 work( m-kb+j ) = work( m-kb+j )*ab( 1, j+ka-1 )
1115 ab( 1, j+ka-1 ) = rwork( m-kb+j )*ab( 1, j+ka-1 )
1118 IF( i+k.GT.ka1 .AND. k.LE.kbt )
1119 $ work( m-kb+i+k-ka ) = work( m-kb+i+k )
1123 DO 690 k = kb, 1, -1
1124 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1125 nr = ( j2+ka-1 ) / ka1
1126 j1 = j2 - ( nr-1 )*ka1
1132 CALL clargv( nr, ab( 1, j1+ka ), inca,
1134 $ ka1, rwork( m-kb+j1 ), ka1 )
1138 DO 660 l = 1, ka - 1
1139 CALL clartv( nr, ab( ka1-l, j1+l ), inca,
1140 $ ab( ka-l, j1+l ), inca, rwork( m-kb+j1 ),
1141 $ work( m-kb+j1 ), ka1 )
1147 CALL clar2v( nr, ab( ka1, j1 ), ab( ka1, j1-1 ),
1148 $ ab( ka, j1 ), inca, rwork( m-kb+j1 ),
1149 $ work( m-kb+j1 ), ka1 )
1151 CALL clacgv( nr, work( m-kb+j1 ), ka1 )
1156 DO 670 l = ka - 1, kb - k + 1, -1
1157 nrt = ( j2+l-1 ) / ka1
1158 j1t = j2 - ( nrt-1 )*ka1
1160 $
CALL clartv( nrt, ab( l, j1t ), inca,
1161 $ ab( l+1, j1t-1 ), inca,
1162 $ rwork( m-kb+j1t ), work( m-kb+j1t ),
1170 DO 680 j = j1, j2, ka1
1171 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1172 $ rwork( m-kb+j ), work( m-kb+j ) )
1177 DO 710 k = 1, kb - 1
1178 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1182 DO 700 l = kb - k, 1, -1
1183 nrt = ( j2+l-1 ) / ka1
1184 j1t = j2 - ( nrt-1 )*ka1
1186 $
CALL clartv( nrt, ab( l, j1t ), inca,
1187 $ ab( l+1, j1t-1 ), inca, rwork( j1t ),
1188 $ work( j1t ), ka1 )
1193 DO 720 j = 2, i2 - ka
1194 rwork( j ) = rwork( j+ka )
1195 work( j ) = work( j+ka )
1207 bii = real( bb( 1, i ) )
1208 ab( 1, i ) = ( real( ab( 1, i ) ) / bii ) / bii
1209 DO 730 j = i1, i - 1
1210 ab( i-j+1, j ) = ab( i-j+1, j ) / bii
1212 DO 740 j = i + 1, min( n, i+ka )
1213 ab( j-i+1, i ) = ab( j-i+1, i ) / bii
1215 DO 770 k = i + 1, i + kbt
1216 DO 750 j = k, i + kbt
1217 ab( j-k+1, k ) = ab( j-k+1, k ) -
1218 $ bb( j-i+1, i )*conjg( ab( k-i+1,
1219 $ i ) ) - conjg( bb( k-i+1, i ) )*
1220 $ ab( j-i+1, i ) + real( ab( 1, i ) )*
1221 $ bb( j-i+1, i )*conjg( bb( k-i+1,
1224 DO 760 j = i + kbt + 1, min( n, i+ka )
1225 ab( j-k+1, k ) = ab( j-k+1, k ) -
1226 $ conjg( bb( k-i+1, i ) )*
1231 DO 780 k = i + 1, min( j+ka, i+kbt )
1232 ab( k-j+1, j ) = ab( k-j+1, j ) -
1233 $ bb( k-i+1, i )*ab( i-j+1, j )
1241 CALL csscal( nx, one / bii, x( 1, i ), 1 )
1243 $
CALL cgerc( nx, kbt, -cone, x( 1, i ), 1, bb( 2,
1245 $ 1, x( 1, i+1 ), ldx )
1250 ra1 = ab( i-i1+1, i1 )
1256 DO 840 k = 1, kb - 1
1262 IF( i+k-ka1.GT.0 .AND. i+k.LT.m )
THEN
1266 CALL clartg( ab( ka1-k, i+k-ka ), ra1,
1267 $ rwork( i+k-ka ), work( i+k-ka ), ra )
1272 t = -bb( k+1, i )*ra1
1273 work( m-kb+i+k ) = rwork( i+k-ka )*t -
1274 $ conjg( work( i+k-ka ) )*
1276 ab( ka1, i+k-ka ) = work( i+k-ka )*t +
1277 $ rwork( i+k-ka )*ab( ka1, i+k-ka )
1281 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1282 nr = ( j2+ka-1 ) / ka1
1283 j1 = j2 - ( nr-1 )*ka1
1285 j2t = min( j2, i-2*ka+k-1 )
1289 nrt = ( j2t+ka-1 ) / ka1
1290 DO 800 j = j1, j2t, ka1
1295 work( j ) = work( j )*ab( ka1, j-1 )
1296 ab( ka1, j-1 ) = rwork( j )*ab( ka1, j-1 )
1303 $
CALL clargv( nrt, ab( ka1, j1 ), inca, work( j1 ),
1305 $ rwork( j1 ), ka1 )
1310 DO 810 l = 1, ka - 1
1311 CALL clartv( nr, ab( l+1, j1 ), inca, ab( l+2,
1313 $ inca, rwork( j1 ), work( j1 ), ka1 )
1319 CALL clar2v( nr, ab( 1, j1 ), ab( 1, j1-1 ),
1320 $ ab( 2, j1-1 ), inca, rwork( j1 ),
1323 CALL clacgv( nr, work( j1 ), ka1 )
1328 DO 820 l = ka - 1, kb - k + 1, -1
1329 nrt = ( j2+l-1 ) / ka1
1330 j1t = j2 - ( nrt-1 )*ka1
1332 $
CALL clartv( nrt, ab( ka1-l+1, j1t-ka1+l ), inca,
1333 $ ab( ka1-l, j1t-ka1+l ), inca,
1334 $ rwork( j1t ), work( j1t ), ka1 )
1341 DO 830 j = j1, j2, ka1
1342 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1343 $ rwork( j ), conjg( work( j ) ) )
1349 IF( i2.GT.0 .AND. kbt.GT.0 )
THEN
1354 work( m-kb+i+kbt ) = -bb( kbt+1, i )*ra1
1358 DO 880 k = kb, 1, -1
1360 j2 = i + k + 1 - max( 2, k+i0-m )*ka1
1362 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1367 DO 850 l = kb - k, 1, -1
1368 nrt = ( j2+ka+l-1 ) / ka1
1369 j1t = j2 - ( nrt-1 )*ka1
1371 $
CALL clartv( nrt, ab( ka1-l+1, j1t+l-1 ), inca,
1372 $ ab( ka1-l, j1t+l-1 ), inca,
1373 $ rwork( m-kb+j1t+ka ),
1374 $ work( m-kb+j1t+ka ), ka1 )
1376 nr = ( j2+ka-1 ) / ka1
1377 j1 = j2 - ( nr-1 )*ka1
1378 DO 860 j = j1, j2, ka1
1379 work( m-kb+j ) = work( m-kb+j+ka )
1380 rwork( m-kb+j ) = rwork( m-kb+j+ka )
1382 DO 870 j = j1, j2, ka1
1387 work( m-kb+j ) = work( m-kb+j )*ab( ka1, j-1 )
1388 ab( ka1, j-1 ) = rwork( m-kb+j )*ab( ka1, j-1 )
1391 IF( i+k.GT.ka1 .AND. k.LE.kbt )
1392 $ work( m-kb+i+k-ka ) = work( m-kb+i+k )
1396 DO 920 k = kb, 1, -1
1397 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1398 nr = ( j2+ka-1 ) / ka1
1399 j1 = j2 - ( nr-1 )*ka1
1405 CALL clargv( nr, ab( ka1, j1 ), inca, work( m-kb+j1 ),
1406 $ ka1, rwork( m-kb+j1 ), ka1 )
1410 DO 890 l = 1, ka - 1
1411 CALL clartv( nr, ab( l+1, j1 ), inca, ab( l+2,
1413 $ inca, rwork( m-kb+j1 ), work( m-kb+j1 ),
1420 CALL clar2v( nr, ab( 1, j1 ), ab( 1, j1-1 ),
1421 $ ab( 2, j1-1 ), inca, rwork( m-kb+j1 ),
1422 $ work( m-kb+j1 ), ka1 )
1424 CALL clacgv( nr, work( m-kb+j1 ), ka1 )
1429 DO 900 l = ka - 1, kb - k + 1, -1
1430 nrt = ( j2+l-1 ) / ka1
1431 j1t = j2 - ( nrt-1 )*ka1
1433 $
CALL clartv( nrt, ab( ka1-l+1, j1t-ka1+l ), inca,
1434 $ ab( ka1-l, j1t-ka1+l ), inca,
1435 $ rwork( m-kb+j1t ), work( m-kb+j1t ),
1443 DO 910 j = j1, j2, ka1
1444 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1445 $ rwork( m-kb+j ), conjg( work( m-kb+j ) ) )
1450 DO 940 k = 1, kb - 1
1451 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1455 DO 930 l = kb - k, 1, -1
1456 nrt = ( j2+l-1 ) / ka1
1457 j1t = j2 - ( nrt-1 )*ka1
1459 $
CALL clartv( nrt, ab( ka1-l+1, j1t-ka1+l ), inca,
1460 $ ab( ka1-l, j1t-ka1+l ), inca,
1461 $ rwork( j1t ), work( j1t ), ka1 )
1466 DO 950 j = 2, i2 - ka
1467 rwork( j ) = rwork( j+ka )
1468 work( j ) = work( j+ka )