Use TGraphPainter::Smooth() to get interpolated values?

Hi Rooters,

is it possible to use TGraphPainter::Smooth() to get the interpolated values?
For instance, lets have an initializes and filled TGraphErrors *g, I would like to do the following:

Double_t ax[1000], ay[1000];
TGraphPainter *gp = new TGraphPainter();

But then when I check the values of the ax and ay arrays, they are all empty:
for (int i=0; i<10; i++) cout << ax[i*50] << " " << ay[i*50] << endl;

Am I doing something wrong or is it not possible to do this way? I know there is TGraph::Eval() but looking at the code of TGraphPainter it seems to me the above way should work too.


TGraphPainter::Smooth() is an internal method used to draw the graphs when with the option “C”. It is not meant to be use to interpolate points. ROOT has many tools to do that (fit package etc …)

I found what I was looking for in ALGLIB package, in particular here: Penalized regression spline … p#header12 … penalizedw

It would be really neat to integrate this package into ROOT :slight_smile: