Hi Jonny, there is Monte-Carlo integration in GSL, but for 2D this is most probably not an improvement.
Furthermore, there is this adaptive multidimensional integration code: http://ab-initio.mit.edu/wiki/index.php/Cubature which is very similar to the gsl routines, but allows for arbitrary dimensions. They claim that it is best suited for a moderate number of dimensions, which should fit your needs. I had to do a 4D integral recently for a physics project and after playing around with MC and Cubature for a long time, I found that simply nesting the integrals was be best method, because one has a much greater flexibility to exploit the symmetries of the problem. In particular when you know a lot about your function: Choosing a suitable coordinate transformation and integration limits can be much more important ... Best regards, Max On 04/25/2012 02:26 PM, Jonathan Taylor wrote: > Hi all, > > I fear this must have come up on the list before, but I haven't been able to > find much in the way of GSL-specific discussion on the question of adaptive > double integration. I have a 2D surface integral that I would like to > integrate adaptively (converging to a specified relative/absolute precision). > My understanding is that the GSL integration functions are limited to one > dimension. Clearly one possibility is to perform two nested adaptive single > integrations, but I suspect that is probably not optimal (but I would be > delighted to hear encouraging words on its effectiveness!). > > The integral in question is a surface integral, and the function in question > is reasonably well behaved. It is based around spherical harmonics so will > involve sinusoidal type variations with potentially quite rapid oscillations, > but no singularities etc. I would be grateful for any advice on what the best > way of approaching this is. It looks like it will be the bottleneck in my > problem, so I would like to speed it up as much as possible - at least for a > reasonable amount of effort invested! > > Thanks in advance > Jonny
