Steven G. Johnson
Steven G. Johnson
Maybe https://github.com/JuliaLang/julia/blob/dbf0bab59ddc28f1c240fa618bf0e23194954bbe/base/strings/unicode.jl#L414-L415 should just be calling `isvalid(c)` instead of `ismalformed(c)`? Or better yet just `(ismalformed(c) | isoverlong(c))` since utf8proc checks for the other cases. Or better yet, shouldn't we have...
As discussed in #54393, the conclusion is that `codepoint(c)` should succeed whenever `!ismalformed(c)`, including for overlong encodings.
What do you gain from the optimization? HCubature precomputes the rule, so the actual application of the rule should be pretty fast.
The 1d case is not as well optimized (it calls QuadGK); and usually if you are doing 1d integration it is with a less trivial integrand. If you go to...
(I just spotted the problem with the 1d case: it is re-computing the Kronrod rule, which involves solving an eigenproblem, every time. I thought the `QuadGK.kronrod` function cached the rule,...
Okay, the 1d case is now fixed too (or will be once I push a commit); thanks for spotting this! ```jl julia> @btime HCubature.hcubature($(t -> t[1]), $(SVector(0.)), $(SVector(1.)), rtol=1e-8) 2.811...
Further speedups should be possible in the multidimensional case by caching the cubature rules there too, but I'm not sure it's worth it; normally I would expect multidimensional cubature to...
For 2d integrals with a trivial integrand, I got a 40% speedup by caching the Genz–Malik rule. For more complex integrands that require adaptive refinement, the difference is negligible. But...
(Whoops, I just noticed that I acknowledged @pabloferz rather than @giordano in the commit message for https://github.com/stevengj/HCubature.jl/commit/5e1b559ca17f2d63d940cb803888957efe26b4fa, sorry.)
If you have a higher-degree rule that uses fewer function evaluations, that sounds great; a PR would be welcome (just put it into a separate file and define a new...