15 const std::vector<double> ¶ms,
const size_t &dim)
18 d_a0 = params.empty() ? double(dim + 1) : params[0];
26 return d_a0 / double(i + 1);
30 const std::vector<double> ¶ms,
const size_t &dim)
39 }
else if (dim == 2) {
42 }
else if (dim == 3) {
48 if (params.size() < 2)
56 return d_a0 + d_a1 * r;
60 return (d_a0 /
double(i + 1)) + (d_a1 / double(i + 2));
64 const std::vector<double> ¶ms,
const size_t &dim)
75 (std::sqrt(M_PI *
d_beta) * std::erf(1.0 / std::sqrt(
d_beta)) -
76 2.0 * std::exp(-1.0 /
d_beta));
87 return d_alpha * std::exp(-r * r / d_beta);
92 double sq1 = std::sqrt(d_beta);
93 double sq2 = std::sqrt(M_PI);
99 return 0.5 * d_alpha * sq1 * sq2 * std::erf(1. / sq1);
103 return 0.5 * d_alpha * d_beta * (1. - std::exp(-1. / d_beta));
108 return 0.5 * d_alpha * d_beta * sq1 *
109 (0.5 * sq2 * std::erf(1. / sq1) -
110 (1. / sq1) * std::exp(-1. / d_beta));
114 return 0.5 * d_alpha * d_beta * d_beta *
115 (1. - (1. + 1. / d_beta) * std::exp(-1. / d_beta));
117 std::cerr <<
"Error: getMoment() accepts argument i from 0 to 3.\n";
A base class for computing influence function.
double getMoment(const size_t &i) const override
Returns the moment of influence function.
ConstInfluenceFn(const std::vector< double > ¶ms, const size_t &dim)
Constructor.
double getInfFn(const double &r) const override
Returns the value of influence function.
double d_a0
Constant such that J(r) = Constant.
double getInfFn(const double &r) const override
Returns the value of influence function.
GaussianInfluenceFn(const std::vector< double > ¶ms, const size_t &dim)
Constructor.
double getMoment(const size_t &i) const override
Returns the moment of influence function.
double d_a0
Constants such that J(r) = d_a0 + d_a1 * r.
double getInfFn(const double &r) const override
Returns the value of influence function.
double d_a1
Constants such that J(r) = d_a0 + d_a1 * r.
LinearInfluenceFn(const std::vector< double > ¶ms, const size_t &dim)
Constructor.
double getMoment(const size_t &i) const override
Returns the moment of influence function.