MUQ  0.4.3
Monomial.cpp
Go to the documentation of this file.
2 
3 using namespace muq::Approximation;
4 
6 
8 
9 double Monomial::DerivativeEvaluate(int const polyOrder, int const derivOrder, double const x) const {
10 
11  if((derivOrder > polyOrder) || (polyOrder==0))
12  return 0.0;
13 
14  double c = 1.0;
15  for(int k=polyOrder; k>polyOrder-derivOrder; --k)
16  c *= k;
17 
18  return c*std::pow(x, polyOrder-derivOrder);
19 
20 }
21 
22 double Monomial::BasisEvaluate(int const order, double const x) const {
23  return std::pow(x, order);
24 }
25 
26 REGISTER_SCALARBASIS_FAMILY(Monomial)
Family of monomial polynomials, i.e. () , , , ect. ...)
Definition: Monomial.h:14
virtual double DerivativeEvaluate(int const polyOrder, int const derivOrder, double const x) const override
Definition: Monomial.cpp:9
virtual double BasisEvaluate(int const order, double const x) const override
Evaluate the specific basis type (must be implemented by the child)
Definition: Monomial.cpp:22