On Tuesday, April 12, 2016 at 4:51:07 PM UTC-4, Kaj Wiik wrote:
>
> Very nice work indeed!
>
> Is it possible to pass 'userdata' to integrand in Julia? It is mentioned 
> in sources but is not listed in keywords.
>

You don't need an explicit userdata argument -- this is just a crude 
simulation of closures in C, but Julia has true closures and lexical 
scoping.

For example


myvar = 7
Vegas( (x,f) -> f[1] = log(x[1] + myvar)/sqrt(x[1]), 1, 1)


will "capture" the value of myvar and pass it through Vegas to the 
integrand, via the closure.

Reply via email to