JuliaApproximation / ApproxFunBase.jl

Core functionality of ApproxFun
MIT License
12 stars 13 forks source link

don't use `mul!` inplace #482

Closed jishnub closed 1 year ago

jishnub commented 1 year ago

This fixes a somewhat serious bug, albeit one that might not be frequently encountered (no wonder it lurked undetected) On master:

julia> v = rand(4);

julia> R = Conversion(Chebyshev(), Legendre());

julia> ApproxFunBase.mul_coefficients!(R, copy(v))
4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0

After this PR

julia> ApproxFunBase.mul_coefficients!(R, copy(v))
4-element Vector{Float64}:
 0.41517303921077103
 0.17527749035532603
 0.7202004312320129
 1.35520616568446

julia> ApproxFunBase.mul_coefficients!(R, copy(v)) == ApproxFunBase.mul_coefficients(R, v)
true
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 74.89% and project coverage change: -3.89 :warning:

Comparison is base (2f401fa) 71.22% compared to head (0c6638a) 67.34%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #482 +/- ## ========================================== - Coverage 71.22% 67.34% -3.89% ========================================== Files 80 81 +1 Lines 8331 8468 +137 ========================================== - Hits 5934 5703 -231 - Misses 2397 2765 +368 ``` | [Impacted Files](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation) | Coverage Δ | | |---|---|---| | [src/ApproxFunBase.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL0FwcHJveEZ1bkJhc2Uuamw=) | `84.00% <ø> (+0.66%)` | :arrow_up: | | [src/LinearAlgebra/blas.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL0xpbmVhckFsZ2VicmEvYmxhcy5qbA==) | `77.77% <ø> (ø)` | | | [src/Spaces/Spaces.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL1NwYWNlcy9TcGFjZXMuamw=) | `45.23% <ø> (-21.83%)` | :arrow_down: | | [src/Operators/qr.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL09wZXJhdG9ycy9xci5qbA==) | `57.01% <22.22%> (-3.70%)` | :arrow_down: | | [src/Spaces/SumSpace.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL1NwYWNlcy9TdW1TcGFjZS5qbA==) | `65.99% <33.33%> (-3.69%)` | :arrow_down: | | [src/Operators/SubOperator.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL09wZXJhdG9ycy9TdWJPcGVyYXRvci5qbA==) | `81.28% <60.00%> (-1.89%)` | :arrow_down: | | [src/eigen.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL2VpZ2VuLmps) | `66.66% <66.66%> (ø)` | | | [src/Operators/functionals/CalculusFunctional.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL09wZXJhdG9ycy9mdW5jdGlvbmFscy9DYWxjdWx1c0Z1bmN0aW9uYWwuamw=) | `61.53% <73.33%> (-10.88%)` | :arrow_down: | | [src/Operators/banded/CalculusOperator.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL09wZXJhdG9ycy9iYW5kZWQvQ2FsY3VsdXNPcGVyYXRvci5qbA==) | `72.13% <77.41%> (-2.44%)` | :arrow_down: | | [src/show.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL3Nob3cuamw=) | `85.34% <78.04%> (+2.50%)` | :arrow_up: | | ... and [6 more](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation) | | ... and [44 files with indirect coverage changes](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/482/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.