Hi Chris, thanks for your comments :-) Regarding integration algorithm, unless you have specific reasons to use Vegas I warmly recommend to use Cuhre, which in my experience is the best in terms of speed and precision. There must be a reason if Cubature,jl, the only widely used numerical integration packages so far, implements the same algorithm ;-) Only once I found Divonne more useful because I had a wild function with peaks in known positions and you can tell Divonne to increase sampling around those points.
Bye, Mosè 2016-04-12 19:08 GMT+02:00 Chris Rackauckas <[email protected]>: > Nice! I was looking for a Vegas function awhile ago and the GSL.jl one > isn't bound correctly yet. This will be a nice addition to the Julia > package list. Good job! > > On Sunday, April 10, 2016 at 1:34:53 PM UTC-7, Mosè Giordano wrote: >> >> Dear all, >> >> I am proud to announce Cuba.jl <https://github.com/giordano/Cuba.jl> a >> library for multidimensional numerical integration with four independent >> algorithms: Vegas, Suave, Divonne, and Cuhre (this algorithm is the same >> used in Cubature.jl). This package is just a wrapper around Cuba Library >> <http://www.feynarts.de/cuba/>, written in C by Thomas Hahn. >> >> Cuba.jl is a registered Julia package, so you can install it with the >> package manager: >> >> Pkg.add("Cuba") >> >> The package is usable, but I must admit user interface is not optimal. >> One has to define a function of this type: >> >> function integrand(ndim::Cint, xx::Ptr{Cdouble}, ncomp::Cint, ff::Ptr{ >> Cdouble}, >> userdata::Ptr{Void}) >> # Take arrays from "xx" and "ff" pointers. >> x = pointer_to_array(xx, (ndim,)) >> f = pointer_to_array(ff, (ncomp,)) >> # Do calculations on "f" here >> # ... >> # Store back the results to "ff" >> ff = pointer_from_objref(f) >> return Cint(0)::Cint >> end >> >> and then call one of the four integrator functions available with this >> syntax: >> >> Vegas(integrand, ndim, ncomp[, keywords...]) >> Suave(integrand, ndim, ncomp[, keywords...]) >> Divonne(integrand, ndim, ncomp[, keywords...]) >> Cuhre(integrand, ndim, ncomp[, keywords...]) >> >> Issue #3 <https://github.com/giordano/Cuba.jl/issues/3> tracks this >> problem, if someone wants to help on this is warmly welcome. >> >> Documentation of the package is available at >> https://cubajl.readthedocs.org/ and you can also download the PDF >> version of the manual from >> https://media.readthedocs.org/pdf/cubajl/latest/cubajl.pdf In >> particular, there is a section with some useful examples: >> https://cubajl.readthedocs.org/en/latest/#examples >> >> Even though Cuba.jl does not support parallelization (see issue #1 >> <https://github.com/giordano/Cuba.jl/issues/1>), its performance is >> comparable with those of equivalent codes written in C or Fortran relying >> on Cuba Library: https://github.com/giordano/Cuba.jl#performance >> >> Cuba.jl is released under the terms of LGPLv3 and is available for >> GNU/Linux and OS X (Windows support is currently missing >> <https://github.com/giordano/Cuba.jl/issues/2>, Cubature.jl is a better >> alternative for that platform). >> >> Feel free to share your comments and suggestions on this package! >> >> Cheers, >> Mosè >> >
