|
|
| |
| # lines: |
372 | | # code: |
372 | | # comment: | 0 | |
# blank: | 0 |
| # Variables: | 20 |
| # Callers: | 2 |
| # Callings: | 0 |
| # Words: | 11 |
| # Keywords: | 8 |
|
|
|
|
|
..
.. Local Scalars ..
..
.. Local Arrays ..
..
.. External Functions ..
..
.. External Subroutines ..
..
.. Intrinsic Functions ..
..
.. Executable Statements ..
Test the input parameters.
Quick return if possible
Get machine constants.
Initialize seed for random number generator SLARNV.
Initialize pointers.
Compute eigenvectors of matrix blocks.
Find starting and ending indices of block nblk.
Compute reorthogonalization criterion and stopping criterion.
Loop through eigenvalues of block nblk.
Skip all the work if the block size is one.
If eigenvalues j and j-1 are too close, add a relatively
small perturbation.
Get random starting vector.
Copy the matrix T so it won't be destroyed in factorization.
Compute LU factors with partial pivoting ( PT = LU )
Update iteration count.
Normalize and scale the righthand side vector Pb.
Solve the system LU = Pb.
Reorthogonalize by modified Gram-Schmidt if eigenvalues are
close enough.
Check the infinity norm of the iterate.
Continue for additional iterations after norm reaches
stopping criterion.
If stopping criterion was not satisfied, update info and
store eigenvector number in array ifail.
Accept iterate as jth eigenvector.
Save the shift to check eigenvalue spacing at next
iteration.
End of SSTEIN2
|
|
|
|
001 SUBROUTINE SSTEIN2( N , D , E , M , W , IBLOCK , ISPLIT , ORFAC , Z , LDZ ,
002 $WORK , IWORK , IFAIL , INFO )
003
004 * -- ScaLAPACK routine(version 1.7) --
005 * University of Tennessee , Knoxville , Oak Ridge National Laboratory ,
006 * and University of California , Berkeley.
007 * May 1 , 1997
008
009 * .. Scalar Arguments ..
010 INTEGER INFO , LDZ , M , N
011 REAL ORFAC
012 * ..
013 * .. Array Arguments ..
014 INTEGER IBLOCK( * ) , IFAIL( * ) , ISPLIT( * ) ,
015 $IWORK( * )
016 REAL D( * ) , E( * ) , W( * ) , WORK( * ) , Z( LDZ , * )
017 * ..
018
019 * Purpose
020 * === ====
021
022 * SSTEIN2 computes the eigenvectors of a real symmetric tridiagonal
023 * matrix T corresponding to specified eigenvalues , using inverse
024 * iteration.
025
026 * The maximum number of iterations allowed for each eigenvector is
027 * specified by an internal parameter MAXITS(currently set to 5).
028
029 * Arguments
030 * === ======
031
032 * N(input) INTEGER
033 * The order of the matrix. N >= 0.
034
035 * D(input) REAL array , dimension(N)
036 * The n diagonal elements of the tridiagonal matrix T.
037
038 * E(input) REAL array , dimension(N)
039 * The(n - 1) subdiagonal elements of the tridiagonal matrix
040 * T , in elements 1 to N - 1. E(N) need not be set.
041
042 * M(input) INTEGER
043 * The number of eigenvectors to be found. 0 <= M <= N.
044
045 * W(input) REAL array , dimension(N)
046 * The first M elements of W contain the eigenvalues for
047 * which eigenvectors are to be computed. The eigenvalues
048 * should be grouped by split - off block and ordered from
049 * smallest to largest within the block.( The output array
050 * W from SSTEBZ with ORDER = 'B' is expected here. )
051
052 * IBLOCK(input) INTEGER array , dimension(N)
053 * The submatrix indices associated with the corresponding
054 * eigenvalues in W ; IBLOCK(i) = 1 if eigenvalue W(i) belongs to
055 * the first submatrix from the top , = 2 if W(i) belongs to
056 * the second submatrix , etc.( The output array IBLOCK
057 * from SSTEBZ is expected here. )
058
059 * ISPLIT(input) INTEGER array , dimension(N)
060 * The splitting points , at which T breaks up into submatrices.
061 * The first submatrix consists of rows / columns 1 to
062 * ISPLIT( 1 ) , the second of rows / columns ISPLIT( 1 ) + 1
063 * through ISPLIT( 2 ) , etc.
064 * ( The output array ISPLIT from SSTEBZ is expected here. )
065
066 * ORFAC(input) REAL
067 * ORFAC specifies which eigenvectors should be
068 * orthogonalized. Eigenvectors that correspond to eigenvalues
069 * which are within ORFAC*||T|| of each other are to be
070 * orthogonalized.
071
072 * Z(output) REAL array , dimension(LDZ , M)
073 * The computed eigenvectors. The eigenvector associated
074 * with the eigenvalue W(i) is stored in the i - th column of
075 * Z. Any vector which fails to converge is set to its current
076 * iterate after MAXITS iterations.
077
078 * LDZ(input) INTEGER
079 * The leading dimension of the array Z. LDZ >= max(1 , N).
080
081 * WORK(workspace) REAL array , dimension(5*N)
082
083 * IWORK(workspace) INTEGER array , dimension(N)
084
085 * IFAIL(output) INTEGER array , dimension(M)
086 * On normal exit , all elements of IFAIL are zero.
087 * If one or more eigenvectors fail to converge after
088 * MAXITS iterations , then their indices are stored in
089 * array IFAIL.
090
091 * INFO(output) INTEGER
092 * = 0 : successful exit.
093 * < 0 : if INFO = - i , the i - th argument had an illegal value
094 * > 0 : if INFO = i , then i eigenvectors failed to converge
095 * in MAXITS iterations. Their indices are stored in
096 * array IFAIL.
097
098 * Internal Parameters
099 * === ================
100
101 * MAXITS INTEGER , default = 5
102 * The maximum number of iterations performed.
103
104 * EXTRA INTEGER , default = 2
105 * The number of iterations performed after norm growth
106 * criterion is satisfied , should be at least 1.
107
108 * === ==================================================================
109
110 * .. Parameters ..
111 REAL ZERO , ONE , TEN , ODM1
112 PARAMETER( ZERO = 0.0E + 0 , ONE = 1.0E + 0 , TEN = 1.0E + 1 ,
113 $ODM1 = 1.0E - 1 )
114 INTEGER MAXITS , EXTRA
115 PARAMETER( MAXITS = 5 , EXTRA = 2 )
116 END25
0
|
|
Variables in Routine SSTEIN2()
| Summary Report |
| Data Type | Quantity | Size(byte) |
| INTEGER | 10 | 40 |
| REAL | 10 | 40 |
| TOTAL | 20 | 80 |
List of Variables
INTEGER
| EXTRA | IBLOCK( * ) | IFAIL( * ) | INFO | ISPLIT( * ) |
| IWORK( * ) | LDZ | M | MAXITS | N |
REAL
| D( * ) | E( * ) | ODM1 | ONE | ORFAC |
| TEN | W( * ) | WORK( * ) | Z( LDZ, * ) | ZERO |
|
Analysis elements of the routine SSTEIN2() Put the mouse over each element to display detailed matching information
Assigned variables |
| | | EXTRA , INFO , LDZ , M , MAXITS , N , ODM1 , ONE , TEN , ZERO |
|
Active variables |
| | | D , E , EXTRA , IBLOCK , IFAIL , INFO , ISPLIT , IWORK , LDZ , M , MAXITS , N , ODM1 , one , ORFAC , TEN , W , WORK , Z , zero |
|
Accessed arrays [ array name : associated index ] |
| | D | : * |
| | E | : * , N |
| | IBLOCK | : * , i |
| | IFAIL | : * |
| | ISPLIT | : * , 1 , 2 |
| | IWORK | : * |
| | W | : * , i , i , i |
| | WORK | : * |
| | Z | : LDZ, * |
|
Conditional statements [ statement : associated predicate ] |
| | for | : ( each eigenvector is ) |
| | if | : ( eigenvalue W(i) belongs to ) , ( W(i) belongs to ) , ( one or more eigenvectors fail to converge after ) , ( INFO = - i , the i - th argument had an illegal value ) , ( INFO = i , ) |
|
| List of variables | D( * ) E( * ) EXTRA IBLOCK( * ) IFAIL( * ) INFO ISPLIT( * )
| IWORK( * ) LDZ M MAXITS N ODM1 ONE ORFAC
| TEN W( * ) WORK( * ) Z( LDZ, * ) ZERO | | close
| |
D( * )
E( * )
EXTRA
IBLOCK( * )
IFAIL( * )
INFO
ISPLIT( * )
IWORK( * )
LDZ
M
MAXITS
N
ODM1
ONE
ORFAC
TEN
W( * )
WORK( * )
Z( LDZ, * )
ZERO
| |