Previous: bisect Up: ../eispas.html Next: cbabk2
SUBROUTINE BQR(NM,N,MB,A,T,R,IERR,NV,RV) C INTEGER I,J,K,L,M,N,II,IK,JK,JM,KJ,KK,KM,LL,MB,MK,MN,MZ, X M1,M2,M3,M4,NI,NM,NV,ITS,KJ1,M21,M31,IERR,IMULT REAL A(NM,MB),RV(NV) REAL F,G,Q,R,S,T,TST1,TST2,SCALE,PYTHAG C C THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE BQR, C NUM. MATH. 16, 85-92(1970) BY MARTIN, REINSCH, AND WILKINSON. C HANDBOOK FOR AUTO. COMP., VOL II-LINEAR ALGEBRA, 266-272(1971). C C THIS SUBROUTINE FINDS THE EIGENVALUE OF SMALLEST (USUALLY) C MAGNITUDE OF A REAL SYMMETRIC BAND MATRIX USING THE C QR ALGORITHM WITH SHIFTS OF ORIGIN. CONSECUTIVE CALLS C CAN BE MADE TO FIND FURTHER EIGENVALUES. C C ON INPUT C C NM MUST BE SET TO THE ROW DIMENSION OF TWO-DIMENSIONAL C ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM C DIMENSION STATEMENT. C C N IS THE ORDER OF THE MATRIX. C C MB IS THE (HALF) BAND WIDTH OF THE MATRIX, DEFINED AS THE C NUMBER OF ADJACENT DIAGONALS, INCLUDING THE PRINCIPAL C DIAGONAL, REQUIRED TO SPECIFY THE NON-ZERO PORTION OF THE C LOWER TRIANGLE OF THE MATRIX. C C A CONTAINS THE LOWER TRIANGLE OF THE SYMMETRIC BAND INPUT C MATRIX STORED AS AN N BY MB ARRAY. ITS LOWEST SUBDIAGONAL C IS STORED IN THE LAST N+1-MB POSITIONS OF THE FIRST COLUMN, C ITS NEXT SUBDIAGONAL IN THE LAST N+2-MB POSITIONS OF THE C SECOND COLUMN, FURTHER SUBDIAGONALS SIMILARLY, AND FINALLY C ITS PRINCIPAL DIAGONAL IN THE N POSITIONS OF THE LAST COLUMN. C CONTENTS OF STORAGES NOT PART OF THE MATRIX ARE ARBITRARY. C ON A SUBSEQUENT CALL, ITS OUTPUT CONTENTS FROM THE PREVIOUS C CALL SHOULD BE PASSED. C C T SPECIFIES THE SHIFT (OF EIGENVALUES) APPLIED TO THE DIAGONAL C OF A IN FORMING THE INPUT MATRIX. WHAT IS ACTUALLY DETERMINED C IS THE EIGENVALUE OF A+TI (I IS THE IDENTITY MATRIX) NEAREST C TO T. ON A SUBSEQUENT CALL, THE OUTPUT VALUE OF T FROM THE C PREVIOUS CALL SHOULD BE PASSED IF THE NEXT NEAREST EIGENVALUE C IS SOUGHT. C C R SHOULD BE SPECIFIED AS ZERO ON THE FIRST CALL, AND AS ITS C OUTPUT VALUE FROM THE PREVIOUS CALL ON A SUBSEQUENT CALL. C IT IS USED TO DETERMINE WHEN THE LAST ROW AND COLUMN OF C THE TRANSFORMED BAND MATRIX CAN BE REGARDED AS NEGLIGIBLE. C C NV MUST BE SET TO THE DIMENSION OF THE ARRAY PARAMETER RV C AS DECLARED IN THE CALLING PROGRAM DIMENSION STATEMENT. C C ON OUTPUT C C A CONTAINS THE TRANSFORMED BAND MATRIX. THE MATRIX A+TI C DERIVED FROM THE OUTPUT PARAMETERS IS SIMILAR TO THE C INPUT A+TI TO WITHIN ROUNDING ERRORS. ITS LAST ROW AND C COLUMN ARE NULL (IF IERR IS ZERO). C C T CONTAINS THE COMPUTED EIGENVALUE OF A+TI (IF IERR IS ZERO). C C R CONTAINS THE MAXIMUM OF ITS INPUT VALUE AND THE NORM OF THE C LAST COLUMN OF THE INPUT MATRIX A. C C IERR IS SET TO C ZERO FOR NORMAL RETURN, C N IF THE EIGENVALUE HAS NOT BEEN C DETERMINED AFTER 30 ITERATIONS. C C RV IS A TEMPORARY STORAGE ARRAY OF DIMENSION AT LEAST C (2*MB**2+4*MB-3). THE FIRST (3*MB-2) LOCATIONS CORRESPOND C TO THE ALGOL ARRAY B, THE NEXT (2*MB-1) LOCATIONS CORRESPOND C TO THE ALGOL ARRAY H, AND THE FINAL (2*MB**2-MB) LOCATIONS C CORRESPOND TO THE MB BY (2*MB-1) ALGOL ARRAY U. C C NOTE. FOR A SUBSEQUENT CALL, N SHOULD BE REPLACED BY N-1, BUT C MB SHOULD NOT BE ALTERED EVEN WHEN IT EXCEEDS THE CURRENT N. C C CALLS PYTHAG FOR SQRT(A*A + B*B) . C C QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW, C MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY C C THIS VERSION DATED AUGUST 1983. C C ------------------------------------------------------------------ C