2727#include " MathUtils.h"
2828#include " pdffit.h"
2929
30- static vector<double > stack ;
30+ static vector<double > vstack ;
3131static vector<vector<double > > dstack; // stack with derivative vectors
3232static bool deriv;
3333
@@ -81,7 +81,7 @@ string Fit::substitute_pars(string &expr)
8181 if (i==used.size ())
8282 {
8383 used.push_back (ipar);
84- stack .push_back (p[ipar]);
84+ vstack .push_back (p[ipar]);
8585 }
8686
8787 expr.replace (bopen,bclose-bopen,stackvar (i));
@@ -177,12 +177,12 @@ double Fit::getnum(istringstream &inexpr, vector<double> &dnumdp)
177177 inexpr >> id;
178178 if (!inexpr)
179179 throw parseError (inexpr.str ());
180- num = iter->second .func (stack [id]);
180+ num = iter->second .func (vstack [id]);
181181
182182 // fill the partial derivatives if function argument had derivatives
183183 if (deriv && !dstack[id].empty ())
184184 {
185- double fder=iter->second .deriv (stack [id]);
185+ double fder=iter->second .deriv (vstack [id]);
186186 dnumdp = vector<double >(used.size ());
187187 for (unsigned int i=0 ; i<used.size (); i++)
188188 dnumdp[i] = fder*dstack[id][i];
@@ -193,7 +193,7 @@ double Fit::getnum(istringstream &inexpr, vector<double> &dnumdp)
193193 inexpr >> id;
194194 if (!inexpr)
195195 throw parseError (inexpr.str ());
196- num = stack [id];
196+ num = vstack [id];
197197 if (deriv && !dstack[id].empty ()) dnumdp = dstack[id];
198198 }
199199 else
@@ -333,8 +333,8 @@ double Fit::compute(string &expr, vector<double> &dnumdp)
333333 end = inexpr.tellg ();
334334
335335 // replace computed substring by stack pointer, and push value on the stack
336- expr.replace (pos,end-pos,stackvar (stack .size ()));
337- stack .push_back (num);
336+ expr.replace (pos,end-pos,stackvar (vstack .size ()));
337+ vstack .push_back (num);
338338
339339 // store the derivatives as well. Note that the derivative vector may be empty
340340 // if no derivatives was non-zero.
@@ -364,7 +364,7 @@ double Fit::parse(string line, vector<double> &dnumdp)
364364 throw parseError (" Illegal character in formula" );
365365
366366 // the first elements on the stack will be the used parameter values
367- stack .clear ();
367+ vstack .clear ();
368368 used.clear ();
369369
370370 // Search for parameters, check their existence and put on the stack
@@ -385,8 +385,8 @@ double Fit::parse(string line, vector<double> &dnumdp)
385385
386386 // put the bracket-value on the stack and replace substring by stack pointer,
387387 // and push new value on the stack
388- line.replace (bopen,bclose-bopen+1 ,stackvar (stack .size ()));
389- stack .push_back (num);
388+ line.replace (bopen,bclose-bopen+1 ,stackvar (vstack .size ()));
389+ vstack .push_back (num);
390390
391391 if (deriv)
392392 dstack.push_back (dnumdp);
0 commit comments