[ROOT] TF2 ctor doest work in the interpreter.

From: Aihong Tang (aihong@cnr.physics.kent.edu)
Date: Fri Apr 28 2000 - 17:47:34 MEST


Hi,

I have a drawSurf3.cxx which is copied from roottalk digest,
I assume it should work in both session:


First interactive session
=========================
Root > .L drawSurf.cxx
Root > drawSurf()

Second interactive session
==========================
Root > .L drawSurf.cxx++
Root > .drawSurf()



The Second one works, but the first session gives the following message:

root4star [0] .L drawSurf.cxx
root4star [1] drawSurf()
Error: Ambiguous overload resolution (10400,2) FILE:drawSurf.cxx LINE:19
Calling : TF2::TF2(char*,char*,int,int,int,int,int);
Match rank: file     line  signature
  ffffffff (compiled)   0 TF2 TF2::TF2(const TF2&);
*    10400 (compiled)   0 TF2 TF2::TF2(const char*,Double_t (*)(Double_t*,
Double_t*),Float_t,Float_t,Float_t,Float_t,Int_t);
*    10400 (compiled)   0 TF2 TF2::TF2(const
char*,void*,Float_t,Float_t,Float_t,Float_t,Int_t);
  ffffffff (compiled)   0 TF2 TF2::TF2(const char*,const
char*,Float_t,Float_t,Float_t,Float_t);
  ffffffff (compiled)   0 TF2 TF2::TF2();
*** Interpreter error recovered ***



The file drawSurf.cxx
=====================
#include "TF2.h"

Double_t gausxy( Double_t* x, Double_t* par ) {

  Double_t dxds= (x[0]-par[0])/par[2];
  Double_t dyds= (x[1]-par[1])/par[3];
  Double_t rho= par[4];
  return exp( -0.5*( dxds*dxds + dyds*dyds 
                     - 2.0*dxds*dyds*rho )/( 1.0-rho*rho) );

}

void drawSurf(){

  TF2* f2= new TF2( "myfunc2", gausxy, -10, 10, -10, 10, 5 );
  f2->SetParameter( 0, 0.0 );
  f2->SetParameter( 1, 0.0 );
  f2->SetParameter( 2, 2.0 );
  f2->SetParameter( 3, 2.0 );
  f2->SetParameter( 4, 0.1 );
  f2->Draw("surf");


}




I am running root 2.24 on  Linux.

Thanks!

Aihong



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:24 MET