XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ dssgv()

void dssgv ( char  jobz,
char  uplo,
char  uplo2,
int  n,
const double  val[],
const int  ptr[],
const int  ind[],
int  base,
const double  val2[],
const int  ptr2[],
const int  ind2[],
int  base2,
int  format,
double  d[],
int  ldz,
double  z[],
const char *  which,
int  nev,
double  tol,
double  resid[],
int  ncv,
int  ldv,
double  v[],
int  maxiter,
double  workd[],
double  workl[],
int  lworkl,
int  iwork[],
int *  info 
)

Generalized eigenvalue problem of a symmetric sparse matrix (driver)

Purpose
This routine computes the eigenvalues, and optionally, the eigenvectors of a generalized eigenproblem, of the form
Ax = λBx
by Implicitly restarted Lanczos method (IRLM). A is the symmetric sparse matrix and B is the symmetric positive definite sparse matrix.

It is assumed that the upper or lower triangular parts or both (whole matrix) of the sparse matrices are stored in CSC or CSR format.

The generalized eigenvalue problem is solved by using arpack routines dsaupd and dseupd (inverse mode (Mode 2)).
Parameters
[in]jobz= 'N': Compute eigenvalues only.
= 'V': Compute eigenvalues and eigenvectors.
[in]uploSpecifies whether the upper or lower triangular part of the matrix A is stored.
= 'U': Upper triangular part is stored.
= 'L': Lower triangular part is stored.
= 'B': Whole matrix is stored (both upper and lower parts are stored).
The other triangular elements (not including diagonal elements) are ignored.
[in]uplo2Specifies whether the upper or lower triangular part of the matrix B is stored.
= 'U': Upper triangular part is stored.
= 'L': Lower triangular part is stored.
= 'B': Whole matrix is stored (both upper and lower parts are stored).
The other triangular elements (not including diagonal elements) are ignored.
[in]nNumber of rows and columns of the matrix. (n >= 0) (If n = 0, returns without computation)
[in]val[]Array val[lval] (lval >= nnz)
Values of nonzero elements of matrix A (where nnz is the number of nonzero elements).
[in]ptr[]Array ptr[lptr] (lptr >= n + 1)
Column pointers (if CSC) or row pointers (if CSR) of matrix A.
[in]ind[]Array ind[lind] (lind >= nnz)
Row indices (if CSC) or column indices (if CSR) of matrix A (where nnz is the number of nonzero elements).
[in]baseIndexing of ptr[] and ind[].
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.
[in]val2[]Array val2[lval2] (lval2 >= nnz2)
Values of nonzero elements of matrix B (where nnz2 is the number of nonzero elements).
[in]ptr2[]Array ptr2[lptr2] (lptr2 >= n + 1)
Column pointers (if CSC) or row pointers (if CSR) of matrix B.
[in]ind2[]Array ind2[lind2] (lind2 >= nnz2)
Row indices (if CSC) or column indices (if CSR) of matrix B (where nnz2 is the number of nonzero elements).
[in]base2Indexing of ptr2[] and ind2[].
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.
[in]formatSparse matrix format of matrix A and B.
= 0: CSR format.
= 1: CSC format.
[out]d[]Array d[ld] (ld >= nev)
Contains the Ritz value approximations to the eigenvalues of A*z = λ*B*z. The values are returned in ascending order.
[in]ldzLeading dimension of the array z. (ldz >= n if Ritz vectors are desired, ldz >= 1 otherwise)
[out]z[]Array z[ldz * lz] (lz >= nev)
Contains the Ritz vectors (approximations to the eigenvectors) of the eigensystem A*z = λ*B*z corresponding to the Ritz value approximations.
If jobz = 'N' then z[] is not referenced.
[in]which= "LM": Compute the nev eigenvalues of largest magnitude.
= "SM": Compute the nev eigenvalues of smallest magnitude.
= "LR": Compute the nev eigenvalues of largest real part.
= "SR": Compute the nev eigenvalues of smallest real part.
= "LI": Compute the nev eigenvalues of largest imaginary part.
= "SI": Compute the nev eigenvalues of smallest imaginary part.
[in]nevNumber of eigenvalues to be computed. (0 < nev < n)
[in]tolStopping criterion: the acceptable relative accuracy of the Ritz value. If tol <= 0, machine precision is assumed.
[out]resid[]Array resid[lresid] (lresid >= n)
The residual vector.
[in]ncvNumber of columns of the matrix V. (nev < ncv <= n)
This will indicate how many Lanczos vectors are generated at each iteration (ncv >= 2*nev is recommended).
[in]ldvLeading dimension of the array v. (ldv >= n)
[out]v[]Array v[ldv * lv] (lv >= ncv)
Matrix V containing ncv Lanczos basis vectors.
[in]maxiterMaximum number of Lanczos update iterations allowed.
[out]workd[]Array workd[lworkd] (lworkd >= 3*n)
Distributed work array used for reverse communication.
[out]workl[]Array workl[lworkl]
Local work array.
[in]lworklSize of array workl[]. (lworkl >= ncv^2 + 8*ncv)
[out]iwork[]Array iwork[liwork] (liwork >= max(ncv, 3))
Integer work array.
The following values are returned in iwork[0], ..., iwork[2].
iwork[0]: Number of Lanczos update iterations taken.
iwork[1]: Number of Ritz values that satisfy the convergence criterion (nconv).
iwork[2]: Total number of OP*x operations (numop).
[out]infoReturn code.
= 0: Successful exit.
< 0: The (-info)-th argument is invalid.
= 1: Maximum number of iterations taken.
= 3: No shifts could be applied during a cycle of the implicitly restarted Lanczos iteration. A possible remedy is to increase ncv relative to nev (ncv >= 2*nev is recommended).
= 11: Initial residual vector is zero.
= 12: Failed to build a Lanczos factorization.
= 13: Error return from LAPACK eigenvalue calculation.
= 14: dsaupd did not find any eigenvalues to sufficient accuracy.
= 15 to 19: Internal code error.