QuadGK.jl
QuadGK.jl copied to clipboard
Inplace method not callable with Inf
Hi,
wanted to know if this is the expected behavior. When doing
function f!(b, x)
b[1] = exp(-x^2)
b[2] = exp(-x^2)
return nothing
end
buf = zeros(Float64, 2); quadgk!(f!, buf, 0.0, Inf)
I get ERROR: MethodError: objects of type QuadGK.InplaceIntegrand{typeof(f!),Array{Float64,1},Array{Float64,1}} are not callable. For finite upper bounds though everything seems to work. In my use case however, I need to compute integrals for which the upper bound is Inf, and I do not a priori know if and when I can truncate the integral for some large upper bound.
Sounds like a bug.
In the meantime, you can just implement the same coordinate transformation (which QuadGK does internally) yourself:

Sure, that is what we used for now. I think however, that it would be more convenient to have it in the package. Are you planning to fix this in the near future? Otherwise I'll try to make a PR when I find the time.
I haven't had time to work on this, so a PR would be welcome.