class ROOT::Math::Polynomial: public ROOT::Math::ParamFunction


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.


@ingroup CppFunctions

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 voidROOT::Math::IGradientFunctionOneDim::FdF(double x, double& f, double& df) const
const vector<std::complex<double> >&FindNumRoots()
vector<double>FindRealRoots()
const vector<std::complex<double> >&FindRoots()
const vector<double>&ROOT::Math::ParamFunction::GetParGradient(double x)
voidROOT::Math::IGradientOneDim::Gradient(const double* x, double* g) const
virtual unsigned intROOT::Math::ParamFunction::NPar() const
virtual doubleoperator()(double x, const double* p)
ROOT::Math::Polynomial&operator=(const ROOT::Math::Polynomial&)
unsigned intOrder() const
voidROOT::Math::IParametricGradFunctionOneDim::ParameterGradient(double x, double* grad) const
voidROOT::Math::IParametricGradFunctionOneDim::ParameterGradient(double* x, double* grad) const
virtual stringROOT::Math::IBaseParam::ParameterName(unsigned int i) const
virtual const double*ROOT::Math::ParamFunction::Parameters() const
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)
boolROOT::Math::ParamFunction::ProvidesParameterGradient() const
virtual voidROOT::Math::ParamFunction::SetParameters(const double* p)
private:
virtual doubleDoDerivative(double x) const
virtual doubleDoEval(double x) const
virtual voidDoParameterGradient(double x, double* g) const

Data Members

protected:
vector<double>ROOT::Math::ParamFunction::fParGradient
vector<double>ROOT::Math::ParamFunction::fParams
private:
vector<double>fDerived_params
unsigned intfOrder
vector<std::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()
{}
double operator()(double x, const double* p)
    /**
       Copy constructor
    *
    Polynomial(const Polynomial &);
    /**
       Copy operator
    *
    Polynomial & operator = (const Polynomial &);
const std::vector<std::complex <double> > & FindRoots()
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()
Order of Polynomial

{ return fOrder; }
IGenFunction * Clone()
double DoEval(double x) const
double DoDerivative(double x) const
void DoParameterGradient(double x, double* g) const

Last update: root/mathmore:$Id: Polynomial.h 21503 2007-12-19 17:34:54Z moneta $
Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.