35 double *vv, uintptr_t *csrf90) {
46 *csrf90 = (uintptr_t) csr;
57 double *a, uintptr_t *csrf90) {
67 *csrf90 = (uintptr_t) csr;
144 LanTrbounds(50, *nsteps, 1e-10, vinit, 1, lmin, lmax, NULL);
162 int *nslices,
double *sli,
int *evint) {
165 Malloc(mu, *Mdeg+1,
double);
166 kpmdos(*Mdeg, 1, *nvec, xintv, mu, &ecount);
167 fprintf(stdout,
" estimated eig count in interval: %.15e \n",ecount);
170 int ierr =
spslicer(sli, mu, *Mdeg, xintv, *nslices, npts);
172 printf(
"spslicer error %d\n", ierr);
175 *evint = (int) (1 + ecount / (*nslices));
191 double *thresh_ext, uintptr_t *polf90) {
201 fprintf(stdout,
" polynomial deg %d, bar %e gam %e\n",
204 *polf90 = (uintptr_t) pol;
239 *ratf90 = (uintptr_t) rat;
253 double *tol, uintptr_t *polf90) {
255 double *lam, *Y, *res;
256 FILE *fstats = stdout;
266 ierr =
ChebLanTr(*mlan, *nev, xintv, *max_its, *tol, vinit,
267 pol, &nev2, &lam, &Y, &res, fstats);
270 printf(
"ChebLanTr error %d\n", ierr);
290 double *lam, *Y, *res;
291 FILE *fstats = stdout;
301 ierr =
ChebLanNr(xintv, *max_its, *tol, vinit,
302 pol, &nev2, &lam, &Y, &res, fstats);
305 printf(
"ChebLanNr error %d\n", ierr);
325 double *lam, *Y, *res;
326 FILE *fstats = stdout;
336 ierr =
RatLanNr(xintv, *max_its, *tol, vinit,
337 rat, &nev2, &lam, &Y, &res, fstats);
340 printf(
"RatLanNr error %d\n", ierr);
358 int *max_its,
double *tol, uintptr_t *ratf90) {
360 double *lam, *Y, *res;
361 FILE *fstats = stdout;
371 ierr =
RatLanTr(*lanm, *nev, xintv, *max_its, *tol, vinit,
372 rat, &nev2, &lam, &Y, &res, fstats);
375 printf(
"RatLanNr error %d\n", ierr);
int kpmdos(int Mdeg, int damping, int nvec, double *intv, double *mu, double *ecnt)
This function computes the coefficients of the density of states in the chebyshev basis...
void EVSLFORT() evsl_find_pol(double *xintv, double *thresh_int, double *thresh_ext, uintptr_t *polf90)
Fortran interface for find_pol.
void free_pol(polparams *pol)
void EVSLFORT() evsl_cheblannr(double *xintv, int *max_its, double *tol, uintptr_t *polf90)
Fortran interface for ChebLanNr the results will be saved in the internal variables.
void EVSLFORT() evsl_copy_result(double *val, double *vec)
copy the computed eigenvalues and vectors
void free_rat(ratparams *rat)
void(* MVFunc)(double *x, double *y, void *data)
matvec function prototype
int SetGenEig()
Set the problem to generalized eigenvalue problem.
int ChebLanTr(int lanm, int nev, double *intv, int maxit, double tol, double *vinit, polparams *pol, int *nev2, double **vals, double **W, double **resW, FILE *fstats)
Chebyshev polynomial filtering Lanczos process [Thick restart version].
int SetAMatrix(csrMat *A)
Set the matrix A.
void EVSLFORT() evsl_setbsol(void *func, void *data)
Fortran interface for SetBSol.
void EVSLFORT() evsl_setb_csr(uintptr_t *Bf90)
Fortran interface to set matrix B from a CSR matrix.
void rand_double(int n, double *v)
void EVSLFORT() evsl_setbmv(int *n, void *func, void *data)
Fortran interface for SetBMatvec.
int cooMat_to_csrMat(int cooidx, cooMat *coo, csrMat *csr)
convert coo to csr
int LanTrbounds(int lanm, int maxit, double tol, double *vinit, int bndtype, double *lammin, double *lammax, FILE *fstats)
Lanczos process for eigenvalue bounds [Thick restart version].
double * evsl_eigvec_computed
int find_pol(double *intv, polparams *pol)
Sets the values in pol.
void EVSLFORT() evsl_find_rat(double *intv, uintptr_t *ratf90)
Fortran interface for find_rat.
int SetBMatvec(int n, MVFunc func, void *data)
Set the user-input matvec routine and the associated data for B. Save them in evsldata.
int SetBMatrix(csrMat *B)
Set the B matrix.
void EVSLFORT() evsl_setamv(int *n, void *func, void *data)
Fortran interface for SetAMatvec.
void EVSLFORT() evsl_free_pol(uintptr_t *polf90)
Fortran interface for free_pol.
void EVSLFORT() evsl_setltsol(void *func, void *data)
Fortran interface for SetLTSol.
int EVSLStart()
Initialize evslData.
void EVSLFORT() evsl_kpm_spslicer(int *Mdeg, int *nvec, double *xintv, int *nslices, double *sli, int *evint)
Fortran interface for kpmdos and spslicer.
void free_csr(csrMat *csr)
memory deallocation for csr matrix
This file contains function prototypes and constant definitions internally used in EVSL...
void EVSLFORT() evsl_free_rat(uintptr_t *ratf90)
Fortran interface for free_rat.
void EVSLFORT() evsl_coo2csr(int *n, int *nnz, int *ir, int *jc, double *vv, uintptr_t *csrf90)
Fortran interface to convert a COO matrix to CSR the pointer of CSR will be returned.
void set_pol_def(polparams *pol)
set default values for polparams struct.
#define Malloc(base, nmem, type)
void EVSLFORT() evsl_lanbounds(int *nsteps, double *lmin, double *lmax)
Fortran interface for evsl_lanbounds.
int RatLanNr(double *intv, int maxit, double tol, double *vinit, ratparams *rat, int *nevOut, double **lamo, double **Wo, double **reso, FILE *fstats)
Rational filtering Lanczos process [NON-restarted version].
int SetLTSol(SolFuncR func, void *data)
Set the solve routine for LT.
void(* SolFuncR)(double *b, double *x, void *data)
function prototype for applying the solve B x = b
sparse matrix format: the compressed sparse row (CSR) format, 0-based
int EVSLFinish()
Finish EVSL.
void EVSLFORT() evsl_ratlantr(int *lanm, int *nev, double *xintv, int *max_its, double *tol, uintptr_t *ratf90)
Fortran interface for RatLanNr the results will be saved in the internal variables.
void EVSLFORT() evsl_cheblantr(int *mlan, int *nev, double *xintv, int *max_its, double *tol, uintptr_t *polf90)
Fortran interface for ChebLanTr the results will be saved in the internal variables.
int ChebLanNr(double *intv, int maxit, double tol, double *vinit, polparams *pol, int *nevOut, double **lamo, double **Wo, double **reso, FILE *fstats)
int SetBSol(SolFuncR func, void *data)
Set the solve routine and the associated data for B.
void EVSLFORT() evsl_seta_csr(uintptr_t *Af90)
Fortran interface to set matrix A from a CSR matrix.
int spslicer(double *sli, double *mu, int Mdeg, double *intv, int n_int, int npts)
given the dos function defined by mu find a partitioning of sub-interval [a,b] of the spectrum so eac...
int RatLanTr(int lanm, int nev, double *intv, int maxit, double tol, double *vinit, ratparams *rat, int *nev2, double **vals, double **W, double **resW, FILE *fstats)
RatLanTR filtering Lanczos process [Thick restart version].
void EVSLFORT() evsl_free_csr(uintptr_t *csrf90)
Fortran interface to free a CSR matrix.
void EVSLFORT() evsl_get_nev(int *nev)
Get the number of last computed eigenvalues.
void EVSLFORT() evsl_start()
Fortran interface for EVSLStart.
void EVSLFORT() evsl_ratlannr(double *xintv, int *max_its, double *tol, uintptr_t *ratf90)
Fortran interface for RatLanNr the results will be saved in the internal variables.
void EVSLFORT() evsl_set_geneig()
Fortran interface for SetGenEig.
evslData evsldata
global variable of EVSL
void EVSLFORT() evsl_finish()
Fortran interface for EVSLFinish.
parameters for polynomial filter
void set_ratf_def(ratparams *rat)
Sets default values for ratparams struct.
int find_ratf(double *intv, ratparams *rat)
void EVSLFORT() evsl_arr2csr(int *n, int *ia, int *ja, double *a, uintptr_t *csrf90)
Fortran interface to return a CSR struct from (ia,ja,a) the pointer of CSR will be returned...
sparse matrix format: the coordinate (COO) format, 0-based
double * evsl_eigval_computed
int SetAMatvec(int n, MVFunc func, void *data)
Set the user-input matvec routine and the associated data for A. Save them in evsldata.
parameters for rational filter