27
27
#include " MathUtils.h"
28
28
#include " pdffit.h"
29
29
30
- static vector<double > stack ;
30
+ static vector<double > vstack ;
31
31
static vector<vector<double > > dstack; // stack with derivative vectors
32
32
static bool deriv;
33
33
@@ -81,7 +81,7 @@ string Fit::substitute_pars(string &expr)
81
81
if (i==used.size ())
82
82
{
83
83
used.push_back (ipar);
84
- stack .push_back (p[ipar]);
84
+ vstack .push_back (p[ipar]);
85
85
}
86
86
87
87
expr.replace (bopen,bclose-bopen,stackvar (i));
@@ -177,12 +177,12 @@ double Fit::getnum(istringstream &inexpr, vector<double> &dnumdp)
177
177
inexpr >> id;
178
178
if (!inexpr)
179
179
throw parseError (inexpr.str ());
180
- num = iter->second .func (stack [id]);
180
+ num = iter->second .func (vstack [id]);
181
181
182
182
// fill the partial derivatives if function argument had derivatives
183
183
if (deriv && !dstack[id].empty ())
184
184
{
185
- double fder=iter->second .deriv (stack [id]);
185
+ double fder=iter->second .deriv (vstack [id]);
186
186
dnumdp = vector<double >(used.size ());
187
187
for (unsigned int i=0 ; i<used.size (); i++)
188
188
dnumdp[i] = fder*dstack[id][i];
@@ -193,7 +193,7 @@ double Fit::getnum(istringstream &inexpr, vector<double> &dnumdp)
193
193
inexpr >> id;
194
194
if (!inexpr)
195
195
throw parseError (inexpr.str ());
196
- num = stack [id];
196
+ num = vstack [id];
197
197
if (deriv && !dstack[id].empty ()) dnumdp = dstack[id];
198
198
}
199
199
else
@@ -333,8 +333,8 @@ double Fit::compute(string &expr, vector<double> &dnumdp)
333
333
end = inexpr.tellg ();
334
334
335
335
// 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);
338
338
339
339
// store the derivatives as well. Note that the derivative vector may be empty
340
340
// if no derivatives was non-zero.
@@ -364,7 +364,7 @@ double Fit::parse(string line, vector<double> &dnumdp)
364
364
throw parseError (" Illegal character in formula" );
365
365
366
366
// the first elements on the stack will be the used parameter values
367
- stack .clear ();
367
+ vstack .clear ();
368
368
used.clear ();
369
369
370
370
// Search for parameters, check their existence and put on the stack
@@ -385,8 +385,8 @@ double Fit::parse(string line, vector<double> &dnumdp)
385
385
386
386
// put the bracket-value on the stack and replace substring by stack pointer,
387
387
// 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);
390
390
391
391
if (deriv)
392
392
dstack.push_back (dnumdp);
0 commit comments