MUQ  0.4.3
Jacobi.cpp
Go to the documentation of this file.
2 
3 using namespace muq::Approximation;
4 
5 
6 double Jacobi::DerivativeEvaluate(int const polyOrder, int const derivOrder, double const x) const {
7 
8  if((derivOrder > polyOrder) || (polyOrder==0))
9  return 0.0;
10 
11  double c = std::tgamma(a+b+polyOrder+1+derivOrder) / (std::pow(2.0, derivOrder) * std::tgamma(a+b+polyOrder+1));
12 
13  return c * Jacobi(a + derivOrder, b+derivOrder).BasisEvaluate(polyOrder-derivOrder, x);
14 }
15 
16 
17 double Jacobi::ak(unsigned int polyOrder) const{
18  const double den = 2.0*polyOrder*(polyOrder + a + b);
19  //return (2.0*polyOrder + a + b - 1.0)*(2.0*polyOrder + a + b) / den1;
20  return (2.0*polyOrder+a+b-1)*(2.0*polyOrder+a+b)/den;
21 }
22 double Jacobi::bk(unsigned int polyOrder) const{
23  const double den = 2.0*polyOrder*(polyOrder + a + b)*(2.0*polyOrder + a + b - 2.0);
24  return (a*a-b*b) * (2.0*polyOrder + a + b - 1.0) / den;
25 }
26 double Jacobi::ck(unsigned int polyOrder) const{
27  const double den = polyOrder*(polyOrder + a + b)*(2.0*polyOrder + a + b - 2.0);
28  return (polyOrder + a-1.0)*(polyOrder + b-1.0)*(2.0*polyOrder + a + b) / den;
29 }
30 
31 
32 double Jacobi::phi0(double x) const {
33  return 1.0;
34 }
35 
36 double Jacobi::phi1(double x) const {
37  return (0.5*(a+b)+1.0)*x + 0.5*(a-b);
38 }
39 
40 double Jacobi::Normalization(unsigned int polyOrder) const {
41  return (std::pow(2.0, a+b+1) / (2*polyOrder + a + b +1)) * std::tgamma(polyOrder+a+1)*std::tgamma(polyOrder+b+1)/(std::tgamma(polyOrder+a+b+1) * std::tgamma(polyOrder + 1));
42 }
43 
44 
45 REGISTER_SCALARBASIS_FAMILY(Jacobi)
Family of Jacobi orthogonal polynomials.
Definition: Jacobi.h:13
virtual double ck(unsigned int k) const override
Implement .
Definition: Jacobi.cpp:26
virtual double ak(unsigned int k) const override
Implement .
Definition: Jacobi.cpp:17
virtual double phi1(double x) const override
Implement .
Definition: Jacobi.cpp:36
virtual double phi0(double x) const override
Implement .
Definition: Jacobi.cpp:32
virtual double Normalization(unsigned int polyOrder) const override
Definition: Jacobi.cpp:40
virtual double bk(unsigned int k) const override
Implement .
Definition: Jacobi.cpp:22
virtual double DerivativeEvaluate(int const polyOrder, int const derivOrder, double const x) const override
Definition: Jacobi.cpp:6
Jacobi(const double aIn=1.0, const double bIn=1.0)
Definition: Jacobi.h:19