SRC/chbevx_2stage.f(3)

okay bestie, welcome to SRC/chbevx_2stage.f(3) from the Library Functions Manual β€” it's giving main-character Fortran energy and we're obsessed πŸ’…βœ¨

🌸 NAME 🌸

SRC/chbevx_2stage.f β€” that's the file, periodt.


✨ SYNOPSIS ✨

πŸ’« Functions/Subroutines πŸ’«

okay so this page is literally about one function/subroutine, and here's its exact signature β€” copy it character for character, no cap:

subroutine chbevx_2stage (jobz, range, uplo, n, kd, ab, ldab, q, ldq,
    vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, rwork, iwork,
    ifail, info)

And what does it do? CHBEVX_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices πŸ¦‹πŸ”₯

πŸŽ€ Function/Subroutine Documentation πŸŽ€

okay bestie, buckle up, because here's the actual signature β€” every argument, exactly as written, no cap:

subroutine chbevx_2stage (character jobz, character range, character uplo,
    integer n, integer kd, complex, dimension( ldab, * ) ab, integer ldab,
    complex, dimension( ldq, * ) q, integer ldq, real vl, real vu, integer
    il, integer iu, real abstol, integer m, real, dimension( * ) w, complex,
    dimension( ldz, * ) z, integer ldz, complex, dimension( * ) work,
    integer lwork, real, dimension( * ) rwork, integer, dimension( * )
    iwork, integer, dimension( * ) ifail, integer info)

CHBEVX_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices. (yes, the all-caps OTHER is doing main character energy, we love that for it πŸ’…)


✨ Purpose ✨

so what does it actually do? CHBEVX_2STAGE computes selected eigenvalues and, optionally, eigenvectors of a complex Hermitian band matrix** A using the 2stage technique for the reduction to tridiagonal. πŸ¦‹

and like, you don't have to take all the eigenvalues β€” you can pick which ones you want by giving either a range of values or a range of indices. iconic behavior, honestly. obsessed. ✨


🌸 Parameters 🌸

big list energy, but every single one matters. let's go 🫢

JOBZ

JOBZ is CHARACTER*1

  • 'N' β€” compute eigenvalues only;
  • 'V' β€” compute eigenvalues and eigenvectors.
🚨 and 'V' is not available in this release. so like, don't come for me when it doesn't work, the source said it first. 😭

RANGE

RANGE is CHARACTER*1

  • 'A' β€” all eigenvalues will be found;
  • 'V' β€” all eigenvalues in the half-open interval (VL,VU] will be found;
  • 'I' β€” the IL-th through IU-th eigenvalues will be found.

UPLO

UPLO is CHARACTER*1

  • 'U' β€” upper triangle of A is stored;
  • 'L' β€” lower triangle of A is stored.

N

N is INTEGER

the order of the matrix A. N >= 0.

KD

KD is INTEGER

the number of superdiagonals of the matrix A if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KD >= 0.

AB

AB is COMPLEX array, dimension (LDAB, N)

on entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first KD+1 rows of the array. the j-th column of A is stored in the j-th column of the array AB as follows:

if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd).

on exit, AB is overwritten by values generated during the reduction to tridiagonal form. (so if you needed that original matrix… girl. it's gone. πŸ™ˆ)

LDAB

LDAB is INTEGER

the leading dimension of the array AB. LDAB >= KD + 1.

Q

Q is COMPLEX array, dimension (LDQ, N)

  • if JOBZ = 'V', the N-by-N unitary matrix used in the reduction to tridiagonal form.
  • if JOBZ = 'N', the array Q is not referenced.

LDQ

LDQ is INTEGER

the leading dimension of the array Q. if JOBZ = 'V', then LDQ >= max(1,N).

VL

VL is REAL

if RANGE='V', the lower bound of the interval to be searched for eigenvalues. VL < VU. not referenced if RANGE = 'A' or 'I'.

VU

VU is REAL

if RANGE='V', the upper bound of the interval to be searched for eigenvalues. VL < VU. not referenced if RANGE = 'A' or 'I'.

IL

IL is INTEGER

if RANGE='I', the index of the smallest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. not referenced if RANGE = 'A' or 'V'.

IU

IU is INTEGER

if RANGE='I', the index of the largest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. not referenced if RANGE = 'A' or 'V'.

ABSTOL

ABSTOL is REAL

the 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. if ABSTOL is less than or equal to zero, then EPS*|T| will be used in its place, where |T| is the 1-norm of the tridiagonal matrix obtained by reducing AB to tridiagonal form.

eigenvalues will be computed most accurately when ABSTOL is set to twice the underflow threshold 2*SLAMCH('S'), not zero. 😀 if this routine returns with INFO>0, indicating that some eigenvectors did not converge, try setting ABSTOL to 2*SLAMCH('S'). fr fr, that's the move.

πŸ“š the source says: See by Demmel and Kahan, LAPACK Working Note #3. β€” yes there's literally a gap where a paper title should be. someone left a TODO in prod and honestly? relatable. πŸ’€

M

M is INTEGER

the total number of eigenvalues found. 0 <= M <= N. if RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1.

W

W is REAL array, dimension (N)

the first M elements contain the selected eigenvalues in ascending order. ✨

Z

Z is COMPLEX array, dimension (LDZ, max(1,M))

  • if JOBZ = 'V', then if INFO = 0, the first M columns of Z contain the orthonormal eigenvectors of the matrix A corresponding to the selected eigenvalues, with the i-th column of Z holding the eigenvector associated with W(i).
  • if an eigenvector fails to converge, then that column of Z contains the latest approximation to the eigenvector, and the index of the eigenvector is returned in IFAIL.
  • if JOBZ = 'N', then Z is not referenced.
⚠️ note: the user must ensure that at least max(1,M) columns are supplied in the array Z; if RANGE = 'V', the exact value of M is not known in advance and an upper bound must be used. so like, allocate generously bestie, don't be stingy 😭

LDZ

LDZ is INTEGER

the leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).

WORK

WORK is COMPLEX array, dimension (LWORK)

LWORK

LWORK is INTEGER

the length of the array WORK. LWORK >= 1, when N <= 1; otherwise:

if JOBZ = 'N' and N > 1, LWORK must be queried:

LWORK = MAX(1, dimension) where
dimension = (2KD+1)*N + KD*NTHREADS
where KD is the size of the band.
NTHREADS is the number of threads used when
openMP compilation is enabled, otherwise =1.

if JOBZ = 'V' and N > 1, LWORK must be queried. not yet available. 🫠

πŸ’‘ if LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.

RWORK

RWORK is REAL array, dimension (7*N)

IWORK

IWORK is INTEGER array, dimension (5*N)

IFAIL

IFAIL is INTEGER array, dimension (N)

if JOBZ = 'V', then if INFO = 0, the first M elements of IFAIL are zero. if INFO > 0, then IFAIL contains the indices of the eigenvectors that failed to converge. if JOBZ = 'N', then IFAIL is not referenced.

INFO

INFO is INTEGER

  • = 0 β€” successful exit ✨
  • < 0 β€” if INFO = -i, the i-th argument had an illegal value 😬
  • > 0 β€” if INFO = i, then i eigenvectors failed to converge. their indices are stored in array IFAIL. πŸ’€

πŸ‘‘ Author πŸ‘‘

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

(the whole squad, we stan collaboration 🫢)


🧚 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. http://doi.acm.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. http://doi.acm.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. http://hpc.sagepub.com/content/28/2/196

definition at line 323 of file chbevx_2stage.f.

🌈 Author 🌈

generated automatically by Doxygen for LAPACK from the source code. (not me writing my own biography, the machine did it πŸŽ€)


and that's the whole page, bestie β€” LAPACK, Version 3.12.0, from SRC/chbevx_2stage.f(3). go forth and compute those selected eigenvalues, you absolute icon πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from