syevr_2stage#
Functions
-
void ssyevr_2stage(const char *jobz, const char *range, const char *uplo, const INT n, f32 *A, const INT lda, const f32 vl, const f32 vu, const INT il, const INT iu, const f32 abstol, INT *m, f32 *W, f32 *Z, const INT ldz, INT *isuppz, f32 *work, const INT lwork, INT *iwork, const INT liwork, INT *info)#
SSYEVR_2STAGE computes selected eigenvalues and, optionally, eigenvectors of a real symmetric matrix
Ausing the 2stage technique for the reduction to tridiagonal.Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.
SSYEVR_2STAGE first reduces the matrix
Ato tridiagonal form T with a call to SSYTRD. Then, whenever possible, SSYEVR_2STAGE calls SSTEMR to compute the eigenspectrum using Relatively Robust Representations. SSTEMR computes eigenvalues by the dqds algorithm, while orthogonal eigenvectors are computed from various “good” L D L^T representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. More specifically, the various steps of the algorithm are as follows.For each unreduced block (submatrix) of T,
The desired accuracy of the output can be specified by the input parameter(a) Compute T - sigma I = L D L^T, so that L and D define all the wanted eigenvalues to high relative accuracy. This means that small relative changes in the entries of D and L cause only small relative changes in the eigenvalues and eigenvectors. The standard (unfactored) representation of the tridiagonal matrix T does not have this property in general. (b) Compute the eigenvalues to suitable accuracy. If the eigenvectors are desired, the algorithm attains full accuracy of the computed eigenvalues only right before the corresponding vectors have to be computed, see steps c) and d). (c) For each cluster of close eigenvalues, select a new shift close to the cluster, find a new factorization, and refine the shifted eigenvalues to suitable accuracy. (d) For each eigenvalue with a large enough relative separation compute the corresponding eigenvector by forming a rank revealing twisted factorization. Go back to (c) for any clusters that remain.abstol.For more details, see SSTEMR’s documentation and:
Inderjit S. Dhillon and Beresford N. Parlett: “Multiple representations to compute orthogonal eigenvectors of symmetric tridiagonal matrices,” Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
Inderjit Dhillon and Beresford Parlett: “Orthogonal Eigenvectors and Relative Gaps,” SIAM Journal on Matrix Analysis and Applications, Vol. 25, 2004. Also LAPACK Working Note 154.
Inderjit Dhillon: “A new O(n^2) algorithm for the symmetric tridiagonal eigenvalue/eigenvector problem”, Computer Science Division Technical Report No. UCB/CSD-97-971, UC Berkeley, May 1997.
Note 1 : SSYEVR_2STAGE calls SSTEMR when the full spectrum is requested on machines which conform to the ieee-754 floating point standard. SSYEVR_2STAGE calls SSTEBZ and SSTEIN on non-ieee machines and when partial spectrum requests are made.Normal execution of SSTEMR may create NaNs and infinities and hence may abort due to a floating point exception in environments which do not handle NaNs and infinities in the ieee standard default manner.
- Contributors:
- Inderjit Dhillon, IBM Almaden, USAOsni Marques, LBNL/NERSC, USAKen Stanley, Computer Science Division, University of California at Berkeley, USAJason Riedy, Computer Science Division, University of California at Berkeley, USA
- Further Details:
All details about the 2stage techniques are available in:
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC ‘11), New York, NY, USA, Article 8 , 11 pages. https://doi.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC ‘13). Denver, Colorado, USA, 2013. Article 90, 12 pages. https://doi.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. https://doi.org/10.1177/1094342013502097
Parameters
injobzjobz='N': Compute eigenvalues only;jobz='V': Compute eigenvalues and eigenvectors. Not available in this release.inrangerange='A': all eigenvalues will be found.range='V': all eigenvalues in the half-open interval (vl,vu] will be found.range='I': theil-th throughiu-th eigenvalues will be found. Forrange='V'orrange='I'andiu-il<n-1, SSTEBZ and SSTEIN are called.inuplouplo='U': Upper triangle ofAis stored;uplo='L': Lower triangle ofAis stored.innThe order of the matrix
A.n>=0.inoutAArray of dimension (
lda,n). On entry, the symmetric matrixA. Ifuplo='U', the leadingn-by-nupper triangular part ofAcontains the upper triangular part of the matrixA. Ifuplo='L', the leadingn-by-nlower triangular part ofAcontains the lower triangular part of the matrixA. On exit, the lower triangle (ifuplo='L') or the upper triangle (ifuplo='U') ofA, including the diagonal, is destroyed.inldaThe leading dimension of the array
A.lda>=max(1,n).invlIf
range='V', the lower bound of the interval to be searched for eigenvalues.vl<vu. Not referenced ifrange='A'orrange='I'.invuIf
range='V', the upper bound of the interval to be searched for eigenvalues.vl<vu. Not referenced ifrange='A'orrange='I'.inilIf
range='I', the index of the smallest eigenvalue to be returned.0<=il<=iu<=n-1, ifn>0;il=0andiu=-1ifn=0. Not referenced ifrange='A'orrange='V'.iniuIf
range='I', the index of the largest eigenvalue to be returned.0<=il<=iu<=n-1, ifn>0;il=0andiu=-1ifn=0. Not referenced ifrange='A'orrange='V'.inabstolThe absolute error tolerance for the eigenvalues. An approximate eigenvalue is accepted as converged when it is determined to lie in an interval [a,b] of width less than or equal to
abstol + EPS * max(|a|,|b|), where EPS is the machine precision. Ifabstolis less than or equal to zero, thenEPS*|T|will be used in its place, where|T|is the 1-norm of the tridiagonal matrix obtained by reducingAto tridiagonal form. See “Computing Small Singular Values of Bidiagonal Matrices
with Guaranteed High Relative Accuracy,” by Demmel and Kahan, LAPACK Working Note #3. If high relative accuracy is important, set
abstoltoslamch("Safe minimum"). Doing so will guarantee that eigenvalues are computed to high relative accuracy when possible in future releases. The current code does not make any guarantees about high relative accuracy, but future releases will. See J. Barlow and J. Demmel, “Computing Accurate Eigensystems of Scaled Diagonally
Dominant Matrices”, LAPACK Working Note #7, for a discussion of which matrices define their eigenvalues to high relative accuracy.
outmThe total number of eigenvalues found.
0<=m<=n. Ifrange='A',m=n, and ifrange='I',m=iu-il+1.outWArray of dimension (
n). The firstmelements contain the selected eigenvalues in ascending order.outZArray of dimension (
ldz,max(1,m)). Ifjobz='V', then ifinfo=0, the firstmcolumns ofZcontain the orthonormal eigenvectors of the matrixAcorresponding to the selected eigenvalues, with the i-th column ofZholding the eigenvector associated withW[i]. Ifjobz='N', thenZis not referenced. Note: the user must ensure that at leastmax(1,m)columns are supplied in the arrayZ; ifrange='V', the exact value ofmis not known in advance and an upper bound must be used. Supplyingncolumns is always safe.inldzThe leading dimension of the array
Z.ldz>=1, and ifjobz='V',ldz>=max(1,n).outisuppzInteger array of dimension (
2*max(1,m)). The support of the eigenvectors inZ, i.e., the indices indicating the nonzero elements inZ. The i-th eigenvector is nonzero only in elementsisuppz[2*i]throughisuppz[2*i+1]. This is an output of SSTEMR (tridiagonal matrix). The support of the eigenvectors ofAis typically0:n-1because of the orthogonal transformations applied by SORMTR. Implemented only forrange='A'orrange='I'andiu-il=n-1.outworkArray of dimension (
max(1,lwork)). On exit, ifinfo=0,work[0]returns the optimallwork.inlworkThe dimension of the array
work.lwork>=1, whenn<=1; otherwise: Ifjobz='N'andn>1,lworkmust be queried.wherelwork = MAX(1, 26*n, dimension) where dimension = max(stage1,stage2) + (kd+1)*n + 5*n = n*kd + n*max(kd+1,FACTOPTNB) + max(2*kd*kd, kd*NTHREADS) + (kd+1)*n + 5*nkdis the blocking size of the reduction, FACTOPTNB is the blocking used by the QR or LQ algorithm, usually FACTOPTNB=128 is a good choice, NTHREADS is the number of threads used when openMP compilation is enabled, otherwise =1. Ifjobz='V'andn>1,lworkmust be queried. Not yet available. Iflwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray, and no error message related tolworkis issued.outiworkInteger array of dimension (
max(1,liwork)). On exit, ifinfo=0,iwork[0]returns the optimalliwork.inliworkThe dimension of the array
iwork. Ifn<=1,liwork>=1, elseliwork>=10*n. Ifliwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of theiworkarray, returns this value as the first entry of theiworkarray, and no error message related toliworkis issued.outinfoinfo=0: successful exitinfo<0: ifinfo=-i, the i-th argument had an illegal valueinfo>0: Internal error
void ssyevr_2stage(
const char* jobz,
const char* range,
const char* uplo,
const INT n,
f32* A,
const INT lda,
const f32 vl,
const f32 vu,
const INT il,
const INT iu,
const f32 abstol,
INT* m,
f32* W,
f32* Z,
const INT ldz,
INT* isuppz,
f32* work,
const INT lwork,
INT* iwork,
const INT liwork,
INT* info
);
Functions
-
void dsyevr_2stage(const char *jobz, const char *range, const char *uplo, const INT n, f64 *A, const INT lda, const f64 vl, const f64 vu, const INT il, const INT iu, const f64 abstol, INT *m, f64 *W, f64 *Z, const INT ldz, INT *isuppz, f64 *work, const INT lwork, INT *iwork, const INT liwork, INT *info)#
DSYEVR_2STAGE computes selected eigenvalues and, optionally, eigenvectors of a real symmetric matrix
Ausing the 2stage technique for the reduction to tridiagonal.Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.
DSYEVR_2STAGE first reduces the matrix
Ato tridiagonal form T with a call to DSYTRD. Then, whenever possible, DSYEVR_2STAGE calls DSTEMR to compute the eigenspectrum using Relatively Robust Representations. DSTEMR computes eigenvalues by the dqds algorithm, while orthogonal eigenvectors are computed from various “good” L D L^T representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. More specifically, the various steps of the algorithm are as follows.For each unreduced block (submatrix) of T,
The desired accuracy of the output can be specified by the input parameter(a) Compute T - sigma I = L D L^T, so that L and D define all the wanted eigenvalues to high relative accuracy. This means that small relative changes in the entries of D and L cause only small relative changes in the eigenvalues and eigenvectors. The standard (unfactored) representation of the tridiagonal matrix T does not have this property in general. (b) Compute the eigenvalues to suitable accuracy. If the eigenvectors are desired, the algorithm attains full accuracy of the computed eigenvalues only right before the corresponding vectors have to be computed, see steps c) and d). (c) For each cluster of close eigenvalues, select a new shift close to the cluster, find a new factorization, and refine the shifted eigenvalues to suitable accuracy. (d) For each eigenvalue with a large enough relative separation compute the corresponding eigenvector by forming a rank revealing twisted factorization. Go back to (c) for any clusters that remain.abstol.For more details, see DSTEMR’s documentation and:
Inderjit S. Dhillon and Beresford N. Parlett: “Multiple representations to compute orthogonal eigenvectors of symmetric tridiagonal matrices,” Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
Inderjit Dhillon and Beresford Parlett: “Orthogonal Eigenvectors and Relative Gaps,” SIAM Journal on Matrix Analysis and Applications, Vol. 25, 2004. Also LAPACK Working Note 154.
Inderjit Dhillon: “A new O(n^2) algorithm for the symmetric tridiagonal eigenvalue/eigenvector problem”, Computer Science Division Technical Report No. UCB/CSD-97-971, UC Berkeley, May 1997.
Note 1 : DSYEVR_2STAGE calls DSTEMR when the full spectrum is requested on machines which conform to the ieee-754 floating point standard. DSYEVR_2STAGE calls DSTEBZ and SSTEIN on non-ieee machines and when partial spectrum requests are made.Normal execution of DSTEMR may create NaNs and infinities and hence may abort due to a floating point exception in environments which do not handle NaNs and infinities in the ieee standard default manner.
- Contributors:
- Inderjit Dhillon, IBM Almaden, USAOsni Marques, LBNL/NERSC, USAKen Stanley, Computer Science Division, University of California at Berkeley, USAJason Riedy, Computer Science Division, University of California at Berkeley, USA
- Further Details:
All details about the 2stage techniques are available in:
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC ‘11), New York, NY, USA, Article 8 , 11 pages. https://doi.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC ‘13). Denver, Colorado, USA, 2013. Article 90, 12 pages. https://doi.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. https://doi.org/10.1177/1094342013502097
Parameters
injobzjobz='N': Compute eigenvalues only;jobz='V': Compute eigenvalues and eigenvectors. Not available in this release.inrangerange='A': all eigenvalues will be found.range='V': all eigenvalues in the half-open interval (vl,vu] will be found.range='I': theil-th throughiu-th eigenvalues will be found. Forrange='V'orrange='I'andiu-il<n-1, DSTEBZ and DSTEIN are called.inuplouplo='U': Upper triangle ofAis stored;uplo='L': Lower triangle ofAis stored.innThe order of the matrix
A.n>=0.inoutAArray of dimension (
lda,n). On entry, the symmetric matrixA. Ifuplo='U', the leadingn-by-nupper triangular part ofAcontains the upper triangular part of the matrixA. Ifuplo='L', the leadingn-by-nlower triangular part ofAcontains the lower triangular part of the matrixA. On exit, the lower triangle (ifuplo='L') or the upper triangle (ifuplo='U') ofA, including the diagonal, is destroyed.inldaThe leading dimension of the array
A.lda>=max(1,n).invlIf
range='V', the lower bound of the interval to be searched for eigenvalues.vl<vu. Not referenced ifrange='A'orrange='I'.invuIf
range='V', the upper bound of the interval to be searched for eigenvalues.vl<vu. Not referenced ifrange='A'orrange='I'.inilIf
range='I', the index of the smallest eigenvalue to be returned.0<=il<=iu<=n-1, ifn>0;il=0andiu=-1ifn=0. Not referenced ifrange='A'orrange='V'.iniuIf
range='I', the index of the largest eigenvalue to be returned.0<=il<=iu<=n-1, ifn>0;il=0andiu=-1ifn=0. Not referenced ifrange='A'orrange='V'.inabstolThe absolute error tolerance for the eigenvalues. An approximate eigenvalue is accepted as converged when it is determined to lie in an interval [a,b] of width less than or equal to
abstol + EPS * max(|a|,|b|), where EPS is the machine precision. Ifabstolis less than or equal to zero, thenEPS*|T|will be used in its place, where|T|is the 1-norm of the tridiagonal matrix obtained by reducingAto tridiagonal form. See “Computing Small Singular Values of Bidiagonal Matrices
with Guaranteed High Relative Accuracy,” by Demmel and Kahan, LAPACK Working Note #3. If high relative accuracy is important, set
abstoltodlamch("Safe minimum"). Doing so will guarantee that eigenvalues are computed to high relative accuracy when possible in future releases. The current code does not make any guarantees about high relative accuracy, but future releases will. See J. Barlow and J. Demmel, “Computing Accurate Eigensystems of Scaled Diagonally
Dominant Matrices”, LAPACK Working Note #7, for a discussion of which matrices define their eigenvalues to high relative accuracy.
outmThe total number of eigenvalues found.
0<=m<=n. Ifrange='A',m=n, and ifrange='I',m=iu-il+1.outWArray of dimension (
n). The firstmelements contain the selected eigenvalues in ascending order.outZArray of dimension (
ldz,max(1,m)). Ifjobz='V', then ifinfo=0, the firstmcolumns ofZcontain the orthonormal eigenvectors of the matrixAcorresponding to the selected eigenvalues, with the i-th column ofZholding the eigenvector associated withW[i]. Ifjobz='N', thenZis not referenced. Note: the user must ensure that at leastmax(1,m)columns are supplied in the arrayZ; ifrange='V', the exact value ofmis not known in advance and an upper bound must be used. Supplyingncolumns is always safe.inldzThe leading dimension of the array
Z.ldz>=1, and ifjobz='V',ldz>=max(1,n).outisuppzInteger array of dimension (
2*max(1,m)). The support of the eigenvectors inZ, i.e., the indices indicating the nonzero elements inZ. The i-th eigenvector is nonzero only in elementsisuppz[2*i]throughisuppz[2*i+1]. This is an output of DSTEMR (tridiagonal matrix). The support of the eigenvectors ofAis typically0:n-1because of the orthogonal transformations applied by DORMTR. Implemented only forrange='A'orrange='I'andiu-il=n-1.outworkArray of dimension (
max(1,lwork)). On exit, ifinfo=0,work[0]returns the optimallwork.inlworkThe dimension of the array
work.lwork>=1, whenn<=1; otherwise: Ifjobz='N'andn>1,lworkmust be queried.wherelwork = MAX(1, 26*n, dimension) where dimension = max(stage1,stage2) + (kd+1)*n + 5*n = n*kd + n*max(kd+1,FACTOPTNB) + max(2*kd*kd, kd*NTHREADS) + (kd+1)*n + 5*nkdis the blocking size of the reduction, FACTOPTNB is the blocking used by the QR or LQ algorithm, usually FACTOPTNB=128 is a good choice, NTHREADS is the number of threads used when openMP compilation is enabled, otherwise =1. Ifjobz='V'andn>1,lworkmust be queried. Not yet available. Iflwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray, and no error message related tolworkis issued.outiworkInteger array of dimension (
max(1,liwork)). On exit, ifinfo=0,iwork[0]returns the optimalliwork.inliworkThe dimension of the array
iwork. Ifn<=1,liwork>=1, elseliwork>=10*n. Ifliwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of theiworkarray, returns this value as the first entry of theiworkarray, and no error message related toliworkis issued.outinfoinfo=0: successful exitinfo<0: ifinfo=-i, the i-th argument had an illegal valueinfo>0: Internal error
void dsyevr_2stage(
const char* jobz,
const char* range,
const char* uplo,
const INT n,
f64* A,
const INT lda,
const f64 vl,
const f64 vu,
const INT il,
const INT iu,
const f64 abstol,
INT* m,
f64* W,
f64* Z,
const INT ldz,
INT* isuppz,
f64* work,
const INT lwork,
INT* iwork,
const INT liwork,
INT* info
);