Logo ROOT   6.10/09
Reference Guide
ChebyshevPol.cxx
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: Fons Rademakers, 12/2012
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2012, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 //////////////////////////////////////////////////////////////////////////
13 // //
14 // Functions for the evaluation of the Chebyshev polynomials and the //
15 // ChebyshevPol class which can be used for creating a TF1. //
16 // //
17 //////////////////////////////////////////////////////////////////////////
18 
19 #include "Math/ChebyshevPol.h"
20 
21 namespace ROOT {
22  namespace Math {
23  namespace Chebyshev {
24  template<> double T<0> (double ) { return 1;}
25  template<> double T<1> (double x) { return x;}
26  template<> double T<2> (double x) { return 2.0*x*x -1;}
27  template<> double T<3> (double x) { return 4.0*x*x*x -3.0*x;}
28 
29  template<> double Eval<0> (double , const double *c) { return c[0];}
30  template<> double Eval<1> (double x, const double *c) { return c[1]*x + c[0];}
31  template<> double Eval<2> (double x, const double *c) { return c[2]*Chebyshev::T<2>(x) + c[1]*x + c[0];}
32  template<> double Eval<3> (double x, const double *c) { return c[3]*Chebyshev::T<3>(x) + Eval<2>(x,c); }
33  }
34  }
35 }
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
double Eval< 1 >(double x, const double *c)
double T< 2 >(double x)
double Eval< 2 >(double x, const double *c)
Double_t x[n]
Definition: legend1.C:17
double Eval< 0 >(double, const double *c)
double T< 0 >(double)
Namespace for new Math classes and functions.
double Eval< 3 >(double x, const double *c)
double T< 3 >(double x)
double T< 1 >(double x)