p?stein
p?stein
Computes the eigenvectors of a tridiagonal matrix using inverse iteration.
Syntax
void
psstein
(
MKL_INT
*n
,
float
*d
,
float
*e
,
MKL_INT
*m
,
float
*w
,
MKL_INT
*iblock
,
MKL_INT
*isplit
,
float
*orfac
,
float
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
float
*work
,
MKL_INT
*lwork
,
MKL_INT
*iwork
,
MKL_INT
*liwork
,
MKL_INT
*ifail
,
MKL_INT
*iclustr
,
float
*gap
,
MKL_INT
*info
);
void
pdstein
(
MKL_INT
*n
,
double
*d
,
double
*e
,
MKL_INT
*m
,
double
*w
,
MKL_INT
*iblock
,
MKL_INT
*isplit
,
double
*orfac
,
double
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
double
*work
,
MKL_INT
*lwork
,
MKL_INT
*iwork
,
MKL_INT
*liwork
,
MKL_INT
*ifail
,
MKL_INT
*iclustr
,
double
*gap
,
MKL_INT
*info
);
void
pcstein
(
MKL_INT
*n
,
float
*d
,
float
*e
,
MKL_INT
*m
,
float
*w
,
MKL_INT
*iblock
,
MKL_INT
*isplit
,
float
*orfac
,
MKL_Complex8
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
float
*work
,
MKL_INT
*lwork
,
MKL_INT
*iwork
,
MKL_INT
*liwork
,
MKL_INT
*ifail
,
MKL_INT
*iclustr
,
float
*gap
,
MKL_INT
*info
);
void
pzstein
(
MKL_INT
*n
,
double
*d
,
double
*e
,
MKL_INT
*m
,
double
*w
,
MKL_INT
*iblock
,
MKL_INT
*isplit
,
double
*orfac
,
MKL_Complex16
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
double
*work
,
MKL_INT
*lwork
,
MKL_INT
*iwork
,
MKL_INT
*liwork
,
MKL_INT
*ifail
,
MKL_INT
*iclustr
,
double
*gap
,
MKL_INT
*info
);
Include Files
- mkl_scalapack.h
Description
The
p?stein
function
computes the eigenvectors of a symmetric tridiagonal matrix T
corresponding to specified eigenvalues, by inverse iteration. p?stein
does not orthogonalize vectors that are on different processes. The extent of orthogonalization is controlled by the input parameter lwork
. Eigenvectors that are to be orthogonalized are computed by the same process. p?stein
decides on the allocation of work among the processes and then calls ?stein2
(modified LAPACK function
) on each individual process. If insufficient workspace is allocated, the expected orthogonalization may not be done.If the eigenvectors obtained are not orthogonal, increase
lwork
and run the code again.p
= NPROW
*NPCOL
is the total number of processes.Input Parameters
- n
- (global) The order of the matrixT(.n≥0)
- m
- (global) The number of eigenvectors to be returned.
- d,e,w
- (global)Arrays:of sizedncontains the diagonal elements ofT.of sizeecontains the off-diagonal elements ofn-1T.of sizewmcontains all the eigenvalues grouped by split-off block. The eigenvalues are supplied from smallest to largest within the block. (Here the output arraywfromp?stebzwith order=is expected. The array should be replicated in all processes.)'B'
- iblock
- (global)Array of sizen. The submatrix indices associated with the corresponding eigenvalues infor eigenvalues belonging to the first submatrix from the top, 2 for those belonging to the second submatrix, etc. (The output arrayw: 1iblockfromp?stebzis expected here).
- isplit
- (global)Array of sizen. The splitting points at whichTbreaks up into submatrices. The first submatrix consists of rows/columns 1 toisplit[0], the second of rows/columnsthroughisplit[0]+1, and so on, and theisplit[1]nsplit-th submatrix consists of rows/columnsthroughisplit[+1nsplit-2]. (The output arrayisplit[=nsplit-1]nisplitfromp?stebzis expected here.)
- orfac
- (global)orfacspecifies which eigenvectors should be orthogonalized. Eigenvectors that correspond to eigenvalues withinof each other are to be orthogonalized. However, if the workspace is insufficient (seeorfac*||T||lwork), this tolerance may be decreased until all eigenvectors can be stored in one process. No orthogonalization is done iforfacis equal to zero. A default value of 1000 is used iforfacis negative.orfacshould be identical on all processes
- iz,jz
- (global) The row and column indices in the global matrixZindicating the first row and the first column of the submatrixZ, respectively.
- descz
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixZ.
- work
- (local).Workspace array of sizelwork.
- lwork
- (local)lworkcontrols the extent of orthogonalization which can be done. The number of eigenvectors for which storage is allocated on each process is. Eigenvectors corresponding to eigenvalue clusters of size (nvec=floor((lwork-max(5*n,np00*mq00))/n)are guaranteed to be orthogonal (the orthogonality is similar to that obtained fromnvec-ceil(m/p) + 1)?stein2).lworkmust be no smaller thanmax(5*and should have the same input value on all processes.n,np00*mq00) +ceil(m/p)*nIt is the minimum value oflworkinput on different processes that is significant.If, thenlwork= -1lworkis global input and a workspace query is assumed; thefunctiononly calculates the minimum and optimal size for all work arrays. Each of these values is returned in the first entry of the corresponding work array, and no error message is issued bypxerbla.
- iwork
- (local)Workspace array of size3.n+p+1
- liwork
- (local) The size of the arrayiwork. It must be greater than3*.n+p+1If, thenliwork= -1liworkis global input and a workspace query is assumed; thefunctiononly calculates the minimum and optimal size for all work arrays. Each of these values is returned in the first entry of the corresponding work array, and no error message is issued bypxerbla.
Output Parameters
- z
- (local)Array of size.descz[,dlen_-1]n/NPCOL+NB)zcontains the computed eigenvectors associated with the specified eigenvalues. Any vector which fails to converge is set to its current iterate after MAXIT iterations (See?stein2). On output,zis distributed across thepprocesses in block cyclic format.
- work
- On exit,workgives a lower bound on the workspace ([0]lwork) that guarantees the user desired orthogonalization (seeorfac). Note that this may overestimate the minimum workspace needed.
- iwork
- On exit,contains the amount of integer workspace required.iwork[0]On exit, thethroughiwork[1]indicate the eigenvectors computed by each process. Processiwork[p+1]icomputes eigenvectors indexedthroughiwork[i+1]+1.iwork[i+2]
- ifail
- (global) Array of sizem. On normal exit, all elements ofifailare zero. If one or more eigenvectors fail to converge after MAXIT iterations (as in?stein), thenis returned. Ifinfo> 0mod(,info, then form+1)>0toi=1, the eigenvector corresponding to the eigenvaluemod(info,m+1)failed to converge (w[ifail[i-1]-1]wrefers to the array of eigenvalues on output).mod(is the integer remainder ofx,y).x/y
- iclustr
- (global) Array of size2*p.This output array contains indices of eigenvectors corresponding to a cluster of eigenvalues that could not be orthogonalized due to insufficient workspace (seelwork,orfacandinfo). Eigenvectors corresponding to clusters of eigenvalues indexedtoiclustr(2*I-1),iclustr(2*I)toi= 1, could not be orthogonalized due to lack of workspace. Hence the eigenvectors corresponding to these clusters may not be orthogonal.info/(m+1)iclustris a zero terminated array:iclustr[2*k-1]≠0 and= 0 if and only ificlustr[2*k]kis the number of clusters.
- gap
- This output array contains the gap between eigenvalues whose eigenvectors could not be orthogonalized. The(global)info/moutput values in this array correspond to theclusters indicated by the arrayinfo/(m+1)iclustr. As a result, the dot product between eigenvectors corresponding to thei-thcluster may be as high as(O(n)*macheps)/gap[.i-1]
- info
- (global)If, the execution is successful.info= 0If: If theinfo< 0i-th argument is an array and thej-th entry, indexedhad an illegal value, thenj-1,-(info=i*100+j),If thei-th argument is a scalar and had an illegal value, then-info=i.If: ifinfo< 0-info=i, thei-th argument had an illegal value.If: ifinfo> 0=mod(info,m+1)i, thenieigenvectors failed to converge in MAXIT iterations. Their indices are stored in the arrayifail. If=info/(m+1)i, then eigenvectors corresponding toiclusters of eigenvalues could not be orthogonalized due to insufficient workspace. The indices of the clusters are stored in the arrayiclustr.