ROOT » MATH » MATHMORE » ROOT::Math::Polynomial

class ROOT::Math::Polynomial: public ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>, public ROOT::Math::IGradientOneDim


     Parametric Function class describing polynomials of order n.

     <em>P(x) = p[0] + p[1]*x + p[2]*x**2 + ....... + p[n]*x**n</em>

     The class implements also the derivatives, \a dP(x)/dx and the \a dP(x)/dp[i].

     The class provides also the method to find the roots of the polynomial.
     It uses analytical methods up to quartic polynomials.

     Implements both the Parameteric function interface and the gradient interface
     since it provides the analytical gradient with respect to x


     @ingroup ParamFunc

Function Members (Methods)

public:
virtual~Polynomial()
virtual ROOT::Math::IGenFunction*Clone() const
doubleROOT::Math::IGradientOneDim::Derivative(double x) const
doubleROOT::Math::IGradientOneDim::Derivative(const double* x) const
virtual voidFdF(double x, double& f, double& df) const
const vector<complex<double> >&FindNumRoots()
vector<double>FindRealRoots()
const vector<complex<double> >&FindRoots()
voidROOT::Math::IGradientOneDim::Gradient(const double* x, double* g) const
ROOT::Math::IBaseFunctionOneDimROOT::Math::IBaseFunctionOneDim::IBaseFunctionOneDim()
ROOT::Math::IBaseFunctionOneDimROOT::Math::IBaseFunctionOneDim::IBaseFunctionOneDim(const ROOT::Math::IBaseFunctionOneDim&)
ROOT::Math::IBaseParamROOT::Math::IBaseParam::IBaseParam()
ROOT::Math::IBaseParamROOT::Math::IBaseParam::IBaseParam(const ROOT::Math::IBaseParam&)
ROOT::Math::IGradientOneDimROOT::Math::IGradientOneDim::IGradientOneDim()
ROOT::Math::IGradientOneDimROOT::Math::IGradientOneDim::IGradientOneDim(const ROOT::Math::IGradientOneDim&)
ROOT::Math::IParametricFunctionOneDimROOT::Math::IParametricFunctionOneDim::IParametricFunctionOneDim()
ROOT::Math::IParametricFunctionOneDimROOT::Math::IParametricFunctionOneDim::IParametricFunctionOneDim(ROOT::Math::IParametricFunctionOneDim&&)
ROOT::Math::IParametricFunctionOneDimROOT::Math::IParametricFunctionOneDim::IParametricFunctionOneDim(const ROOT::Math::IParametricFunctionOneDim&)
ROOT::Math::IParametricGradFunctionOneDimROOT::Math::IParametricGradFunctionOneDim::IParametricGradFunctionOneDim()
ROOT::Math::IParametricGradFunctionOneDimROOT::Math::IParametricGradFunctionOneDim::IParametricGradFunctionOneDim(const ROOT::Math::IParametricGradFunctionOneDim&)
virtual unsigned intROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>::NPar() const
doubleROOT::Math::IParametricFunctionOneDim::operator()(double x, const double* p) const
doubleROOT::Math::IParametricFunctionOneDim::operator()(const double* x, const double* p) const
ROOT::Math::Polynomial&operator=(const ROOT::Math::Polynomial&)
unsigned intOrder() const
doubleROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative(double x, unsigned int ipar = 0) const
doubleROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative(const double* x, unsigned int ipar = 0) const
doubleROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative(double x, const double* p, unsigned int ipar = 0) const
doubleROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative(const double* x, const double* p, unsigned int ipar = 0) const
voidROOT::Math::IParametricGradFunctionOneDim::ParameterGradient(double x, double* grad) const
voidROOT::Math::IParametricGradFunctionOneDim::ParameterGradient(const double* x, double* grad) const
virtual voidROOT::Math::IParametricGradFunctionOneDim::ParameterGradient(double x, const double* p, double* grad) const
voidROOT::Math::IParametricGradFunctionOneDim::ParameterGradient(const double* x, const double* p, double* grad) const
virtual stringROOT::Math::IBaseParam::ParameterName(unsigned int i) const
virtual const double*ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>::Parameters() const
ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(unsigned int npar = 0)
ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(const ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>&)
ROOT::Math::PolynomialPolynomial(unsigned int n = 0)
ROOT::Math::PolynomialPolynomial(const ROOT::Math::Polynomial&)
ROOT::Math::PolynomialPolynomial(double a, double b)
ROOT::Math::PolynomialPolynomial(double a, double b, double c)
ROOT::Math::PolynomialPolynomial(double a, double b, double c, double d)
ROOT::Math::PolynomialPolynomial(double a, double b, double c, double d, double e)
virtual voidROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>::SetParameters(const double* p)
private:
virtual doubleDoDerivative(double x) const
virtual doubleDoEvalPar(double x, const double* p) const
virtual doubleDoParameterDerivative(double x, const double* p, unsigned int ipar) const

Data Members

private:
vector<double>fDerived_params
unsigned intfOrder
vector<complex<double> >fRoots

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Polynomial(unsigned int n = 0)
      Construct a Polynomial function of order n.
      The number of Parameters is n+1.

Polynomial(double a, double b)
      Construct a Polynomial of degree  1 : a*x + b

Polynomial(double a, double b, double c)
      Construct a Polynomial of degree  2 : a*x**2 + b*x + c

Polynomial(double a, double b, double c, double d)
      Construct a Polynomial of degree  3 : a*x**3 + b*x**2 + c*x + d

Polynomial(double a, double b, double c, double d, double e)
      Construct a Polynomial of degree  4 : a*x**4 + b*x**3 + c*x**2 + dx  + e

virtual ~Polynomial()
{}
const std::vector<std::complex <double> > & FindRoots()
 use default copy-ctor and assignment operators
   using ParamFunction::operator();

      Find the polynomial roots.
      For n <= 4, the roots are found analytically while for larger order an iterative numerical method is used
      The numerical method used is from GSL (see <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_6.html#SEC53" )

std::vector<double > FindRealRoots()
      Find the only the real polynomial roots.
      For n <= 4, the roots are found analytically while for larger order an iterative numerical method is used
      The numerical method used is from GSL (see <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_6.html#SEC53" )

const std::vector<std::complex <double> > & FindNumRoots()
      Find the polynomial roots using always an iterative numerical methods
      The numerical method used is from GSL (see <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_6.html#SEC53" )

unsigned int Order() const
{ return fOrder; }
IGenFunction * Clone() const
void FdF(double x, double& f, double& df) const
       Optimized method to evaluate at the same time the function value and derivative at a point x.
       Implement the interface specified bby ROOT::Math::IGradientOneDim.
       In the case of polynomial there is no advantage to compute both at the same time

double DoEvalPar(double x, const double* p) const
double DoDerivative(double x) const
double DoParameterDerivative(double x, const double* p, unsigned int ipar) const