22 int nzmax = nz > 1 ? 7*n : 5*n;
28 for (ii=0; ii<n; ii++) {
32 i = (ii - k*nx*ny) / nx;
33 j = ii - k*nx*ny - i*nx;
37 Acoo->
ir[nnz] = ii; Acoo->
jc[nnz] = jj; Acoo->
vv[nnz] = v; nnz++;
41 Acoo->
ir[nnz] = ii; Acoo->
jc[nnz] = jj; Acoo->
vv[nnz] = v; nnz++;
46 Acoo->
ir[nnz] = ii; Acoo->
jc[nnz] = jj; Acoo->
vv[nnz] = v; nnz++;
50 Acoo->
ir[nnz] = ii; Acoo->
jc[nnz] = jj; Acoo->
vv[nnz] = v; nnz++;
55 Acoo->
ir[nnz] = ii; Acoo->
jc[nnz] = jj; Acoo->
vv[nnz] = v; nnz++;
59 Acoo->
ir[nnz] = ii; Acoo->
jc[nnz] = jj; Acoo->
vv[nnz] = v; nnz++;
62 v = nz > 1 ? 6.0 : 4.0;
63 Acoo->
ir[nnz] = ii; Acoo->
jc[nnz] = ii; Acoo->
vv[nnz] = v; nnz++;
83 int exeiglap3(
int nx,
int ny,
int nz,
double a,
double b,
int *m,
double **vo) {
84 double thetax = 0.5 *
PI / (nx + 1.0);
85 double thetay = 0.5 *
PI / (ny + 1.0);
86 double thetaz = 0.5 *
PI / (nz + 1.0);
87 int i, j, k, l=0, n=nx*ny*nz;
89 double tx, ty, tz, ev;
91 for (i=1; i<=nx; i++) {
93 for (j=1; j<=ny; j++) {
95 for (k=1; k<=nz; k++) {
100 ev = 4*(tx*tx+ty*ty+tz*tz);
101 if (ev >= a - DBL_EPSILON && ev <= b + DBL_EPSILON) {
void sort_double(int n, double *v, int *ind)
int exeiglap3(int nx, int ny, int nz, double a, double b, int *m, double **vo)
Exact eigenvalues of Laplacean in interval [a b].
This file contains function prototypes and constant definitions internally used in EVSL...
#define Malloc(base, nmem, type)
int lapgen(int nx, int ny, int nz, cooMat *Acoo)
Laplacean Matrix generator.
#define Realloc(base, nmem, type)
sparse matrix format: the coordinate (COO) format, 0-based