Gromacs
2020.4

#include "config.h"
Selected routines from ARPACK.
This file contains a subset of ARPACK functions to perform diagonalization and SVD for sparse matrices in Gromacs.
Consult the main ARPACK site for detailed documentation: http://www.caam.rice.edu/software/ARPACK/
Below, we just list the options and any specific differences from ARPACK. The code is essentially the same, but the routines have been made threadsafe by using extra workspace arrays.
Functions  
void  dsaupd (int *ido, const char *bmat, int *n, const char *which, int *nev, double *tol, double *resid, int *ncv, double *v, int *ldv, int *iparam, int *ipntr, double *workd, int *iwork, double *workl, int *lworkl, int *info) 
Implicitly Restarted Arnoldi Iteration, double precision. More...  
void  dseupd (int *rvec, const char *howmny, int *select, double *d, double *z, int *ldz, double *sigma, const char *bmat, int *n, const char *which, int *nev, double *tol, double *resid, int *ncv, double *v, int *ldv, int *iparam, int *ipntr, double *workd, double *workl, int *lworkl, int *info) 
Get eigenvalues/vectors after Arnoldi iteration, double prec. More...  
void  ssaupd (int *ido, const char *bmat, int *n, const char *which, int *nev, float *tol, float *resid, int *ncv, float *v, int *ldv, int *iparam, int *ipntr, float *workd, int *iwork, float *workl, int *lworkl, int *info) 
Implicitly Restarted Arnoldi Iteration, single precision. More...  
void  sseupd (int *rvec, const char *howmny, int *select, float *d, float *z, int *ldz, float *sigma, const char *bmat, int *n, const char *which, int *nev, float *tol, float *resid, int *ncv, float *v, int *ldv, int *iparam, int *ipntr, float *workd, float *workl, int *lworkl, int *info) 
Get eigenvalues/vectors after Arnoldi iteration, single prec. More...  
void dsaupd  (  int *  ido, 
const char *  bmat,  
int *  n,  
const char *  which,  
int *  nev,  
double *  tol,  
double *  resid,  
int *  ncv,  
double *  v,  
int *  ldv,  
int *  iparam,  
int *  ipntr,  
double *  workd,  
int *  iwork,  
double *  workl,  
int *  lworkl,  
int *  info  
) 
Implicitly Restarted Arnoldi Iteration, double precision.
Reverse communication interface for the Implicitly Restarted Arnoldi Iteration. For symmetric problems this reduces to a variant of the Lanczos method. See the ARPACK site for details.
ido  Reverse communication flag. Set to 0 first time. Upon return with ido=1 or ido=1 you should calculate Y=A*X and recall the routine. Return with ido=2 means Y=B*X should be calculated. ipntr[0] is the pointer in workd for X, ipntr[1] is the index for Y. Return with ido=99 means it finished. 
bmat  'I' for standard eigenproblem, 'G' for generalized. 
n  Order of eigenproblem. 
which  Which eigenvalues to calculate. 'LA' for largest algebraic, 'SA' for smallest algebraic, 'LM' for largest magnitude, 'SM' for smallest magnitude, and finally 'BE' (both ends) to calculate half from each end of the spectrum. 
nev  Number of eigenvalues to calculate. 0<nev<n. 
tol  Tolerance. Machine precision of it is 0. 
resid  Optional starting residual vector at input if info=1, otherwise a random one is used. Final residual vector on return. 
ncv  Number of columns in matrix v. 
v  N*NCV matrix. V contain the Lanczos basis vectors. 
ldv  Leading dimension of v. 
iparam  Integer array, size 11. Same contents as arpack. 
ipntr  Integer array, size 11. Points to starting locations in the workd/workl arrays. Same contents as arpack. 
workd  Double precision work array, length 3*n+4. Provide the same array for all calls, and don't touch it. IMPORTANT: This is 4 units larger than standard ARPACK! 
iwork  Integer work array, size 80. Provide the same array for all calls, and don't touch it. IMPORTANT: New argument compared to standard ARPACK! 
workl  Double precision work array, length lwork. 
lworkl  Length of the work array workl. Must be at least ncv*(ncv+8) 
info  Set info to 0 to use random initial residual vector, or to 1 if you provide a one. On output, info=0 means normal exit, 1 that max number of iterations was reached, and 3 that no shifts could be applied. Negative numbers correspond to errors in the arguments provided. 
void dseupd  (  int *  rvec, 
const char *  howmny,  
int *  select,  
double *  d,  
double *  z,  
int *  ldz,  
double *  sigma,  
const char *  bmat,  
int *  n,  
const char *  which,  
int *  nev,  
double *  tol,  
double *  resid,  
int *  ncv,  
double *  v,  
int *  ldv,  
int *  iparam,  
int *  ipntr,  
double *  workd,  
double *  workl,  
int *  lworkl,  
int *  info  
) 
Get eigenvalues/vectors after Arnoldi iteration, double prec.
See the ARPACK site for details. You must have finished the interative part with dsaupd() before calling this function.
rvec  1 if you want eigenvectors, 0 if not. 
howmny  'A' if you want all nvec vectors, 'S' if you provide a subset selection in select[]. 
select  Integer array, dimension nev. Indices of the eigenvectors to calculate. Fortran code means we start counting on 1. This array must be given even in howmny is 'A'. (Arpack documentation is wrong on this). 
d  Double precision array, length nev. Eigenvalues. 
z  Double precision array, n*nev. Eigenvectors. 
ldz  Leading dimension of z. Normally n. 
sigma  Shift if iparam[6] is 3,4, or 5. Ignored otherwise. 
bmat  Provide the same argument as you did to dsaupd() 
n  Provide the same argument as you did to dsaupd() 
which  Provide the same argument as you did to dsaupd() 
nev  Provide the same argument as you did to dsaupd() 
tol  Provide the same argument as you did to dsaupd() 
resid  Provide the same argument as you did to dsaupd() The array must not be touched between the two function calls! 
ncv  Provide the same argument as you did to dsaupd() 
v  Provide the same argument as you did to dsaupd() The array must not be touched between the two function calls! 
ldv  Provide the same argument as you did to dsaupd() 
iparam  Provide the same argument as you did to dsaupd() The array must not be touched between the two function calls! 
ipntr  Provide the same argument as you did to dsaupd() The array must not be touched between the two function calls! 
workd  Provide the same argument as you did to dsaupd() The array must not be touched between the two function calls! 
workl  Double precision work array, length lwork. The array must not be touched between the two function calls! 
lworkl  Provide the same argument as you did to dsaupd() 
info  Provide the same argument as you did to dsaupd() 
void ssaupd  (  int *  ido, 
const char *  bmat,  
int *  n,  
const char *  which,  
int *  nev,  
float *  tol,  
float *  resid,  
int *  ncv,  
float *  v,  
int *  ldv,  
int *  iparam,  
int *  ipntr,  
float *  workd,  
int *  iwork,  
float *  workl,  
int *  lworkl,  
int *  info  
) 
Implicitly Restarted Arnoldi Iteration, single precision.
Reverse communication interface for the Implicitly Restarted Arnoldi Iteration. For symmetric problems this reduces to a variant of the Lanczos method. See the ARPACK site for details.
ido  Reverse communication flag. Set to 0 first time. Upon return with ido=1 or ido=1 you should calculate Y=A*X and recall the routine. Return with ido=2 means Y=B*X should be calculated. ipntr[0] is the pointer in workd for X, ipntr[1] is the index for Y. Return with ido=99 means it finished. 
bmat  'I' for standard eigenproblem, 'G' for generalized. 
n  Order of eigenproblem. 
which  Which eigenvalues to calculate. 'LA' for largest algebraic, 'SA' for smallest algebraic, 'LM' for largest magnitude, 'SM' for smallest magnitude, and finally 'BE' (both ends) to calculate half from each end of the spectrum. 
nev  Number of eigenvalues to calculate. 0<nev<n. 
tol  Tolerance. Machine precision of it is 0. 
resid  Optional starting residual vector at input if info=1, otherwise a random one is used. Final residual vector on return. 
ncv  Number of columns in matrix v. 
v  N*NCV matrix. V contain the Lanczos basis vectors. 
ldv  Leading dimension of v. 
iparam  Integer array, size 11. Same contents as arpack. 
ipntr  Integer array, size 11. Points to starting locations in the workd/workl arrays. Same contents as arpack. 
workd  Single precision work array, length 3*n+4. Provide the same array for all calls, and don't touch it. IMPORTANT: This is 4 units larger than standard ARPACK! 
iwork  Integer work array, size 80. Provide the same array for all calls, and don't touch it. IMPORTANT: New argument compared to standard ARPACK! 
workl  Single precision work array, length lwork. 
lworkl  Length of the work array workl. Must be at least ncv*(ncv+8) 
info  Set info to 0 to use random initial residual vector, or to 1 if you provide a one. On output, info=0 means normal exit, 1 that max number of iterations was reached, and 3 that no shifts could be applied. Negative numbers correspond to errors in the arguments provided. 
void sseupd  (  int *  rvec, 
const char *  howmny,  
int *  select,  
float *  d,  
float *  z,  
int *  ldz,  
float *  sigma,  
const char *  bmat,  
int *  n,  
const char *  which,  
int *  nev,  
float *  tol,  
float *  resid,  
int *  ncv,  
float *  v,  
int *  ldv,  
int *  iparam,  
int *  ipntr,  
float *  workd,  
float *  workl,  
int *  lworkl,  
int *  info  
) 
Get eigenvalues/vectors after Arnoldi iteration, single prec.
See the ARPACK site for details. You must have finished the interative part with ssaupd() before calling this function.
rvec  1 if you want eigenvectors, 0 if not. 
howmny  'A' if you want all nvec vectors, 'S' if you provide a subset selection in select[]. 
select  Integer array, dimension nev. Indices of the eigenvectors to calculate. Fortran code means we start counting on 1. This array must be given even in howmny is 'A'. (Arpack documentation is wrong on this). 
d  Single precision array, length nev. Eigenvalues. 
z  Single precision array, n*nev. Eigenvectors. 
ldz  Leading dimension of z. Normally n. 
sigma  Shift if iparam[6] is 3,4, or 5. Ignored otherwise. 
bmat  Provide the same argument as you did to ssaupd() 
n  Provide the same argument as you did to ssaupd() 
which  Provide the same argument as you did to ssaupd() 
nev  Provide the same argument as you did to ssaupd() 
tol  Provide the same argument as you did to ssaupd() 
resid  Provide the same argument as you did to ssaupd() The array must not be touched between the two function calls! 
ncv  Provide the same argument as you did to ssaupd() 
v  Provide the same argument as you did to ssaupd() The array must not be touched between the two function calls! 
ldv  Provide the same argument as you did to ssaupd() 
iparam  Provide the same argument as you did to ssaupd() The array must not be touched between the two function calls! 
ipntr  Provide the same argument as you did to ssaupd() The array must not be touched between the two function calls! 
workd  Provide the same argument as you did to ssaupd() The array must not be touched between the two function calls! 
workl  Single precision work array, length lwork. The array must not be touched between the two function calls! 
lworkl  Provide the same argument as you did to ssaupd() 
info  Provide the same argument as you did to ssaupd() 