Skip to content

Commit

Permalink
Undefined symbol CINTsr_rys_roots (fix issue #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Jun 4, 2021
1 parent bcf9918 commit 369b934
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/rys_roots.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,34 +73,6 @@ static int segment_solve(int n, double x, double lower, double *u, double *w,
return error;
}

int _CINTsr_rys_roots_batch(CINTEnvVars *envs, double *x, double *theta, double *u, double *w, int count)
{
int nroots = envs->nrys_roots;
double expcutoff = envs->expcutoff;
double roots[MXRYSROOTS * 2];
double *weights = roots + nroots;
int i, k;
int all_negligible = 1;

for (i = 0; i < count; i++) {
// very small erfc() leads to ~0 weights
if (x[i] * theta[i] < expcutoff) {
all_negligible = 0;
CINTsr_rys_roots(nroots, x[i], sqrt(theta[i]), roots, weights);
for (k = 0; k < nroots; k++) {
u[k*SIMDD+i] = roots[k];
w[k*SIMDD+i] = weights[k];
}
} else {
for (k = 0; k < nroots; k++) {
u[k*SIMDD+i] = 0;
w[k*SIMDD+i] = 0;
}
}
}
return all_negligible;
}

void _CINTrys_roots_batch(int nroots, double *x, double *u, double *w, int count)
{
double roots[MXRYSROOTS * 2];
Expand Down Expand Up @@ -250,7 +222,35 @@ void CINTsr_rys_roots(int nroots, double x, double lower, double *u, double *w)
#endif
}
}
#endif

int _CINTsr_rys_roots_batch(CINTEnvVars *envs, double *x, double *theta, double *u, double *w, int count)
{
int nroots = envs->nrys_roots;
double expcutoff = envs->expcutoff;
double roots[MXRYSROOTS * 2];
double *weights = roots + nroots;
int i, k;
int all_negligible = 1;

for (i = 0; i < count; i++) {
// very small erfc() leads to ~0 weights
if (x[i] * theta[i] < expcutoff) {
all_negligible = 0;
CINTsr_rys_roots(nroots, x[i], sqrt(theta[i]), roots, weights);
for (k = 0; k < nroots; k++) {
u[k*SIMDD+i] = roots[k];
w[k*SIMDD+i] = weights[k];
}
} else {
for (k = 0; k < nroots; k++) {
u[k*SIMDD+i] = 0;
w[k*SIMDD+i] = 0;
}
}
}
return all_negligible;
}
#endif // WITH_RANGE_COULOMB

static void rys_root1(double X, double *roots, double *weights)
{
Expand Down

0 comments on commit 369b934

Please sign in to comment.