10 if (
k * 2 >
n)
k =
n-
k;
14 for(
int i = 2; i <=
k; ++i ) {
23 double scaling = std::pow( std::pow(2, order) *
24 std::tgamma(order+1) *
25 std::sqrt(M_PI), -0.5) * std::exp(-0.5*x*x);
27 return scaling *
polyBase->BasisEvaluate(order, x);
35 if(derivOrder>polyOrder)
39 return std::sqrt(0.5*polyOrder) *
BasisEvaluate(polyOrder-1,x) +
45 double nfact = std::tgamma(polyOrder + 1);
47 for(
int i=0; i<=derivOrder; ++i){
48 result +=
nChoosek(derivOrder, i) * std::pow(2, 0.5*(derivOrder-i)) *
49 std::sqrt(nfact / std::tgamma(polyOrder - derivOrder + i + 1)) *
virtual double BasisEvaluate(int const order, double const x) const override
Evaluate the hermite function.
std::shared_ptr< PhysicistHermite > polyBase
static unsigned nChoosek(unsigned n, unsigned k)
virtual double DerivativeEvaluate(int const polyOrder, int const derivOrder, double const x) const override