Problem with TGraph::Eval(...)

From: Vito Di Benedetto <vito.dibenedetto_at_le.infn.it>
Date: Fri, 9 Apr 2010 12:54:33 +0200


  Dear ROOT experts,
I'm using ROOT v5.26.00 on Fedora 8 with gcc 4.2.4 I found a strange behaviour using TGraph::Eval(...) method.

The code below is to illustrate the problem.

/*===========================

Float_t xVal[10], yVal[10];

 for(Int_t idx=0;idx<10; idx++){
   xVal[idx]=idx;
   yVal[idx]=idx*idx;
 }

 TGraph *grVal = new TGraph(10,xVal,yVal);

===========================*/

The TGraph should draw the parabola y = x^2

So I expect that

grVal->Eval(1.) give me the result "1.", but

grVal->Eval(1.)

(const Double_t)2.00000000000000000e+00

and so on for all the "xVal" used to build the TGraph I get wrong results of the Eval method. But I get right values if I use the Eval method for value different that the ones used to build the TGraph.

I don't know if this is an expected behaviour of I'm using the Eval method in a wrong way.

Cheers,

        Vito Received on Fri Apr 09 2010 - 12:54:40 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 09 2010 - 17:50:01 CEST