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

◆ znaupd()

void znaupd ( int *  ido,
char  bmat,
int  n,
char const *  which,
int  nev,
double  tol,
doublecomplex  resid[],
int  ncv,
int  ldv,
doublecomplex  v[],
int  iparam[],
int  ipntr[],
doublecomplex  workd[],
doublecomplex  workl[],
int  lworkl,
double  rwork[],
int *  info 
)

Arnoldi factorization of a complex sparse matrix

Purpose
The eigenvalues and eigenvectors of a complex sparse matrix are computed by Implicitly restarted Arnoldi method (IRAM).

This routine computes the Arnoldi factorization, which is the first half of the algorithm. The approximate eigenvalues computed from the factorization are called Ritz values and the corresponding approximate eigenvectors are called Ritz vectors. The routine zneupd computes the Ritz values and the Ritz vectors, which is the second half of the algorithm, from the output of this routine.

This routine computes approximations to a few eigenpairs of a complex linear operator "OP" with respect to a semi-inner product defined by a Hermitian positive semi-definite matrix B.

This routine is iteratively called until the convergence to solve one of the following problems.
  • Regular mode (mode = 1): A*x = λ*x. (OP = A, B = I)
  • Regular inverse mode (mode = 2): A*x = λ*M*x, M is Hermitian positive definite. (OP = M^(-1)*A, B = M)
  • Shift-and-invert mode (mode = 3): A*x = λ*M*x, M is Hermitian semi-definite. (OP = (A - σ*M)^(-1)*M, B = M)
Note - mode is soecified by iparam[6].
Parameters
[in,out]idoReverse communication flag.
[in] ido must be zero on the first call.
[out] ido will be set to indicate the type of operation to be performed. Control is then given back to the calling routine which has the responsibility to carry out the requested operation and call again with the result.
= -1: Compute y = OP * x. (for the initialization phase)
= 1: Compute y = OP * x.
= 2: Compute y = B * x.
= 3: Compute np shifts. (Note 3)
= 99: done.
Note 1 - x is workd[ipntr[0] - 1], workd[ipntr[0]], ..., workd[ipntr[0] + n - 2].
Note 2 - y is workd[ipntr[1] - 1], workd[ipntr[1]], ..., workd[ipntr[1] + n - 2].
Note 3 - When iparam[0] = 0, and ido = 3, the user needs to provide the np (= iparam[7]) shifts in locations: workl[ipntr[10] - 1], workl[ipntr[10]], ..., workl[ipntr[10] + np - 2].
[in]bmat= 'I': Standard eigenvalue problem A*x = λ*x
= 'G': Generalized eigenvalue problem A*x = λ*B*x
[in]nDimension of the matrix. (n >= 0) (If n = 0, returns without computation)
[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.
[in,out]resid[]Array resid[lresid] (lresid >= n)
[in] If info != 0, the initial residual vector possibly from a previous run.
[out] The final residual vector.
[in]ncvNumber of columns of the matrix V. (nev < ncv <= n)
This will indicate how many Arnoldi vectors are generated at each iteration.
[in]ldvLeading dimension of the array v. (ldv >= n)
[out]v[]Array v[ldv * lv] (lv >= ncv)
Contains the final set of Arnoldi basis vectors.
[in,out]iparam[]Array iparam[liparam] (liparam >= 11)
iparam[0] (ishift): [in] Method for selecting the implicit shifts.
= 0: The shifts are provided by the user via reverse communication.
= 1: Exact shifts with respect to the current Hessenberg matrix H.
iparam[1]: Not used.
iparam[2] (mxiter):
[in] Maximum number of Arnoldi update iterations allowed.
[out] Actual number of iterations taken.
iparam[3] (nb): [in] Blocksize to be used in the recurrence. (currently works only for nb = 1)
iparam[4] (nconv): [out] The number of Ritz values that satisfy the convergence criterion.
iparam[5]: Not used.
iparam[6] (mode): [in] Type of eigenvalue problem (mode = 1, ..., 3)
iparam[7] (np): [out] When ido = 3 and iparam[0] = 0, returns the number of shifts the user is to provide. (0 < np <= ncv - nev)
iparam[8] (numop): [out] Total number of OP*x operations.
iparam[9] (numopb): [out] Total number of B*x operations if bmat = 'G'.
iparam[10] (numreo): [out] Total number of steps of re-orthogonalization.
[out]ipntr[]Array ipntr[lipntr] (lipntr >= 14)
Pointer to mark the starting locations in the work array for matrices/vectors used by the Arnoldi iteration (1-based index).
ipntr[0]: Pointer to the current operand vector x in workd.
ipntr[1]: Pointer to the current result vector y in workd.
ipntr[2]: Pointer to the vector B*x in workd when used in the shift-and-invert mode.
ipntr[3]: Pointer to the next available location in workl that is untouched by the program.
ipntr[4]: Pointer to the ncv by ncv upper Hessenberg matrix H in workl.
ipntr[5]: Pointer to the Ritz value array in workl.
ipntr[6]: Pointer to the (projected) Ritz vector array Q.
ipntr[7]: Pointer to the error bounds array in workl.
ipntr[8], ..., ipntr[12]: Referenced only by zneupd.
ipntr[13]: Pointer to the np shifts in workl.
[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 >= 3*ncv^2 + 5*ncv)
[out]rwork[]Array rwork[lrwork] (lrwork >= ncv)
Private (replicated) work array.
[in,out]info[in]
= 0: A random initial residual vector is used.
!= 0: resid[] contains the initial residual vector, possibly from a previous run.
[out] Return code.
= 0: Successful exit.
< 0: The (-info)-th argument is invalid.
= 1: Maximum number of iterations taken. iparam[4] returns the number of converged Ritz values.
= 3: No shifts could be applied during a cycle of the implicitly restarted Arnoldi 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 an Arnoldi factorization. iparam[4] returns the size of the current factorization.
= 13: Error return from LAPACK eigenvalue calculation.
Reference
ARPACK-NG (https://github.com/opencollab/arpack-ng)