51 int nTerms = 0.5 * (
p_ + 1) * (2 *
p_ + 2);
65 for (
int j = 0; j <=
p_; j++)
67 for (
int k = -j; k <= j; k++)
69 std::complex<Mdouble> result = {0.0, 0.0};
70 int location = j * j + (k + j);
71 for (
int n = j;
n <=
p_;
n++)
73 for (
int m = (k - j +
n); m <= (k -
n + j); m++)
75 int location_O =
n *
n + (m +
n);
76 int location_A1 = (
n - j) * (
n - j) + ((m - k) + (
n - j));
77 int location_A2 = location;
78 int location_Y = location_A1;
79 int location_A3 = location_O;
80 std::complex<Mdouble> J = std::pow(
constants::i, std::abs(m) - std::abs(m - k) - std::abs(k));
90 std::pow(rho,
n - j) / (std::pow(-1,
n + j) * (*squaredFactorials_)(location_A3));
94 translatedLocalExpansionCoefficients[location] = result;
97 return translatedLocalExpansionCoefficients;
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
double Mdouble
Definition: GeneralDefine.h:34
Definition: NumericalVector.h:64
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Mdouble beta(Mdouble z, Mdouble w)
This is the beta function, returns the approximation based on cmath's implementation of ln(gamma)
Definition: ExtendedMath.cc:164
Definition: ExtendedMath.h:200
NumericalVector< std::complex< Mdouble > > sphericalHarmonics(int p, Mdouble theta, Mdouble phi)
Definition: ExtendedMath.cc:445