Re: [ROOT] TH1::Integral deature request

From: Thomas Bretz (tbretz@astro.uni-wuerzburg.de)
Date: Wed Nov 05 2003 - 10:45:51 MET


Hi Rene,

no. I want to have _more_ sampling points (eg x[20], w[20]) Because you 
cannot implement all possible number of sampling points you will have to 
calculate them (I can give you the algorithm) If you calculate them 
integrating a function more than once (eg in a double integral) will 
become rather slow. So it is a good idea to precalculate these arrays 
for your needs (eg 50 sampling points) and then call ::Integral() eg 100 
times.

Could be something like:
TF1::Integral(double, double, double*, double, TArrayD &x, TArrayD &w);
TF1::CalcIntegralSamplingPoints(int n, TArrayF &x, TArrayF &w);

Best regards,
Thomas.


Rene Brun wrote:
> Hi Thomas,
> 
> I am not sure to understand what you mean by sampling points.
> Do you mean an alternative to the arrays x[12] and w[12] ?
> Could you provide a piece of code with some example implementation showing
> the speed advantage compared to the current function?
> If your function performs better, we can easily add a new TF1::Integral
> with a new prototype.
> 
> Rene Brun
> 
> Thomas Bretz wrote:
> 
>>Hi,
>>
>>would it be possible to have a Integral function which takes more
>>sampling points?
>>
>>I think of some solution in which you (for speed reasons) first
>>calculate the sampling points you want to have (there is a formular
>>which one can use) and afterwards use these sampling points in your
>>Integral.
>>
>>This would be more convinient, than having a fixed number of sampling
>>points (which is rather small) exspecially in more complex functions
>>like step-functions or similar...
>>
>>Thanks in advance,
>>Thomas
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET