Logo ROOT  
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 }
c
#define c(i)
Definition: RSha256.hxx:119
ROOT::Math::Chebyshev::T< 0 >
double T< 0 >(double)
Definition: ChebyshevPol.cxx:42
ROOT::Math::Chebyshev::Eval< 2 >
double Eval< 2 >(double x, const double *c)
Definition: ChebyshevPol.cxx:49
ROOT::Math::Chebyshev::Eval< 3 >
double Eval< 3 >(double x, const double *c)
Definition: ChebyshevPol.cxx:50
x
Double_t x[n]
Definition: legend1.C:17
ROOT::Math::Chebyshev::T< 3 >
double T< 3 >(double x)
Definition: ChebyshevPol.cxx:45
ROOT::Math::Chebyshev::T< 2 >
double T< 2 >(double x)
Definition: ChebyshevPol.cxx:44
ROOT::Math::Chebyshev::T< 1 >
double T< 1 >(double x)
Definition: ChebyshevPol.cxx:43
ChebyshevPol.h
ROOT::Math::Chebyshev::Eval< 1 >
double Eval< 1 >(double x, const double *c)
Definition: ChebyshevPol.cxx:48
ROOT
VSD Structures.
Definition: StringConv.hxx:21
Math
ROOT::Math::Chebyshev::Eval< 0 >
double Eval< 0 >(double, const double *c)
Definition: ChebyshevPol.cxx:47