Stream: helpdesk (published)

Topic: Inconsistent doc and repo versions of Integrals.jl example


view this post on Zulip Anubhab Haldar (Nov 01 2022 at 16:00):

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.


Last updated: Oct 02 2023 at 04:34 UTC