Routine: PSLAEBZ()  File: SRC\psstebz.f

 
 
# lines: 326
  # code: 326
  # comment: 0
  # blank:0
# Variables:35
# Callers:1
# Callings:2
# Words:177
# Keywords:106
 

 

..
     .. Array Arguments ..
     ..
  Purpose
  =======
  PSLAEBZ 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 PSLAEBZ
          = 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 PSLAEBZ will
          quit with INFO = MMAX+1.
  MINP    (input) INTEGER
          The initial number of intervals. MINP <= MMAX.
  ABSTOL  (input) REAL
          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) REAL
          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) REAL
          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 PSLAPDCT for the "paranoid" implementation of the Sturm
          sequence loop.
  D       (input) REAL 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) REAL 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) REAL
          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 PSLAEBZ( 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        REAL ABSTOL , LSAVE , PIVMIN , RELTOL
013        INTRINSIC ABS , INT , LOG , MAX , MIN
014  *     ..
015  *     .. External Subroutines ..
016        EXTERNAL PSLAECV , PSLAIECT , PSLAPDCT  
017  *     ..
018  *     .. Parameters ..
019        REAL ZERO , TWO , HALF
020        PARAMETER( ZERO = 0.0E + 0 , TWO = 2.0E + 0 ,
021       $HALF = 1.0E + 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        REAL 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 PSLAECV ( 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 PSLAPDCT ( MID , N , D , PIVMIN , NMID )
064                        ELSE
065                            CALL PSLAIECT( MID , N , D , NMID )
066                        END IF
067                        LREQ = NVAL( K - 1 )
068                        RREQ = NVAL( K )
069                        IF( KL.EQ.1 )
070       $                    NMID = MIN( INTVLCT( K ) ,
071       $                    MAX( INTVLCT( K - 1 ) , NMID ) )
072                            IF( NMID.LE.NVAL( K - 1 ) ) THEN
073                                INTVL( K - 1 ) = MID
074                                INTVLCT( K - 1 ) = NMID
075                            END IF
076                            IF( NMID.GE.NVAL( K ) ) THEN
077                                INTVL( K ) = MID
078                                INTVLCT( K ) = NMID
079                            END IF
080                            IF( NMID.GT.LREQ .AND. NMID.LT.RREQ ) THEN
081                                L = 2*KLNEW
082                                INTVL( L - 1 ) = MID
083                                INTVL( L ) = INTVL( K )
084                                INTVLCT( L - 1 ) = NVAL( K )
085                                INTVLCT( L ) = INTVLCT( K )
086                                INTVL( K ) = MID
087                                INTVLCT( K ) = NVAL( K - 1 )
088                                NVAL( L - 1 ) = NVAL( K )
089                                NVAL( L ) = NVAL( L - 1 )
090                                NVAL( K ) = NVAL( K - 1 )
091                                KLNEW = KLNEW + 1
092                            END IF
093     10             CONTINUE
094                    KL = KLNEW
095                    CALL PSLAECV ( 0 , KF , KL , INTVL , INTVLCT , NVAL ,
096       $            MAX( ABSTOL , PIVMIN ) , RELTOL )
097                    IF( KF.GE.KL )
098       $                GO TO 60
099     20         CONTINUE
100            ELSE IF( IJOB.EQ.1 ) THEN
101                ALPHA = INTVL( 1 )
102                BETA = INTVL( 2 )
103                NALPHA = INTVLCT( 1 )
104                NBETA = INTVLCT( 2 )
105                LSAVE = ALPHA
106                LREQ = NVAL( 1 )
107                RREQ = NVAL( 2 )
108     30 CONTINUE
109        IF( NBETA.NE.RREQ .AND. BETA - ALPHA.GT.
110       $    MAX( ABSTOL , RELTOL*MAX( ABS( ALPHA ) , ABS( BETA ) ) ) )
111       $    THEN
112  
113  *         Bisect the interval and find the count at that point
114  
115            MID = HALF*( ALPHA + BETA )
116            IF( IEFLAG.EQ.0 ) THEN
117                CALL PSLAPDCT ( MID , N , D , PIVMIN , NMID )
118            ELSE
119                CALL PSLAIECT( MID , N , D , NMID )
120            END IF
121            NMID = MIN( NBETA , MAX( NALPHA , NMID ) )
122            IF( NMID.GE.RREQ ) THEN
123                BETA = MID
124                NBETA = NMID
125            ELSE
126                ALPHA = MID
127                NALPHA = NMID
128                IF( NMID.EQ.LREQ )
129       $            LSAVE = ALPHA
130                END IF
131                GO TO 30
132            END IF
133            KL = KF
134            INTVL( 1 ) = ALPHA
135            INTVL( 2 ) = BETA
136            INTVLCT( 1 ) = NALPHA
137            INTVLCT( 2 ) = NBETA
138        ELSE IF( IJOB.EQ.2 ) THEN
139  
140  *         Check if some input intervals have "converged"
141  
142            CALL PSLAECV ( 1 , KF , KL , INTVL , INTVLCT , NVAL ,
143       $    MAX( ABSTOL , PIVMIN ) , RELTOL )
144            IF( KF.GE.KL )
145       $        GO TO 60
146  
147  *             Compute upper bound on number of iterations needed
148  
149                ITMAX = INT(( LOG( INTVL( 2 ) - INTVL( 1 ) + PIVMIN ) -
150       $        LOG( PIVMIN ) ) / LOG( TWO ) ) + 2
151  
152  *             Iteration Loop
153  
154                DO 50 I = 1 , ITMAX
155                    KLNEW = KL
156                    DO 40 J = KF , KL - 1
157                        K = 2*J
158                        MID = HALF*( INTVL( K - 1 ) + INTVL( K ) )
159                        IF( IEFLAG.EQ.0 ) THEN
160                            CALL PSLAPDCT ( MID , N , D , PIVMIN , NMID )
161                        ELSE
162                            CALL PSLAIECT( MID , N , D , NMID )
163                        END IF
164                        LCNT = INTVLCT( K - 1 )
165                        RCNT = INTVLCT( K )
166                        NMID = MIN( RCNT , MAX( LCNT , NMID ) )
167  
168  *                     Form New Interval(s)
169  
170                        IF( NMID.EQ.LCNT ) THEN
171                            INTVL( K - 1 ) = MID
172                        ELSE IF( NMID.EQ.RCNT ) THEN
173                            INTVL( K ) = MID
174                        ELSE IF( KLNEW.LT.MMAX + 1 ) THEN
175                            L = 2*KLNEW
176                            INTVL( L - 1 ) = MID
177                            INTVL( L ) = INTVL( K )
178                            INTVLCT( L - 1 ) = NMID
179                            INTVLCT( L ) = INTVLCT( K )
180                            INTVL( K ) = MID
181                            INTVLCT( K ) = NMID
182                            KLNEW = KLNEW + 1
183                        ELSE
184                            INFO = MMAX + 1
185                            RETURN
186                        END IF
187     40             CONTINUE
188                    KL = KLNEW
189                    CALL PSLAECV ( 1 , KF , KL , INTVL , INTVLCT , NVAL ,
190       $            MAX( ABSTOL , PIVMIN ) , RELTOL )
191                    IF( KF.GE.KL )
192       $                GO TO 60
193     50         CONTINUE
194            END IF
195     60 CONTINUE
196        INFO = MAX( KL - KF , 0 )
197        MOUT = KL - 1
198        RETURN
199  
200  *     End of PSLAEBZ
201  
202        END
203