Limitation

Steve Udriot (Steve.Udriot@cern.ch)
Tue, 13 Jul 1999 08:38:15 +0200


This is a multi-part message in MIME format.
--------------68EB563F172FED49C18061B6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Good morning,

Concerning the "limitation" problem is attached here a macro which
defines a function from the "Example of a Program to fit non-equidistant
data points".
Note that the "limitation" problem disappears when I define the function
"extern", but this should not be a proper solution...

I hope You will help me out of this!

A nice day to everybody,

Steve
--------------68EB563F172FED49C18061B6
Content-Type: text/plain; charset=us-ascii;
name="macro.cc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="macro.cc"

{

Float_t z[5],x[5],y[5],errorz[5];

//______________________________________________________________________________
void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
{
const Int_t nbins = 5;
Int_t i;

//calculate chisquare
Double_t chisq = 0;
Double_t delta;
for (i=0;i<nbins; i++) {
delta = (z[i]-func(x[i],y[i],par))/errorz[i];
chisq += delta*delta;
}
f = chisq;
}

}

--------------68EB563F172FED49C18061B6--