165 SUBROUTINE chbgst( VECT, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, X,
166 $ ldx, work, rwork, info )
175 INTEGER INFO, KA, KB, LDAB, LDBB, LDX, N
179 COMPLEX AB( ldab, * ), BB( ldbb, * ), WORK( * ),
188 parameter ( czero = ( 0.0e+0, 0.0e+0 ),
189 $ cone = ( 1.0e+0, 0.0e+0 ), one = 1.0e+0 )
192 LOGICAL UPDATE, UPPER, WANTX
193 INTEGER I, I0, I1, I2, INCA, J, J1, J1T, J2, J2T, K,
194 $ ka1, kb1, kbt, l, m, nr, nrt, nx
207 INTRINSIC conjg, max, min, real
213 wantx = lsame( vect,
'V' )
214 upper = lsame( uplo,
'U' )
218 IF( .NOT.wantx .AND. .NOT.lsame( vect,
'N' ) )
THEN
220 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
222 ELSE IF( n.LT.0 )
THEN
224 ELSE IF( ka.LT.0 )
THEN
226 ELSE IF( kb.LT.0 .OR. kb.GT.ka )
THEN
228 ELSE IF( ldab.LT.ka+1 )
THEN
230 ELSE IF( ldbb.LT.kb+1 )
THEN
232 ELSE IF( ldx.LT.1 .OR. wantx .AND. ldx.LT.max( 1, n ) )
THEN
236 CALL xerbla(
'CHBGST', -info )
250 $
CALL claset(
'Full', n, n, czero, cone, x, ldx )
348 bii =
REAL( BB( KB1, I ) )
349 ab( ka1, i ) = (
REAL( AB( KA1, I ) ) / BII ) / bii
351 ab( i-j+ka1, j ) = ab( i-j+ka1, j ) / bii
353 DO 30 j = max( 1, i-ka ), i - 1
354 ab( j-i+ka1, i ) = ab( j-i+ka1, i ) / bii
356 DO 60 k = i - kbt, i - 1
358 ab( j-k+ka1, k ) = ab( j-k+ka1, k ) -
360 $ conjg( ab( k-i+ka1, i ) ) -
361 $ conjg( bb( k-i+kb1, i ) )*
363 $
REAL( AB( KA1, I ) )*
365 $ conjg( bb( k-i+kb1, i ) )
367 DO 50 j = max( 1, i-ka ), i - kbt - 1
368 ab( j-k+ka1, k ) = ab( j-k+ka1, k ) -
369 $ conjg( bb( k-i+kb1, i ) )*
374 DO 70 k = max( j-ka, i-kbt ), i - 1
375 ab( k-j+ka1, j ) = ab( k-j+ka1, j ) -
376 $ bb( k-i+kb1, i )*ab( i-j+ka1, j )
384 CALL csscal( n-m, one / bii, x( m+1, i ), 1 )
386 $
CALL cgerc( n-m, kbt, -cone, x( m+1, i ), 1,
387 $ bb( kb1-kbt, i ), 1, x( m+1, i-kbt ),
393 ra1 = ab( i-i1+ka1, i1 )
406 IF( i-k+ka.LT.n .AND. i-k.GT.1 )
THEN
410 CALL clartg( ab( k+1, i-k+ka ), ra1,
411 $ rwork( i-k+ka-m ), work( i-k+ka-m ), ra )
416 t = -bb( kb1-k, i )*ra1
417 work( i-k ) = rwork( i-k+ka-m )*t -
418 $ conjg( work( i-k+ka-m ) )*
420 ab( 1, i-k+ka ) = work( i-k+ka-m )*t +
421 $ rwork( i-k+ka-m )*ab( 1, i-k+ka )
425 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
426 nr = ( n-j2+ka ) / ka1
427 j1 = j2 + ( nr-1 )*ka1
429 j2t = max( j2, i+2*ka-k+1 )
433 nrt = ( n-j2t+ka ) / ka1
434 DO 90 j = j2t, j1, ka1
439 work( j-m ) = work( j-m )*ab( 1, j+1 )
440 ab( 1, j+1 ) = rwork( j-m )*ab( 1, j+1 )
447 $
CALL clargv( nrt, ab( 1, j2t ), inca, work( j2t-m ), ka1,
448 $ rwork( j2t-m ), ka1 )
454 CALL clartv( nr, ab( ka1-l, j2 ), inca,
455 $ ab( ka-l, j2+1 ), inca, rwork( j2-m ),
456 $ work( j2-m ), ka1 )
462 CALL clar2v( nr, ab( ka1, j2 ), ab( ka1, j2+1 ),
463 $ ab( ka, j2+1 ), inca, rwork( j2-m ),
464 $ work( j2-m ), ka1 )
466 CALL clacgv( nr, work( j2-m ), ka1 )
471 DO 110 l = ka - 1, kb - k + 1, -1
472 nrt = ( n-j2+l ) / ka1
474 $
CALL clartv( nrt, ab( l, j2+ka1-l ), inca,
475 $ ab( l+1, j2+ka1-l ), inca, rwork( j2-m ),
476 $ work( j2-m ), ka1 )
483 DO 120 j = j2, j1, ka1
484 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
485 $ rwork( j-m ), conjg( work( j-m ) ) )
491 IF( i2.LE.n .AND. kbt.GT.0 )
THEN
496 work( i-kbt ) = -bb( kb1-kbt, i )*ra1
502 j2 = i - k - 1 + max( 2, k-i0+1 )*ka1
504 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
509 DO 140 l = kb - k, 1, -1
510 nrt = ( n-j2+ka+l ) / ka1
512 $
CALL clartv( nrt, ab( l, j2-l+1 ), inca,
513 $ ab( l+1, j2-l+1 ), inca, rwork( j2-ka ),
514 $ work( j2-ka ), ka1 )
516 nr = ( n-j2+ka ) / ka1
517 j1 = j2 + ( nr-1 )*ka1
518 DO 150 j = j1, j2, -ka1
519 work( j ) = work( j-ka )
520 rwork( j ) = rwork( j-ka )
522 DO 160 j = j2, j1, ka1
527 work( j ) = work( j )*ab( 1, j+1 )
528 ab( 1, j+1 ) = rwork( j )*ab( 1, j+1 )
531 IF( i-k.LT.n-ka .AND. k.LE.kbt )
532 $ work( i-k+ka ) = work( i-k )
537 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
538 nr = ( n-j2+ka ) / ka1
539 j1 = j2 + ( nr-1 )*ka1
545 CALL clargv( nr, ab( 1, j2 ), inca, work( j2 ), ka1,
551 CALL clartv( nr, ab( ka1-l, j2 ), inca,
552 $ ab( ka-l, j2+1 ), inca, rwork( j2 ),
559 CALL clar2v( nr, ab( ka1, j2 ), ab( ka1, j2+1 ),
560 $ ab( ka, j2+1 ), inca, rwork( j2 ),
563 CALL clacgv( nr, work( j2 ), ka1 )
568 DO 190 l = ka - 1, kb - k + 1, -1
569 nrt = ( n-j2+l ) / ka1
571 $
CALL clartv( nrt, ab( l, j2+ka1-l ), inca,
572 $ ab( l+1, j2+ka1-l ), inca, rwork( j2 ),
580 DO 200 j = j2, j1, ka1
581 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
582 $ rwork( j ), conjg( work( j ) ) )
588 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
592 DO 220 l = kb - k, 1, -1
593 nrt = ( n-j2+l ) / ka1
595 $
CALL clartv( nrt, ab( l, j2+ka1-l ), inca,
596 $ ab( l+1, j2+ka1-l ), inca, rwork( j2-m ),
597 $ work( j2-m ), ka1 )
602 DO 240 j = n - 1, j2 + ka, -1
603 rwork( j-m ) = rwork( j-ka-m )
604 work( j-m ) = work( j-ka-m )
616 bii =
REAL( BB( 1, I ) )
617 ab( 1, i ) = (
REAL( AB( 1, I ) ) / BII ) / bii
619 ab( j-i+1, i ) = ab( j-i+1, i ) / bii
621 DO 260 j = max( 1, i-ka ), i - 1
622 ab( i-j+1, j ) = ab( i-j+1, j ) / bii
624 DO 290 k = i - kbt, i - 1
625 DO 270 j = i - kbt, k
626 ab( k-j+1, j ) = ab( k-j+1, j ) -
627 $ bb( i-j+1, j )*conjg( ab( i-k+1,
628 $ k ) ) - conjg( bb( i-k+1, k ) )*
629 $ ab( i-j+1, j ) +
REAL( AB( 1, I ) )*
630 $ bb( i-j+1, j )*conjg( bb( i-k+1,
633 DO 280 j = max( 1, i-ka ), i - kbt - 1
634 ab( k-j+1, j ) = ab( k-j+1, j ) -
635 $ conjg( bb( i-k+1, k ) )*
640 DO 300 k = max( j-ka, i-kbt ), i - 1
641 ab( j-k+1, k ) = ab( j-k+1, k ) -
642 $ bb( i-k+1, k )*ab( j-i+1, i )
650 CALL csscal( n-m, one / bii, x( m+1, i ), 1 )
652 $
CALL cgeru( n-m, kbt, -cone, x( m+1, i ), 1,
653 $ bb( kbt+1, i-kbt ), ldbb-1,
654 $ x( m+1, i-kbt ), ldx )
659 ra1 = ab( i1-i+1, i )
672 IF( i-k+ka.LT.n .AND. i-k.GT.1 )
THEN
676 CALL clartg( ab( ka1-k, i ), ra1, rwork( i-k+ka-m ),
677 $ work( i-k+ka-m ), ra )
682 t = -bb( k+1, i-k )*ra1
683 work( i-k ) = rwork( i-k+ka-m )*t -
684 $ conjg( work( i-k+ka-m ) )*ab( ka1, i-k )
685 ab( ka1, i-k ) = work( i-k+ka-m )*t +
686 $ rwork( i-k+ka-m )*ab( ka1, i-k )
690 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
691 nr = ( n-j2+ka ) / ka1
692 j1 = j2 + ( nr-1 )*ka1
694 j2t = max( j2, i+2*ka-k+1 )
698 nrt = ( n-j2t+ka ) / ka1
699 DO 320 j = j2t, j1, ka1
704 work( j-m ) = work( j-m )*ab( ka1, j-ka+1 )
705 ab( ka1, j-ka+1 ) = rwork( j-m )*ab( ka1, j-ka+1 )
712 $
CALL clargv( nrt, ab( ka1, j2t-ka ), inca, work( j2t-m ),
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, j2 ),
728 $ inca, rwork( j2-m ), work( j2-m ), ka1 )
730 CALL clacgv( nr, work( j2-m ), ka1 )
735 DO 340 l = ka - 1, kb - k + 1, -1
736 nrt = ( n-j2+l ) / ka1
738 $
CALL clartv( nrt, ab( ka1-l+1, j2 ), inca,
739 $ ab( ka1-l, j2+1 ), inca, rwork( j2-m ),
740 $ work( j2-m ), ka1 )
747 DO 350 j = j2, j1, ka1
748 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
749 $ rwork( j-m ), work( j-m ) )
755 IF( i2.LE.n .AND. kbt.GT.0 )
THEN
760 work( i-kbt ) = -bb( kbt+1, i-kbt )*ra1
766 j2 = i - k - 1 + max( 2, k-i0+1 )*ka1
768 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
773 DO 370 l = kb - k, 1, -1
774 nrt = ( n-j2+ka+l ) / ka1
776 $
CALL clartv( nrt, ab( ka1-l+1, j2-ka ), inca,
777 $ ab( ka1-l, j2-ka+1 ), inca,
778 $ rwork( j2-ka ), work( j2-ka ), ka1 )
780 nr = ( n-j2+ka ) / ka1
781 j1 = j2 + ( nr-1 )*ka1
782 DO 380 j = j1, j2, -ka1
783 work( j ) = work( j-ka )
784 rwork( j ) = rwork( j-ka )
786 DO 390 j = j2, j1, ka1
791 work( j ) = work( j )*ab( ka1, j-ka+1 )
792 ab( ka1, j-ka+1 ) = rwork( j )*ab( ka1, j-ka+1 )
795 IF( i-k.LT.n-ka .AND. k.LE.kbt )
796 $ work( i-k+ka ) = work( i-k )
801 j2 = i - k - 1 + max( 1, k-i0+1 )*ka1
802 nr = ( n-j2+ka ) / ka1
803 j1 = j2 + ( nr-1 )*ka1
809 CALL clargv( nr, ab( ka1, j2-ka ), inca, work( j2 ), ka1,
815 CALL clartv( nr, ab( l+1, j2-l ), inca,
816 $ ab( l+2, j2-l ), inca, rwork( j2 ),
823 CALL clar2v( nr, ab( 1, j2 ), ab( 1, j2+1 ), ab( 2, j2 ),
824 $ inca, rwork( j2 ), work( j2 ), ka1 )
826 CALL clacgv( nr, work( j2 ), ka1 )
831 DO 420 l = ka - 1, kb - k + 1, -1
832 nrt = ( n-j2+l ) / ka1
834 $
CALL clartv( nrt, ab( ka1-l+1, j2 ), inca,
835 $ ab( ka1-l, j2+1 ), inca, rwork( j2 ),
843 DO 430 j = j2, j1, ka1
844 CALL crot( n-m, x( m+1, j ), 1, x( m+1, j+1 ), 1,
845 $ rwork( j ), work( j ) )
851 j2 = i - k - 1 + max( 1, k-i0+2 )*ka1
855 DO 450 l = kb - k, 1, -1
856 nrt = ( n-j2+l ) / ka1
858 $
CALL clartv( nrt, ab( ka1-l+1, j2 ), inca,
859 $ ab( ka1-l, j2+1 ), inca, rwork( j2-m ),
860 $ work( j2-m ), ka1 )
865 DO 470 j = n - 1, j2 + ka, -1
866 rwork( j-m ) = rwork( j-ka-m )
867 work( j-m ) = work( j-ka-m )
916 IF( i.LT.m-kbt )
THEN
930 bii =
REAL( BB( KB1, I ) )
931 ab( ka1, i ) = (
REAL( AB( KA1, I ) ) / BII ) / bii
933 ab( j-i+ka1, i ) = ab( j-i+ka1, i ) / bii
935 DO 510 j = i + 1, min( n, i+ka )
936 ab( i-j+ka1, j ) = ab( i-j+ka1, j ) / bii
938 DO 540 k = i + 1, i + kbt
939 DO 520 j = k, i + kbt
940 ab( k-j+ka1, j ) = ab( k-j+ka1, j ) -
942 $ conjg( ab( i-k+ka1, k ) ) -
943 $ conjg( bb( i-k+kb1, k ) )*
945 $
REAL( AB( KA1, I ) )*
947 $ conjg( bb( i-k+kb1, k ) )
949 DO 530 j = i + kbt + 1, min( n, i+ka )
950 ab( k-j+ka1, j ) = ab( k-j+ka1, j ) -
951 $ conjg( bb( i-k+kb1, k ) )*
956 DO 550 k = i + 1, min( j+ka, i+kbt )
957 ab( j-k+ka1, k ) = ab( j-k+ka1, k ) -
958 $ bb( i-k+kb1, k )*ab( j-i+ka1, i )
966 CALL csscal( nx, one / bii, x( 1, i ), 1 )
968 $
CALL cgeru( nx, kbt, -cone, x( 1, i ), 1,
969 $ bb( kb, i+1 ), ldbb-1, x( 1, i+1 ), ldx )
974 ra1 = ab( i1-i+ka1, i )
986 IF( i+k-ka1.GT.0 .AND. i+k.LT.m )
THEN
990 CALL clartg( ab( k+1, i ), ra1, rwork( i+k-ka ),
991 $ work( i+k-ka ), ra )
996 t = -bb( kb1-k, i+k )*ra1
997 work( m-kb+i+k ) = rwork( i+k-ka )*t -
998 $ conjg( work( i+k-ka ) )*
1000 ab( 1, i+k ) = work( i+k-ka )*t +
1001 $ rwork( i+k-ka )*ab( 1, i+k )
1005 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1006 nr = ( j2+ka-1 ) / ka1
1007 j1 = j2 - ( nr-1 )*ka1
1009 j2t = min( j2, i-2*ka+k-1 )
1013 nrt = ( j2t+ka-1 ) / ka1
1014 DO 570 j = j1, j2t, ka1
1019 work( j ) = work( j )*ab( 1, j+ka-1 )
1020 ab( 1, j+ka-1 ) = rwork( j )*ab( 1, j+ka-1 )
1027 $
CALL clargv( nrt, ab( 1, j1+ka ), inca, work( j1 ), ka1,
1028 $ rwork( j1 ), ka1 )
1033 DO 580 l = 1, ka - 1
1034 CALL clartv( nr, ab( ka1-l, j1+l ), inca,
1035 $ ab( ka-l, j1+l ), inca, rwork( j1 ),
1042 CALL clar2v( nr, ab( ka1, j1 ), ab( ka1, j1-1 ),
1043 $ ab( ka, j1 ), inca, rwork( j1 ), work( j1 ),
1046 CALL clacgv( nr, work( j1 ), ka1 )
1051 DO 590 l = ka - 1, kb - k + 1, -1
1052 nrt = ( j2+l-1 ) / ka1
1053 j1t = j2 - ( nrt-1 )*ka1
1055 $
CALL clartv( nrt, ab( l, j1t ), inca,
1056 $ ab( l+1, j1t-1 ), inca, rwork( j1t ),
1057 $ work( j1t ), ka1 )
1064 DO 600 j = j1, j2, ka1
1065 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1066 $ rwork( j ), work( j ) )
1072 IF( i2.GT.0 .AND. kbt.GT.0 )
THEN
1077 work( m-kb+i+kbt ) = -bb( kb1-kbt, i+kbt )*ra1
1081 DO 650 k = kb, 1, -1
1083 j2 = i + k + 1 - max( 2, k+i0-m )*ka1
1085 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1090 DO 620 l = kb - k, 1, -1
1091 nrt = ( j2+ka+l-1 ) / ka1
1092 j1t = j2 - ( nrt-1 )*ka1
1094 $
CALL clartv( nrt, ab( l, j1t+ka ), inca,
1095 $ ab( l+1, j1t+ka-1 ), inca,
1096 $ rwork( m-kb+j1t+ka ),
1097 $ work( m-kb+j1t+ka ), ka1 )
1099 nr = ( j2+ka-1 ) / ka1
1100 j1 = j2 - ( nr-1 )*ka1
1101 DO 630 j = j1, j2, ka1
1102 work( m-kb+j ) = work( m-kb+j+ka )
1103 rwork( m-kb+j ) = rwork( m-kb+j+ka )
1105 DO 640 j = j1, j2, ka1
1110 work( m-kb+j ) = work( m-kb+j )*ab( 1, j+ka-1 )
1111 ab( 1, j+ka-1 ) = rwork( m-kb+j )*ab( 1, j+ka-1 )
1114 IF( i+k.GT.ka1 .AND. k.LE.kbt )
1115 $ work( m-kb+i+k-ka ) = work( m-kb+i+k )
1119 DO 690 k = kb, 1, -1
1120 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1121 nr = ( j2+ka-1 ) / ka1
1122 j1 = j2 - ( nr-1 )*ka1
1128 CALL clargv( nr, ab( 1, j1+ka ), inca, work( m-kb+j1 ),
1129 $ ka1, rwork( m-kb+j1 ), ka1 )
1133 DO 660 l = 1, ka - 1
1134 CALL clartv( nr, ab( ka1-l, j1+l ), inca,
1135 $ ab( ka-l, j1+l ), inca, rwork( m-kb+j1 ),
1136 $ work( m-kb+j1 ), ka1 )
1142 CALL clar2v( nr, ab( ka1, j1 ), ab( ka1, j1-1 ),
1143 $ ab( ka, j1 ), inca, rwork( m-kb+j1 ),
1144 $ work( m-kb+j1 ), ka1 )
1146 CALL clacgv( nr, work( m-kb+j1 ), ka1 )
1151 DO 670 l = ka - 1, kb - k + 1, -1
1152 nrt = ( j2+l-1 ) / ka1
1153 j1t = j2 - ( nrt-1 )*ka1
1155 $
CALL clartv( nrt, ab( l, j1t ), inca,
1156 $ ab( l+1, j1t-1 ), inca,
1157 $ rwork( m-kb+j1t ), work( m-kb+j1t ),
1165 DO 680 j = j1, j2, ka1
1166 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1167 $ rwork( m-kb+j ), work( m-kb+j ) )
1172 DO 710 k = 1, kb - 1
1173 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1177 DO 700 l = kb - k, 1, -1
1178 nrt = ( j2+l-1 ) / ka1
1179 j1t = j2 - ( nrt-1 )*ka1
1181 $
CALL clartv( nrt, ab( l, j1t ), inca,
1182 $ ab( l+1, j1t-1 ), inca, rwork( j1t ),
1183 $ work( j1t ), ka1 )
1188 DO 720 j = 2, i2 - ka
1189 rwork( j ) = rwork( j+ka )
1190 work( j ) = work( j+ka )
1202 bii =
REAL( BB( 1, I ) )
1203 ab( 1, i ) = (
REAL( AB( 1, I ) ) / BII ) / bii
1204 DO 730 j = i1, i - 1
1205 ab( i-j+1, j ) = ab( i-j+1, j ) / bii
1207 DO 740 j = i + 1, min( n, i+ka )
1208 ab( j-i+1, i ) = ab( j-i+1, i ) / bii
1210 DO 770 k = i + 1, i + kbt
1211 DO 750 j = k, i + kbt
1212 ab( j-k+1, k ) = ab( j-k+1, k ) -
1213 $ bb( j-i+1, i )*conjg( ab( k-i+1,
1214 $ i ) ) - conjg( bb( k-i+1, i ) )*
1215 $ ab( j-i+1, i ) +
REAL( AB( 1, I ) )*
1216 $ bb( j-i+1, i )*conjg( bb( k-i+1,
1219 DO 760 j = i + kbt + 1, min( n, i+ka )
1220 ab( j-k+1, k ) = ab( j-k+1, k ) -
1221 $ conjg( bb( k-i+1, i ) )*
1226 DO 780 k = i + 1, min( j+ka, i+kbt )
1227 ab( k-j+1, j ) = ab( k-j+1, j ) -
1228 $ bb( k-i+1, i )*ab( i-j+1, j )
1236 CALL csscal( nx, one / bii, x( 1, i ), 1 )
1238 $
CALL cgerc( nx, kbt, -cone, x( 1, i ), 1, bb( 2, i ),
1239 $ 1, x( 1, i+1 ), ldx )
1244 ra1 = ab( i-i1+1, i1 )
1250 DO 840 k = 1, kb - 1
1256 IF( i+k-ka1.GT.0 .AND. i+k.LT.m )
THEN
1260 CALL clartg( ab( ka1-k, i+k-ka ), ra1,
1261 $ rwork( i+k-ka ), work( i+k-ka ), ra )
1266 t = -bb( k+1, i )*ra1
1267 work( m-kb+i+k ) = rwork( i+k-ka )*t -
1268 $ conjg( work( i+k-ka ) )*
1270 ab( ka1, i+k-ka ) = work( i+k-ka )*t +
1271 $ rwork( i+k-ka )*ab( ka1, i+k-ka )
1275 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1276 nr = ( j2+ka-1 ) / ka1
1277 j1 = j2 - ( nr-1 )*ka1
1279 j2t = min( j2, i-2*ka+k-1 )
1283 nrt = ( j2t+ka-1 ) / ka1
1284 DO 800 j = j1, j2t, ka1
1289 work( j ) = work( j )*ab( ka1, j-1 )
1290 ab( ka1, j-1 ) = rwork( j )*ab( ka1, j-1 )
1297 $
CALL clargv( nrt, ab( ka1, j1 ), inca, work( j1 ), ka1,
1298 $ rwork( j1 ), ka1 )
1303 DO 810 l = 1, ka - 1
1304 CALL clartv( nr, ab( l+1, j1 ), inca, ab( l+2, j1-1 ),
1305 $ inca, rwork( j1 ), work( j1 ), ka1 )
1311 CALL clar2v( nr, ab( 1, j1 ), ab( 1, j1-1 ),
1312 $ ab( 2, j1-1 ), inca, rwork( j1 ),
1315 CALL clacgv( nr, work( j1 ), ka1 )
1320 DO 820 l = ka - 1, kb - k + 1, -1
1321 nrt = ( j2+l-1 ) / ka1
1322 j1t = j2 - ( nrt-1 )*ka1
1324 $
CALL clartv( nrt, ab( ka1-l+1, j1t-ka1+l ), inca,
1325 $ ab( ka1-l, j1t-ka1+l ), inca,
1326 $ rwork( j1t ), work( j1t ), ka1 )
1333 DO 830 j = j1, j2, ka1
1334 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1335 $ rwork( j ), conjg( work( j ) ) )
1341 IF( i2.GT.0 .AND. kbt.GT.0 )
THEN
1346 work( m-kb+i+kbt ) = -bb( kbt+1, i )*ra1
1350 DO 880 k = kb, 1, -1
1352 j2 = i + k + 1 - max( 2, k+i0-m )*ka1
1354 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1359 DO 850 l = kb - k, 1, -1
1360 nrt = ( j2+ka+l-1 ) / ka1
1361 j1t = j2 - ( nrt-1 )*ka1
1363 $
CALL clartv( nrt, ab( ka1-l+1, j1t+l-1 ), inca,
1364 $ ab( ka1-l, j1t+l-1 ), inca,
1365 $ rwork( m-kb+j1t+ka ),
1366 $ work( m-kb+j1t+ka ), ka1 )
1368 nr = ( j2+ka-1 ) / ka1
1369 j1 = j2 - ( nr-1 )*ka1
1370 DO 860 j = j1, j2, ka1
1371 work( m-kb+j ) = work( m-kb+j+ka )
1372 rwork( m-kb+j ) = rwork( m-kb+j+ka )
1374 DO 870 j = j1, j2, ka1
1379 work( m-kb+j ) = work( m-kb+j )*ab( ka1, j-1 )
1380 ab( ka1, j-1 ) = rwork( m-kb+j )*ab( ka1, j-1 )
1383 IF( i+k.GT.ka1 .AND. k.LE.kbt )
1384 $ work( m-kb+i+k-ka ) = work( m-kb+i+k )
1388 DO 920 k = kb, 1, -1
1389 j2 = i + k + 1 - max( 1, k+i0-m )*ka1
1390 nr = ( j2+ka-1 ) / ka1
1391 j1 = j2 - ( nr-1 )*ka1
1397 CALL clargv( nr, ab( ka1, j1 ), inca, work( m-kb+j1 ),
1398 $ ka1, rwork( m-kb+j1 ), ka1 )
1402 DO 890 l = 1, ka - 1
1403 CALL clartv( nr, ab( l+1, j1 ), inca, ab( l+2, j1-1 ),
1404 $ inca, rwork( m-kb+j1 ), work( m-kb+j1 ),
1411 CALL clar2v( nr, ab( 1, j1 ), ab( 1, j1-1 ),
1412 $ ab( 2, j1-1 ), inca, rwork( m-kb+j1 ),
1413 $ work( m-kb+j1 ), ka1 )
1415 CALL clacgv( nr, work( m-kb+j1 ), ka1 )
1420 DO 900 l = ka - 1, kb - k + 1, -1
1421 nrt = ( j2+l-1 ) / ka1
1422 j1t = j2 - ( nrt-1 )*ka1
1424 $
CALL clartv( nrt, ab( ka1-l+1, j1t-ka1+l ), inca,
1425 $ ab( ka1-l, j1t-ka1+l ), inca,
1426 $ rwork( m-kb+j1t ), work( m-kb+j1t ),
1434 DO 910 j = j1, j2, ka1
1435 CALL crot( nx, x( 1, j ), 1, x( 1, j-1 ), 1,
1436 $ rwork( m-kb+j ), conjg( work( m-kb+j ) ) )
1441 DO 940 k = 1, kb - 1
1442 j2 = i + k + 1 - max( 1, k+i0-m+1 )*ka1
1446 DO 930 l = kb - k, 1, -1
1447 nrt = ( j2+l-1 ) / ka1
1448 j1t = j2 - ( nrt-1 )*ka1
1450 $
CALL clartv( nrt, ab( ka1-l+1, j1t-ka1+l ), inca,
1451 $ ab( ka1-l, j1t-ka1+l ), inca,
1452 $ rwork( j1t ), work( j1t ), ka1 )
1457 DO 950 j = 2, i2 - ka
1458 rwork( j ) = rwork( j+ka )
1459 work( j ) = work( j+ka )
subroutine clargv(N, X, INCX, Y, INCY, C, INCC)
CLARGV generates a vector of plane rotations with real cosines and complex sines. ...
subroutine clar2v(N, X, Y, Z, INCX, C, S, INCC)
CLAR2V applies a vector of plane rotations with real cosines and complex sines from both sides to a s...
subroutine clartg(F, G, CS, SN, R)
CLARTG generates a plane rotation with real cosine and complex sine.
subroutine clartv(N, X, INCX, Y, INCY, C, S, INCC)
CLARTV applies a vector of plane rotations with real cosines and complex sines to the elements of a p...
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine cgerc(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
CGERC
subroutine claset(UPLO, M, N, ALPHA, BETA, A, LDA)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
subroutine chbgst(VECT, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, X, LDX, WORK, RWORK, INFO)
CHBGST
subroutine clacgv(N, X, INCX)
CLACGV conjugates a complex vector.
subroutine cgeru(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
CGERU
subroutine csscal(N, SA, CX, INCX)
CSSCAL
subroutine crot(N, CX, INCX, CY, INCY, C, S)
CROT applies a plane rotation with real cosine and complex sine to a pair of complex vectors...