Re: [ROOT] TGraphSmooth

From: cstrato@EUnet.at
Date: Wed Mar 20 2002 - 21:33:24 MET


Dear Federico

In your code you define an array xout[12], which you want to use
for interpolation in method approx(). However, as number of points
nout you define nout=ncyles+12 instead of nout=12.

As you can see from the sourcecode
TGraphSmooth::Approx(..nout, xout,..)
...
   fNout = nout;
...
   for (Int_t i=0;i<fNout;i++) {
      if (xout == 0) x = fMinX + i*delta;
      else           x = xout[i];
      ...
   }
nout is the number of values defined in xout.

I hope, this answer helps you to solve your problem.

Best regards
Christian
----------------------------------
C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
V.i.e.n.n.a,  A.u.s.t.r.i.a

Federico Roncarolo wrote:

> Hello,
>
> I'm trying to interpolate a graph with TGraphSmooth,
> I'm working in linux, my makefile looks to compile properly the file .cxx
> in which I put:
>
>         .....
>         .....
>         TGraph *grq1 = new TGraph(ncycles,vtime,vmax);// properly drawn
>
>         TGraph *grout=new TGraph(ncycles+12);
>         TGraphSmooth *gs1 = new TGraphSmooth();
>
>         Double_t xout[12];
>         Int_t add;
>         Double_t dt=90e-3;
>         Double_t t0=784e-3;
>
>         for(add=0;add<12;add++) xout[add]=t0+add*dt;
>
>         grout = gs1->Approx(grq1,"linear",ncycles+12,xout,0,2);
>         //the program clearly
>         //stops at this line
>         .....
>         .....
>
> but while executing I get the message
>
>         pure virtual method called
>         Abort (core dumped)
>
> what's wrong?
>
> Thanks a lot,
> Federico
>
> __________________________________________________
> Federico Roncarolo     federico.roncarolo@cern.ch
>                             alchemist@infinito.it
> CERN SL/BI 865 1-A27
>
> Tel:
> +41.(0)22.76.75611      Work
> +41.(0)79.6982190       GSM
> +33.(0)4.50.40.82.67    Home
> __________________________________________________



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:46 MET