p?syev
p?syev
Computes selected eigenvalues and eigenvectors of a symmetric matrix.
Syntax
void
pssyev
(
char
*jobz
,
char
*uplo
,
MKL_INT
*n
,
float
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
float
*w
,
float
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
float
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
void
pdsyev
(
char
*jobz
,
char
*uplo
,
MKL_INT
*n
,
double
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
double
*w
,
double
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
double
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
Include Files
- mkl_scalapack.h
Description
The
p?syev
function
computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A
by calling the recommended sequence of ScaLAPACK functions
. In its present form, the
function
assumes a homogeneous system and makes no checks for consistency of the eigenvalues or eigenvectors across the different processes. Because of this, it is possible that a heterogeneous system may return incorrect results without any error messages. Input Parameters
np
= the number of rows local to a given process. nq
= the number of columns local to a given process. - jobz
- (global) Must be'N'or'V'. Specifies if it is necessary to compute the eigenvectors:If, then only eigenvalues are computed.jobz='N'If, then eigenvalues and eigenvectors are computed.jobz='V'
- uplo
- (global) Must be'U'or'L'. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored:If,uplo='U'astores the upper triangular part ofA.If,uplo='L'astores the lower triangular part ofA.
- n
- (global) The number of rows and columns of the matrixA(.n≥0)
- a
- (local)Block cyclic array of global sizeand local sizen*n. On entry, the symmetric matrixlld_a*LOCc(ja+n-1)A.If, only the upper triangular part ofuplo='U'Ais used to define the elements of the symmetric matrix.If, only the lower triangular part ofuplo='L'Ais used to define the elements of the symmetric matrix.
- ia,ja
- (global) The row and column indices in the global matrixAindicating the first row and the first column of the submatrixA, respectively.
- desca
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixA.
- 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)Array of sizelwork.
- lwork
- (local) See below for definitions of variables used to definelwork.If no eigenvectors are requested (), thenjobz='N',lwork≥ 5*n+sizesytrd+ 1If eigenvectors are requested () then the amount of workspace required to guarantee that all eigenvectors are computed is:jobz='V'qrmem= 2*n-2lwmin= 5*n+n*ldc+max(sizemqrleft,qrmem) + 1Variable definitions:nb=desca[=mb_ - 1]desca[=nb_ - 1]descz[=mb_ - 1]descz[;nb_ - 1]nn=max(n,nb, 2);desca[=rsrc_- 1]desca[=rsrc_- 1]descz[=rsrc_- 1]descz[= 0csrc_- 1]np=numroc(nn,nb, 0, 0,NPROW)nq=numroc(max(n,nb, 2),nb, 0, 0,NPCOL)nrc=numroc(n,nb,myprowc, 0,NPROCS)ldc=max(1,nrc)is the workspace forsizemqrleftp?ormtrwhen itssideargument is'L'.myprowcis defined when a new context is created as follows:call blacs_get(desca[, 0,ctxt_- 1]contextc)callblacs_gridinit(contextc,'R',NPROCS, 1)callblacs_gridinfo(contextc,nprowc,npcolc,myprowc,mypcolc)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.
Output Parameters
- a
- On exit, the lower triangle (if) or the upper triangle (ifuplo='L') ofuplo='U'A, including the diagonal, is destroyed.
- w
- (global).Array of sizen.On normal exit, the firstmentries contain the selected eigenvalues in ascending order.
- z
- (local).Array, global size, local sizen*n. Iflld_z*LOCc(jz+n-1), then on normal exit the firstjobz='V'mcolumns ofzcontain the orthonormal eigenvectors of the matrix corresponding to the selected eigenvalues.If, thenjobz='N'zis not referenced.
- work[0]
- On output,work[0]returns the workspace needed to guarantee completion. If the input parameters are incorrect,work[0]may also be incorrect.Ifminimal (optimal) amount of workspacejobz='N'work[0]=Ifminimal workspace required to generate all the eigenvectors.jobz='V'work[0]=
- info
- (global)If, the execution is successful.info= 0If: If theinfo< 0i-th argument is an array and thej-entry had an illegal value, then, if theinfo= -(i*100+j)i-th argument is a scalar and had an illegal value, then.info= -iIf:info> 0Ifthroughinfo= 1n, thei-th eigenvalue did not converge in?steqr2after a total of 30niterations.If, theninfo=n+1p?syevhas detected heterogeneity by finding that eigenvalues were not identical across the process grid. In this case, the accuracy of the results fromp?syevcannot be guaranteed.