The documentation (https://docs.sciml.ai/Integrals/stable/tutorials/numerical_integrals/) has the following code:
using Integrals, Cubature, Base.Threads
function f(dx,x,p)
Threads.@threads for i in 1:size(x,2)
dx[i] = sum(sin.(@view(x[:,i])))
end
end
prob = IntegralProblem(f,ones(2),3ones(2),batch=2)
sol = solve(prob,CubatureJLh(),reltol=1e-3,abstol=1e-3)
but the repo (https://github.com/SciML/Integrals.jl/blob/master/docs/src/tutorials/numerical_integrals.md) has:
using Integrals, IntegralsCubature, Base.Threads
function f(dx,x,p)
Threads.@threads for i in 1:size(x,2)
dx[i] = sum(sin.(@view(x[:,i])))
end
end
prob = IntegralProblem(f,ones(2),3ones(2),batch=2)
sol = solve(prob,CubatureJLh(),reltol=1e-3,abstol=1e-3)
sol.u
This isn't really an ask for help since it's solved, but it might help others, and I don't really know how to solve the inconsistent .md part of the problem.
The markdown file has the latest, unpublished version of the code. Discrepancies from the stable version (and thus the stable docs) are to be expected.
If you switch to the "dev" version in the docs sidebar, both should now match
Very disappointed that I did not notice the versioning down there. Very nice. Thanks.
Anubhab Haldar has marked this topic as resolved.
Last updated: Dec 28 2024 at 04:38 UTC