I'm trying to integrate a simple function in Julia using the GSL numerical integration function QNG. The form of the function in C is given as
int gsl_integration_qng (const gsl_function * f, double a, double b,
double epsabs, double epsrel, double * result, double * abserr, size_t * neval)
I am trying to perform the following integration
f(x) = x^2
a, b, epsabs, epsrel = 0.0, 1.0, 1.0e-2, 1.0e-2
result, abserr = 0.0, 0.0
neval = 0x123456789abcdef
0x0123456789abcdef
t = ccall( (:gsl_integration_qng, "libgsl"), Int32,
(Ptr{Void}, Float64, Float64, Float64, Float64, Ptr{Float64}, Ptr{Float64},Csize_t),
&f, a, b, epsabs, epsrel, &result, &abserr, neval)
I appreciate any assitance.
After a bit of thought and looking at the existing GSL functions I got this working.
Also see here http://julialang.org/blog/2013/05/callback/ for a discussion about this kind of thing from someone more qualified than I.