JuliaMath / HCubature.jl

pure-Julia multidimensional h-adaptive integration
Other
153 stars 25 forks source link

Did the behaviour change when integral limits are switched? #67

Closed zhyiyu closed 3 months ago

zhyiyu commented 4 months ago

Hi, I used to remember that if I switch the upper and lower integral limits, the integral value does not change. That is to say, in the following:

function integrand(x_vector::Vector{Float64})
    return x_vector[1]
end

result_a = hcubature(integrand, [x_low], [x_up], rtol = 1e-5)[1]
result_b = hcubature(integrand, [x_low], [x_up], rtol = 1e-5)[1]

we will have result_a = result_b (OLD behaviour). However, recently I noticed that this behaviour has been changed at some point, namely result_a = -result_b (NEW behaviour). Is this true or did my memory deceive me?

BTW, the new behaviour is better, it is what people would expect.

stevengj commented 3 months ago

Yes, this was fixed in #57.