Skip to content

Commit

Permalink
modify inplace
Browse files Browse the repository at this point in the history
  • Loading branch information
lxvm committed Nov 19, 2023
1 parent 3752432 commit 5337ec8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/IntegralsArblibExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ function Integrals.__solvebp_call(prob::IntegralProblem, alg::ArblibJL, sensealg
@assert prob.f isa IntegralFunction

if isinplace(prob)
y_ = similar(prob.f.integrand_prototype, typeof(Acb(0)))
res = Acb(0)
y_ = similar(prob.f.integrand_prototype, typeof(res))
f_ = (y, x; kws...) -> Arblib.set!(y, only(prob.f(y_, x, p; kws...)))
val = Arblib.integrate!(f_, Acb(0), lb, ub, atol=abstol, rtol=reltol,
val = Arblib.integrate!(f_, res, lb, ub, atol=abstol, rtol=reltol,
check_analytic=alg.check_analytic, take_prec=alg.take_prec,
warn_on_no_convergence=alg.warn_on_no_convergence, opts=alg.opts)
SciMLBase.build_solution(prob, alg, val, nothing, retcode = ReturnCode.Success)
Expand Down

0 comments on commit 5337ec8

Please sign in to comment.