39 (i%2) != order %2)
return 0;
50 map<
G4int, map<G4int, G4double> >* cache)
57 if(l<0 || m<-l || m>l)
return 0;
81 if(m==0){
return 0.5*(3.*x2 - 1.);}
82 if(m==1){
return -3.*x*sqrt(1.-x2);}
86 if(m==0){
return 0.5*(5.*x*x2 - 3.*x);}
87 if(m==1){
return -1.5*(5.*x2-1.)*sqrt(1.-x2);}
88 if(m==2){
return 15.*x*(1.-x2);}
89 return -15.*(1.-x2)*sqrt(1.-x2);
92 if(m==0){
return 0.125*(35.*x2*x2 - 30.*x2 + 3.);}
93 if(m==1){
return -2.5*(7.*x*x2-3.*x)*sqrt(1.-x2);}
94 if(m==2){
return 7.5*(7.*x2-1.)*(1.-x2);}
95 if(m==3){
return -105.*x*(1.-x2)*sqrt(1.-x2);}
96 return 105.*(1. - 2.*x2 + x2*x2);
102 if(m==l)
return (l%2 ? -1. : 1.) *
108 if(cache != NULL && cache->count(l) > 0 && (*cache)[l].count(m) > 0) {
109 return (*cache)[l][m];
118 (*cache)[l][m] = value;
126 G4cout <<
"G4LegendrePolynomial::GetCoefficient(): "
127 <<
"I refuse to make a Legendre Polynomial of order "
136 for(
size_t iCoeff = 0; iCoeff < order+1; ++iCoeff) {
137 if((order % 2) == (iCoeff % 2)) {
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
G4GLOB_DLL std::ostream G4cout
G4double EvalAssocLegendrePoly(G4int l, G4int m, G4double x, std::map< G4int, std::map< G4int, G4double > > *cache=NULL)
G4double GetCoefficient(size_t i, size_t order)
G4double EvalLegendrePoly(G4int order, G4double x)
std::vector< std::vector< G4double > > fCoefficients
void BuildUpToOrder(size_t order)
static G4Pow * GetInstance()
G4double factorial(G4int Z) const
G4double logfactorial(G4int Z) const