1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-04-10 19:20:44 +01:00

Chi2Function: call optimisation

This commit is contained in:
Antonin Portelli 2014-03-17 15:00:09 +00:00
parent be3e1b02ba
commit 3bebfb6e10

View File

@ -246,7 +246,6 @@ double Chi2Function::operator()(const double *arg) const
const Index yDim = data_.getYDim(); const Index yDim = data_.getYDim();
const Index nPoint = data_.getNFitPoint(); const Index nPoint = data_.getNFitPoint();
Index is; Index is;
ConstMap<DVec> p(arg, nPar_, 1);
ConstMap<DVec> xi(arg + nPar_, getNArg() - nPar_, 1); ConstMap<DVec> xi(arg + nPar_, getNArg() - nPar_, 1);
double res; double res;
@ -280,7 +279,8 @@ double Chi2Function::operator()(const double *arg) const
is++; is++;
} }
} }
f_jk = (*f)(buffer_->x, p); // call model on double pointers to avoid any copy
f_jk = (*f)(buffer_->x.data(), arg);
buffer_->v(j*nPoint + k) = f_jk - y_jk; buffer_->v(j*nPoint + k) = f_jk - y_jk;
} }