JuliaMath / HCubature.jl

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

use SizedArray for non-isbits types #61

Closed araujoms closed 7 months ago

araujoms commented 7 months ago

Fixes #60

I've also updated the compat to demand StaticArrays to be at least 1.6.4, and added a couple of tests.

As expected, the benchmarks were indistinguishable. I've timed with the following code, copied from runtests.jl:

    @benchmark hcubature(x -> cos(x[1]), (0,), (1,))
    @benchmark hcubature(x -> cos(x[1])*cos(x[2]), [0,0], [1,1])
    f(x) = sin(x[1] + 3*sin(2*x[2] + 4*sin(3*x[3])))
    @benchmark hcubature(f, (0,0,0),(3,3,3), rtol=1e-6)

Got 89.942 ns, 5.648 μs, and 67.489 ms in the old version, and 85.637 ns, 5.662 μs, and 66.269 ms in the new version.

araujoms commented 7 months ago

As it turns out StaticArrays 1.6.4 requires Julia 1.6, so CI fails with Julia 1.0.

stevengj commented 7 months ago

Feel free to change the Project.toml to list julia 1.6, and change the CI.yml to test on 1.6 rather than 1.0.

araujoms commented 7 months ago

Ok, now everything passes. I didn't want to change such a fundamental thing without your blessing.

araujoms commented 7 months ago

Thanks a lot for you responsiveness and guidance.