48 LegendrePolynomial::LegendrePolynomial(
int maxPower) : maxPower_(maxPower) {
49 assert(maxPower >= 0);
50 GeneratePolynomials(maxPower_);
53 void LegendrePolynomial::GeneratePolynomials(
int maxPower) {
54 GenerateFirstTwoTerms();
61 for (
int i = 2; i <= maxPower; ++i) {
63 RealType tmp1 = (2.0 * i - 1.0) / i;
64 RealType tmp2 = (i - 1.0) / i;
65 pn = polyList_[i - 1] * x * tmp1 - polyList_[i - 2] * tmp2;
66 polyList_.push_back(pn);
70 void LegendrePolynomial::GenerateFirstTwoTerms() {
73 polyList_.push_back(p0);
77 polyList_.push_back(p1);
void setCoefficient(int exponent, const Real &coefficient)
Set the coefficent of the specified exponent, if the coefficient is already there,...
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.