void DrawSmooth(
Int_t pad,
const char *title,
const char *xt,
const char *yt)
{
TH1F *vFrame =
gPad->DrawFrame(0,0,15,150);
}
void approx()
{
Double_t x[] = {1,2,3,4,5,6,6,6,8,9,10};
Double_t y[] = {1,4,9,16,25,25,36,49,64,81,100};
{1.2,1.7,2.5,3.2,4.4,5.2,5.7,6.5,7.6,8.3,9.7,10.4,11.3,13};
vC1 =
new TCanvas(
"vC1",
"square",200,10,700,700);
grout = gs->
Approx(grin,
"linear");
DrawSmooth(1,"Approx: ties = mean","X-axis","Y-axis");
grout = gs->
Approx(grin,
"linear", 14, xout, 0, 130);
DrawSmooth(2,"Approx: ties = mean","","");
for (
Int_t k=0;k<vNout;k++) {
cout << "k= " << k << " vXout[k]= " << vXout
<< " vYout[k]= " << vYout << endl;
}
grout = gs->
Approx(grin,
"constant", 50, 0, 0, 0, 1, 0.5,
"min");
DrawSmooth(3,"Approx: ties = min","","");
grout = gs->
Approx(grin,
"linear", 14, xout, 0, 0, 2, 0,
"max");
DrawSmooth(4,"Approx: ties = max","","");
delete gs;
}