Skip to content

don't use mul! inplace #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2023
Merged

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Jun 13, 2023

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
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Patch coverage: 74.89% and project coverage change: -3.89 ⚠️

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

Additional details and impacted files
@@            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 Coverage Δ
src/ApproxFunBase.jl 84.00% <ø> (+0.66%) ⬆️
src/LinearAlgebra/blas.jl 77.77% <ø> (ø)
src/Spaces/Spaces.jl 45.23% <ø> (-21.83%) ⬇️
src/Operators/qr.jl 57.01% <22.22%> (-3.70%) ⬇️
src/Spaces/SumSpace.jl 65.99% <33.33%> (-3.69%) ⬇️
src/Operators/SubOperator.jl 81.28% <60.00%> (-1.89%) ⬇️
src/eigen.jl 66.66% <66.66%> (ø)
src/Operators/functionals/CalculusFunctional.jl 61.53% <73.33%> (-10.88%) ⬇️
src/Operators/banded/CalculusOperator.jl 72.13% <77.41%> (-2.44%) ⬇️
src/show.jl 85.34% <78.04%> (+2.50%) ⬆️
... and 6 more

... and 44 files with indirect coverage changes

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

@jishnub jishnub merged commit 774f0d9 into JuliaApproximation:master Jun 13, 2023
@jishnub jishnub deleted the inplacemulsubop branch June 13, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant