JuliaMath / Cubature.jl

One- and multi-dimensional adaptive integration routines for the Julia language
Other
126 stars 21 forks source link

Access to number of function evaluations #55

Closed jwharington closed 1 year ago

jwharington commented 1 year ago

In order to assess the sampling efficiency of cubature methods, I'd like to be able to retrieve the number of evaluations used by the cubature code. I can see it is possible to set the maximum number of evaluations, but this doesn't help.

stevengj commented 1 year ago

Just increment a global counter in your integrand.

stevengj commented 1 year ago

e.g.

let counter = 0
    @show hquadrature(x -> (counter += 1; x^3), 0,1)
    @show counter
end
jwharington commented 1 year ago

Many thanks!

On Thu, 10 Nov 2022, 08:09 Steven G. Johnson, @.***> wrote:

Closed #55 https://github.com/JuliaMath/Cubature.jl/issues/55 as completed.

— Reply to this email directly, view it on GitHub https://github.com/JuliaMath/Cubature.jl/issues/55#event-7777300851, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHB5VPD3OU6Y56I6HM4LALWHQHHFANCNFSM6AAAAAARZ54AK4 . You are receiving this because you authored the thread.Message ID: @.***>