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è