32std::vector<std::vector<double>>
modPsi;
35 std::vector<double> &series) {
38 auto const deriv =
static_cast<double>(2 * n);
44 for (
int order = 1;; order += 1) {
45 auto const x_order =
static_cast<double>(2 * order);
46 auto const coeff = -2 *
hzeta(x_order + 1, 2);
49 series.push_back(coeff);
58 for (
int order = 0;; order++) {
60 auto const x_order =
static_cast<double>(2 * order);
61 auto const coeff = pref *
hzeta(1 + deriv + x_order, 2);
65 series.push_back(-binom * coeff);
68 pref *= (1.0 + deriv / (x_order + 1));
69 pref *= (1.0 + deriv / (x_order + 2));
75 std::vector<double> &series) {
76 auto const deriv =
static_cast<double>(2 * n + 1);
79 auto pref = 2 * deriv * (1 + deriv);
81 for (
int order = 0;; order++) {
83 auto const x_order =
static_cast<double>(2 * order + 1);
84 auto const coeff = pref *
hzeta(1 + deriv + x_order, 2);
89 series.push_back(-binom * coeff);
91 pref *= (1.0 + deriv / (x_order + 1));
92 pref *= (1.0 + deriv / (x_order + 2));
97 auto const old_n =
static_cast<int>(
modPsi.size() >> 1);
102 for (
int n = 0; n < old_n; n++)
103 binom *= (-0.5 - n) /
static_cast<double>(n + 1);
105 for (
int n = old_n; n < new_n; n++) {
108 binom *= (-0.5 - n) /
static_cast<double>(n + 1);
This file contains the defaults for ESPResSo.
#define ROUND_ERROR_PREC
Precision for capture of round off errors.
std::vector< std::vector< double > > modPsi
Table of the Taylor expansions of the modified polygamma functions.
static void preparePolygammaOdd(int n, double binom, std::vector< double > &series)
static void preparePolygammaEven(int n, double binom, std::vector< double > &series)
void create_mod_psi_up_to(int new_n)
Create both the even and odd polygamma functions up to order 2*new_n
Common parts of the MMM family of methods for the electrostatic interaction: MMM1D and ELC.
DEVICE_QUALIFIER constexpr T gamma()
Euler-Mascheroni constant.
double hzeta(double s, double q)
Hurwitz zeta function.
This file contains implementations for some special functions which are needed by the MMM family of a...