Previous: qzvec Up: ../eispad.html Next: rebak
SUBROUTINE RATQR(N,EPS1,D,E,E2,M,W,IND,BD,TYPE,IDEF,IERR) C INTEGER I,J,K,M,N,II,JJ,K1,IDEF,IERR,JDEF DOUBLE PRECISION D(N),E(N),E2(N),W(N),BD(N) DOUBLE PRECISION F,P,Q,R,S,EP,QP,ERR,TOT,EPS1,DELTA,EPSLON INTEGER IND(N) LOGICAL TYPE C C THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE RATQR, C NUM. MATH. 11, 264-272(1968) BY REINSCH AND BAUER. C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 257-265(1971). C C THIS SUBROUTINE FINDS THE ALGEBRAICALLY SMALLEST OR LARGEST C EIGENVALUES OF A SYMMETRIC TRIDIAGONAL MATRIX BY THE C RATIONAL QR METHOD WITH NEWTON CORRECTIONS. C C ON INPUT C C N IS THE ORDER OF THE MATRIX. C C EPS1 IS A THEORETICAL ABSOLUTE ERROR TOLERANCE FOR THE C COMPUTED EIGENVALUES. IF THE INPUT EPS1 IS NON-POSITIVE, C OR INDEED SMALLER THAN ITS DEFAULT VALUE, IT IS RESET C AT EACH ITERATION TO THE RESPECTIVE DEFAULT VALUE, C NAMELY, THE PRODUCT OF THE RELATIVE MACHINE PRECISION C AND THE MAGNITUDE OF THE CURRENT EIGENVALUE ITERATE. C THE THEORETICAL ABSOLUTE ERROR IN THE K-TH EIGENVALUE C IS USUALLY NOT GREATER THAN K TIMES EPS1. C C D CONTAINS THE DIAGONAL ELEMENTS OF THE INPUT MATRIX. C C E CONTAINS THE SUBDIAGONAL ELEMENTS OF THE INPUT MATRIX C IN ITS LAST N-1 POSITIONS. E(1) IS ARBITRARY. C C E2 CONTAINS THE SQUARES OF THE CORRESPONDING ELEMENTS OF E. C E2(1) IS ARBITRARY. C C M IS THE NUMBER OF EIGENVALUES TO BE FOUND. C C IDEF SHOULD BE SET TO 1 IF THE INPUT MATRIX IS KNOWN TO BE C POSITIVE DEFINITE, TO -1 IF THE INPUT MATRIX IS KNOWN TO C BE NEGATIVE DEFINITE, AND TO 0 OTHERWISE. C C TYPE SHOULD BE SET TO .TRUE. IF THE SMALLEST EIGENVALUES C ARE TO BE FOUND, AND TO .FALSE. IF THE LARGEST EIGENVALUES C ARE TO BE FOUND. C C ON OUTPUT C C EPS1 IS UNALTERED UNLESS IT HAS BEEN RESET TO ITS C (LAST) DEFAULT VALUE. C C D AND E ARE UNALTERED (UNLESS W OVERWRITES D). C C ELEMENTS OF E2, CORRESPONDING TO ELEMENTS OF E REGARDED C AS NEGLIGIBLE, HAVE BEEN REPLACED BY ZERO CAUSING THE C MATRIX TO SPLIT INTO A DIRECT SUM OF SUBMATRICES. C E2(1) IS SET TO 0.0D0 IF THE SMALLEST EIGENVALUES HAVE BEEN C FOUND, AND TO 2.0D0 IF THE LARGEST EIGENVALUES HAVE BEEN C FOUND. E2 IS OTHERWISE UNALTERED (UNLESS OVERWRITTEN BY BD). C C W CONTAINS THE M ALGEBRAICALLY SMALLEST EIGENVALUES IN C ASCENDING ORDER, OR THE M LARGEST EIGENVALUES IN C DESCENDING ORDER. IF AN ERROR EXIT IS MADE BECAUSE OF C AN INCORRECT SPECIFICATION OF IDEF, NO EIGENVALUES C ARE FOUND. IF THE NEWTON ITERATES FOR A PARTICULAR C EIGENVALUE ARE NOT MONOTONE, THE BEST ESTIMATE OBTAINED C IS RETURNED AND IERR IS SET. W MAY COINCIDE WITH D. C C IND CONTAINS IN ITS FIRST M POSITIONS THE SUBMATRIX INDICES C ASSOCIATED WITH THE CORRESPONDING EIGENVALUES IN W -- C 1 FOR EIGENVALUES BELONGING TO THE FIRST SUBMATRIX FROM C THE TOP, 2 FOR THOSE BELONGING TO THE SECOND SUBMATRIX, ETC.. C C BD CONTAINS REFINED BOUNDS FOR THE THEORETICAL ERRORS OF THE C CORRESPONDING EIGENVALUES IN W. THESE BOUNDS ARE USUALLY C WITHIN THE TOLERANCE SPECIFIED BY EPS1. BD MAY COINCIDE C WITH E2. C C IERR IS SET TO C ZERO FOR NORMAL RETURN, C 6*N+1 IF IDEF IS SET TO 1 AND TYPE TO .TRUE. C WHEN THE MATRIX IS NOT POSITIVE DEFINITE, OR C IF IDEF IS SET TO -1 AND TYPE TO .FALSE. C WHEN THE MATRIX IS NOT NEGATIVE DEFINITE, C 5*N+K IF SUCCESSIVE ITERATES TO THE K-TH EIGENVALUE C ARE NOT MONOTONE INCREASING, WHERE K REFERS C TO THE LAST SUCH OCCURRENCE. C C NOTE THAT SUBROUTINE TRIDIB IS GENERALLY FASTER AND MORE C ACCURATE THAN RATQR IF THE EIGENVALUES ARE CLUSTERED. 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