Skip to content
Snippets Groups Projects
Commit 1775dc97 authored by Rene Brun's avatar Rene Brun
Browse files

From Christian Holm

Fix a bug in the code generator


git-svn-id: http://root.cern.ch/svn/root/trunk@11163 27541ba8-7e3a-0410-8455-c3a389f83636
parent 28b34470
No related branches found
No related tags found
No related merge requests found
// @(#)root/hist:$Name: $:$Id: TMultiDimFit.cxx,v 1.12 2004/08/23 16:01:09 brun Exp $
// @(#)root/hist:$Name: $:$Id: TMultiDimFit.cxx,v 1.13 2005/01/27 18:55:14 brun Exp $
// Author: Christian Holm Christensen 07/11/2000
//____________________________________________________________________
......@@ -3319,7 +3319,7 @@ void TMultiDimFit::MakeRealCode(const char *filename,
outFile << "double " << prefix
<< "MDF(double *x) {" << endl
<< " double returnValue = " << prefix << "gDMean;" << endl
<< " int i = 0, j = 0;" << endl
<< " int i = 0, j = 0, k = 0;" << endl
<< " for (i = 0; i < " << prefix << "gNCoefficients ; i++) {"
<< endl
<< " // Evaluate the ith term in the expansion" << endl
......@@ -3340,11 +3340,11 @@ void TMultiDimFit::MakeRealCode(const char *filename,
<< " case 2: r = v; break; " << endl
<< " default: " << endl
<< " p2 = v; " << endl
<< " for (i = 3; i <= power; i++) { " << endl
<< " for (k = 3; k <= power; k++) { " << endl
<< " p3 = p2 * v;" << endl;
if (fPolyType == kLegendre)
outFile << " p3 = ((2 * i - 3) * p2 * v - (i - 2) * p1)"
<< " / (i - 1);" << endl;
outFile << " p3 = ((2 * k - 3) * p2 * v - (k - 2) * p1)"
<< " / (k - 1);" << endl;
if (fPolyType == kChebyshev)
outFile << " p3 = 2 * v * p2 - p1; " << endl;
outFile << " p1 = p2; p2 = p3; " << endl << " }" << endl
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment