p?heev
p?heev
Computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix.
Syntax
void
pcheev
(
char
*jobz
,
char
*uplo
,
MKL_INT
*n
,
MKL_Complex8
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
float
*w
,
MKL_Complex8
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
MKL_Complex8
*work
,
MKL_INT
*lwork
,
float
*rwork
,
MKL_INT
*lrwork
,
MKL_INT
*info
);
void
pzheev
(
char
*jobz
,
char
*uplo
,
MKL_INT
*n
,
MKL_Complex16
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
double
*w
,
MKL_Complex16
*z
,
MKL_INT
*iz
,
MKL_INT
*jz
,
MKL_INT
*descz
,
MKL_Complex16
*work
,
MKL_INT
*lwork
,
double
*rwork
,
MKL_INT
*lrwork
,
MKL_INT
*info
);
Include Files
- mkl_scalapack.h
Description
The
p?heev
function
computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A
by calling the recommended sequence of ScaLAPACK functions
. The function
assumes a homogeneous system and makes spot checks of the consistency of the eigenvalues across the different processes. 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 Hermitian 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 Hermitian matrixlld_a*LOCc(ja+n-1)A.If, only the upper triangular part ofuplo='U'Ais used to define the elements of the Hermitian matrix.If, only the lower triangular part ofuplo='L'Ais used to define the elements of the Hermitian 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. Ifis incorrect,desca[ctxt_- 1]p?heevcannot guarantee correct error reporting.
- 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.must equaldescz[ctxt_- 1]desca[.ctxt_- 1]
- work
- (local).Array of sizelwork.
- lwork
- (local) The size of the arraywork.If only eigenvalues are requested ():jobz='N'lwork≥max(nb*(np0 + 1), 3) + 3*nIf eigenvectors are requested (), then the amount of workspace required:jobz='V'lwork≥(np0+nq0+nb)*nb+ 3*n+n2withnb=desca[mb_ - 1] =desca[nb_ - 1] =nb=descz[mb_ - 1] =descz[nb_ - 1].np0 =numroc(nn,nb, 0, 0,NPROW).nq0 =numroc( max(n,nb, 2 ),nb, 0, 0,NPCOL)If, thenlwork= -1lworkis global input and a workspace query is assumed; thefunctiononly calculates the size required for optimal performance for all work arrays. The required workspace is returned as the first element of the corresponding work arrays, and no error message is issued bypxerbla.
- (local).Workspace array of sizelrwork.
- lrwork
- (local) The size of the arrayrwork.See below for definitions of variables used to definelrwork.If no eigenvectors are requested (), thenjobz='N'.lrwork≥2*nIf eigenvectors are requested (), thenjobz='V'.lrwork≥2*n+ 2*n-2If, thenlrwork= -1lrworkis global input and a workspace query is assumed; thefunctiononly calculates the minimum size required for therworkarray. The required workspace is returned as the first element ofrwork, 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 overwritten.
- w
- (global).Array of sizen. The firstmelements contain the selected eigenvalues in ascending order.
- z
- (local).Array, global size, local sizen*n.lld_z*LOCc(jz+n-1)If, then on normal exit the firstjobz='V'mcolumns ofzcontain the orthonormal eigenvectors of the matrix corresponding to the selected eigenvalues. If an eigenvector fails to converge, then that column ofzcontains the latest approximation to the eigenvector, and the index of the eigenvector is returned inifail.If, thenjobz='N'zis not referenced.
- work[0]
- On exit, returns adequate workspace to allow optimal performance.If, thenjobz='N'work[0]= minimal workspace only for eigenvalues.If, thenjobz='V'work[0]= minimal workspace required to generate all the eigenvectors.
- rwork[0]
- (local)On output,rwork[0]returns workspace required to guarantee completion.
- info
- (global)If, the execution is successful.info= 0If:info< 0If thei-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>0Ifinfo= 1 throughn, thei-th eigenvalue did not converge in?steqr2after a total of 30*niterations.Ifinfo=n+1, thenp?heevdetected heterogeneity, and the accuracy of the results cannot be guaranteed.