Routine: PDLAEBZ()  File: SRC\pdstebz.f

 
 
# lines: 332
  # code: 332
  # comment: 0
  # blank:0
# Variables:35
# Callers:1
# Callings:2
# Words:199
# Keywords:118
 

 

..
     .. Array Arguments ..
     ..
  Purpose
  =======
  PDLAEBZ contains the iteration loop which computes the eigenvalues
  contained in the input intervals [ INTVL(2*j-1), INTVL(2*j) ] where
  j = 1,...,MINP. It uses and computes the function N(w), which is
  the count of eigenvalues of a symmetric tridiagonal matrix less than
  or equal to its argument w.
  This is a ScaLAPACK internal subroutine and arguments are not
  checked for unreasonable values.
  Arguments
  =========
  IJOB    (input) INTEGER
          Specifies the computation done by PDLAEBZ
          = 0 : Find an interval with desired values of N(w) at the
                endpoints of the interval.
          = 1 : Find a floating point number contained in the initial
                interval with a desired value of N(w).
          = 2 : Perform bisection iteration to find eigenvalues of T.
  N       (input) INTEGER
          The order of the tridiagonal matrix T. N >= 1.
  MMAX    (input) INTEGER
          The maximum number of intervals that may be generated. If
          more than MMAX intervals are generated, then PDLAEBZ will
          quit with INFO = MMAX+1.
  MINP    (input) INTEGER
          The initial number of intervals. MINP <= MMAX.
  ABSTOL  (input) DOUBLE PRECISION
          The minimum (absolute) width of an interval. When an interval
          is narrower than ABSTOL, or than RELTOL times the larger (in
          magnitude) endpoint, then it is considered to be sufficiently
          small, i.e., converged.
          This must be at least zero.
  RELTOL  (input) DOUBLE PRECISION
          The minimum relative width of an interval. When an interval
          is narrower than ABSTOL, or than RELTOL times the larger (in
          magnitude) endpoint, then it is considered to be sufficiently
          small, i.e., converged.
          Note : This should be at least radix*machine epsilon.
  PIVMIN  (input) DOUBLE PRECISION
          The minimum absolute of a "pivot" in the "paranoid"
          implementation of the Sturm sequence loop. This must be at
          least max_j |e(j)^2| *safe_min, and at least safe_min, where
          safe_min is at least the smallest number that can divide 1.0
          without overflow.
          See PDLAPDCT for the "paranoid" implementation of the Sturm
          sequence loop.
  D       (input) DOUBLE PRECISION array, dimension (2*N - 1)
          Contains the diagonals and the squares of the off-diagonal
          elements of the tridiagonal matrix T. These elements are
          assumed to be interleaved in memory for better cache
          performance. The diagonal entries of T are in the entries
          D(1),D(3),...,D(2*N-1), while the squares of the off-diagonal
          entries are D(2),D(4),...,D(2*N-2). To avoid overflow, the
          matrix must be scaled so that its largest entry is no greater
          than overflow**(1/2) * underflow**(1/4) in absolute value,
          and for greatest accuracy, it should not be much smaller
          than that.
  NVAL    (input/output) INTEGER array, dimension (4)
          If IJOB = 0, the desired values of N(w) are in NVAL(1) and
                       NVAL(2).
          If IJOB = 1, NVAL(2) is the desired value of N(w).
          If IJOB = 2, not referenced.
          This array will, in general, be reordered on output.
  INTVL   (input/output) DOUBLE PRECISION array, dimension (2*MMAX)
          The endpoints of the intervals. INTVL(2*j-1) is the left
          endpoint of the j-th interval, and INTVL(2*j) is the right
          endpoint of the j-th interval. The input intervals will,
          in general, be modified, split and reordered by the
          calculation.
          On input, INTVL contains the MINP input intervals.
          On output, INTVL contains the converged intervals.
  INTVLCT (input/output) INTEGER array, dimension (2*MMAX)
          The counts at the endpoints of the intervals. INTVLCT(2*j-1)
          is the count at the left endpoint of the j-th interval, i.e.,
          the function value N(INTVL(2*j-1)), and INTVLCT(2*j) is the
          count at the right endpoint of the j-th interval.
          On input, INTVLCT contains the counts at the endpoints of
          the MINP input intervals.
          On output, INTVLCT contains the counts at the endpoints of
          the converged intervals.
  MOUT    (output) INTEGER
          The number of intervals output.
  LSAVE   (output) DOUBLE PRECISION
          If IJOB = 0 or 2, not referenced.
          If IJOB = 1, this is the largest floating point number
          encountered which has count N(w) = NVAL(1).
  IEFLAG  (input) INTEGER
          A flag which indicates whether N(w) should be speeded up by
          exploiting IEEE Arithmetic.
  INFO    (output) INTEGER
          = 0        : All intervals converged.
          = 1 - MMAX : The last INFO intervals did not converge.
          = MMAX + 1 : More than MMAX intervals were generated.
  =====================================================================
     .. Intrinsic Functions ..

 
Display dynamic version Find AutoScroll Reload FontSize: - + Hide Comments Hide Blanks Frame FullScreen MailPrint

 
001        SUBROUTINE PDLAEBZ( IJOB , N , MMAX , MINP , ABSTOL , RELTOL , PIVMIN ,
002       $D , NVAL , INTVL , INTVLCT , MOUT , LSAVE , IEFLAG ,
003       $INFO )
004  
005  *     -- ScaLAPACK routine(version 1.7) --
006  *     University of Tennessee , Knoxville , Oak Ridge National Laboratory ,
007  *     and University of California , Berkeley.
008  *     November 15 , 1997
009  
010  *     .. Scalar Arguments ..
011        INTEGER IEFLAG , IJOB , INFO , MINP , MMAX , MOUT , N
012        DOUBLE PRECISION ABSTOL , LSAVE , PIVMIN , RELTOL
013        INTRINSIC ABS , INT , LOG , MAX , MIN
014  *     ..
015  *     .. External Subroutines ..
016        EXTERNAL PDLAECV , PDLAIECTB , PDLAIECTL , PDLAPDCT  
017  *     ..
018  *     .. Parameters ..
019        DOUBLE PRECISION ZERO , TWO , HALF
020        PARAMETER( ZERO = 0.0D + 0 , TWO = 2.0D + 0 ,
021       $HALF = 1.0D + 0 / TWO )
022  *     ..
023  *     .. Local Scalars ..
024        INTEGER I , ITMAX , J , K , KF , KL , KLNEW , L , LCNT , LREQ ,
025       $NALPHA , NBETA , NMID , RCNT , RREQ
026        DOUBLE PRECISION ALPHA , BETA , MID
027  *     ..
028  *     .. Executable Statements ..
029  
030        KF = 1
031        KL = MINP + 1
032        INFO = 0
033        IF( INTVL( 2 ) - INTVL( 1 ).LE.ZERO ) THEN
034            INFO = MINP
035            MOUT = KF
036            RETURN
037        END IF
038        IF( IJOB.EQ.0 ) THEN
039  
040  *         Check if some input intervals have "converged"
041  
042            CALL PDLAECV ( 0 , KF , KL , INTVL , INTVLCT , NVAL ,
043       $    MAX( ABSTOL , PIVMIN ) , RELTOL )
044            IF( KF.GE.KL )
045       $        GO TO 60
046  
047  *             Compute upper bound on number of iterations needed
048  
049                ITMAX = INT(( LOG( INTVL( 2 ) - INTVL( 1 ) + PIVMIN ) -
050       $        LOG( PIVMIN ) ) / LOG( TWO ) ) + 2
051  
052  *             Iteration Loop
053  
054                DO 20 I = 1 , ITMAX
055                    KLNEW = KL
056                    DO 10 J = KF , KL - 1
057                        K = 2*J
058  
059  *                     Bisect the interval and find the count at that point
060  
061                        MID = HALF*( INTVL( K - 1 ) + INTVL( K ) )
062                        IF( IEFLAG.EQ.0 ) THEN
063                            CALL PDLAPDCT ( MID , N , D , PIVMIN , NMID )
064                        ELSE IF( IEFLAG.EQ.1 ) THEN
065                            CALL PDLAIECTB( MID , N , D , NMID )
066                        ELSE
067                            CALL PDLAIECTL( MID , N , D , NMID )
068                        END IF
069                        LREQ = NVAL( K - 1 )
070                        RREQ = NVAL( K )
071                        IF( KL.EQ.1 )
072       $                    NMID = MIN( INTVLCT( K ) ,
073       $                    MAX( INTVLCT( K - 1 ) , NMID ) )
074                            IF( NMID.LE.NVAL( K - 1 ) ) THEN
075                                INTVL( K - 1 ) = MID
076                                INTVLCT( K - 1 ) = NMID
077                            END IF
078                            IF( NMID.GE.NVAL( K ) ) THEN
079                                INTVL( K ) = MID
080                                INTVLCT( K ) = NMID
081                            END IF
082                            IF( NMID.GT.LREQ .AND. NMID.LT.RREQ ) THEN
083                                L = 2*KLNEW
084                                INTVL( L - 1 ) = MID
085                                INTVL( L ) = INTVL( K )
086                                INTVLCT( L - 1 ) = NVAL( K )
087                                INTVLCT( L ) = INTVLCT( K )
088                                INTVL( K ) = MID
089                                INTVLCT( K ) = NVAL( K - 1 )
090                                NVAL( L - 1 ) = NVAL( K )
091                                NVAL( L ) = NVAL( L - 1 )
092                                NVAL( K ) = NVAL( K - 1 )
093                                KLNEW = KLNEW + 1
094                            END IF
095     10             CONTINUE
096                    KL = KLNEW
097                    CALL PDLAECV ( 0 , KF , KL , INTVL , INTVLCT , NVAL ,
098       $            MAX( ABSTOL , PIVMIN ) , RELTOL )
099                    IF( KF.GE.KL )
100       $                GO TO 60
101     20         CONTINUE
102            ELSE IF( IJOB.EQ.1 ) THEN
103                ALPHA = INTVL( 1 )
104                BETA = INTVL( 2 )
105                NALPHA = INTVLCT( 1 )
106                NBETA = INTVLCT( 2 )
107                LSAVE = ALPHA
108                LREQ = NVAL( 1 )
109                RREQ = NVAL( 2 )
110     30 CONTINUE
111        IF( NBETA.NE.RREQ .AND. BETA - ALPHA.GT.
112       $    MAX( ABSTOL , RELTOL*MAX( ABS( ALPHA ) , ABS( BETA ) ) ) )
113       $    THEN
114  
115  *         Bisect the interval and find the count at that point
116  
117            MID = HALF*( ALPHA + BETA )
118            IF( IEFLAG.EQ.0 ) THEN
119                CALL PDLAPDCT ( MID , N , D , PIVMIN , NMID )
120            ELSE IF( IEFLAG.EQ.1 ) THEN
121                CALL PDLAIECTB( MID , N , D , NMID )
122            ELSE
123                CALL PDLAIECTL( MID , N , D , NMID )
124            END IF
125            NMID = MIN( NBETA , MAX( NALPHA , NMID ) )
126            IF( NMID.GE.RREQ ) THEN
127                BETA = MID
128                NBETA = NMID
129            ELSE
130                ALPHA = MID
131                NALPHA = NMID
132                IF( NMID.EQ.LREQ )
133       $            LSAVE = ALPHA
134                END IF
135                GO TO 30
136            END IF
137            KL = KF
138            INTVL( 1 ) = ALPHA
139            INTVL( 2 ) = BETA
140            INTVLCT( 1 ) = NALPHA
141            INTVLCT( 2 ) = NBETA
142        ELSE IF( IJOB.EQ.2 ) THEN
143  
144  *         Check if some input intervals have "converged"
145  
146            CALL PDLAECV ( 1 , KF , KL , INTVL , INTVLCT , NVAL ,
147       $    MAX( ABSTOL , PIVMIN ) , RELTOL )
148            IF( KF.GE.KL )
149       $        GO TO 60
150  
151  *             Compute upper bound on number of iterations needed
152  
153                ITMAX = INT(( LOG( INTVL( 2 ) - INTVL( 1 ) + PIVMIN ) -
154       $        LOG( PIVMIN ) ) / LOG( TWO ) ) + 2
155  
156  *             Iteration Loop
157  
158                DO 50 I = 1 , ITMAX
159                    KLNEW = KL
160                    DO 40 J = KF , KL - 1
161                        K = 2*J
162                        MID = HALF*( INTVL( K - 1 ) + INTVL( K ) )
163                        IF( IEFLAG.EQ.0 ) THEN
164                            CALL PDLAPDCT ( MID , N , D , PIVMIN , NMID )
165                        ELSE IF( IEFLAG.EQ.1 ) THEN
166                            CALL PDLAIECTB( MID , N , D , NMID )
167                        ELSE
168                            CALL PDLAIECTL( MID , N , D , NMID )
169                        END IF
170                        LCNT = INTVLCT( K - 1 )
171                        RCNT = INTVLCT( K )
172                        NMID = MIN( RCNT , MAX( LCNT , NMID ) )
173  
174  *                     Form New Interval(s)
175  
176                        IF( NMID.EQ.LCNT ) THEN
177                            INTVL( K - 1 ) = MID
178                        ELSE IF( NMID.EQ.RCNT ) THEN
179                            INTVL( K ) = MID
180                        ELSE IF( KLNEW.LT.MMAX + 1 ) THEN
181                            L = 2*KLNEW
182                            INTVL( L - 1 ) = MID
183                            INTVL( L ) = INTVL( K )
184                            INTVLCT( L - 1 ) = NMID
185                            INTVLCT( L ) = INTVLCT( K )
186                            INTVL( K ) = MID
187                            INTVLCT( K ) = NMID
188                            KLNEW = KLNEW + 1
189                        ELSE
190                            INFO = MMAX + 1
191                            RETURN
192                        END IF
193     40             CONTINUE
194                    KL = KLNEW
195                    CALL PDLAECV ( 1 , KF , KL , INTVL , INTVLCT , NVAL ,
196       $            MAX( ABSTOL , PIVMIN ) , RELTOL )
197                    IF( KF.GE.KL )
198       $                GO TO 60
199     50         CONTINUE
200            END IF
201     60 CONTINUE
202        INFO = MAX( KL - KF , 0 )
203        MOUT = KL - 1
204        RETURN
205  
206  *     End of PDLAEBZ
207  
208        END
209