ROOT
6.30.04
Reference Guide
All
Namespaces
Files
Pages
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
}
ChebyshevPol.h
math
mathcore
src
ChebyshevPol.cxx
Generated on Tue May 5 2020 14:03:01 for ROOT by
1.8.5