Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit db3dace9 authored by Ludovic Courtès's avatar Ludovic Courtès

rational_fitter_parallel: Pass the params and content to the constructor.

Uses the new 'vertical_segment' constructor introduced in
commit ccee2b76c77d403a9fbd9340554076c340925466.
parent f4abd44d
......@@ -59,16 +59,7 @@ bool rational_fitter_parallel::fit_data(const ptr<data>& dat, ptr<function>& fit
std::cerr << "<<WARNING>> automatic convertion of the data object to vertical_segment," << std::endl;
std::cerr << "<<WARNING>> we advise you to perform convertion with a separate command." << std::endl;
ptr<vertical_segment> vs(new vertical_segment());
parameters p(dat->parametrization().dimX(),
dat->parametrization().dimY(),
dat->parametrization().input_parametrization(),
dat->parametrization().output_parametrization());
vs->setParametrization(p);
vs->setMin(dat->min());
vs->setMax(dat->max());
std::vector<vec> content(dat->size());
for(int i=0; i<dat->size(); ++i)
{
const vec x = dat->get(i);
......@@ -84,9 +75,14 @@ bool rational_fitter_parallel::fit_data(const ptr<data>& dat, ptr<function>& fit
(1.0 + args.get_float("dt", 0.1)) * x[k + dat->parametrization().dimX()];
}
vs->set(y);
content[i] = std::move(y);
}
ptr<vertical_segment> vs(new vertical_segment(dat->parametrization(),
std::move(content)));
vs->setMin(dat->min());
vs->setMax(dat->max());
d = vs;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment