Skip to content

Impove type inference in RaggedMatrix constructor #520

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

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Aug 3, 2023

This avoids recursion in the RaggedMatrix constructor from SubOperators.
After this,

julia> d1, r1 = Legendre(), Jacobi(2,2);

julia> d2, r2 = Chebyshev(), Chebyshev();

julia> K = (Operator(I, d1)  Operator(I, d2))  (r1  r2)
KroneckerOperator : Legendre()  Chebyshev()  Jacobi(2,2)  Chebyshev()
 1.0  0.0  0.0       0.0  0.0       -0.285714  0.0  0.0        0.0        0.0       
     1.0  0.0       0.0  0.0        0.0       0.0  0.0       -0.285714   0.0       
     0.0  0.333333  0.0  0.0        0.0       0.0  0.0        0.0       -0.222222  
                  1.0  0.0        0.0       0.0  0.0        0.0        0.0       
                  0.0  0.333333   0.0       0.0  0.0        0.0        0.0       
                  0.0  0.0        0.214286  0.0  0.0        0.0        0.0       
                                         1.0  0.0        0.0        0.0       
                                         0.0  0.333333   0.0        0.0       
                                         0.0  0.0        0.214286   0.0       
                                         0.0  0.0        0.0        0.166667  
                                                                          

julia> @inferred K[1:1, 1:1]
1×1 ApproxFunBase.RaggedMatrix{Float64}:
 1.0

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Patch coverage: 68.33% and project coverage change: -44.48% ⚠️

Comparison is base (4f33475) 71.88% compared to head (5890748) 27.40%.
Report is 12 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #520       +/-   ##
===========================================
- Coverage   71.88%   27.40%   -44.48%     
===========================================
  Files          81       80        -1     
  Lines        8546     8360      -186     
===========================================
- Hits         6143     2291     -3852     
- Misses       2403     6069     +3666     
Files Changed Coverage Δ
src/ApproxFunBase.jl 44.00% <ø> (-40.00%) ⬇️
src/Operators/SubOperator.jl 42.64% <0.00%> (-41.18%) ⬇️
src/Operators/banded/CalculusOperator.jl 17.35% <0.00%> (-58.46%) ⬇️
src/Operators/banded/Conversion.jl 22.95% <0.00%> (-63.49%) ⬇️
src/Spaces/ProductSpaceOperators.jl 0.00% <0.00%> (-65.37%) ⬇️
src/eigen.jl 0.00% <0.00%> (-96.43%) ⬇️
src/Fun.jl 36.17% <50.00%> (-31.62%) ⬇️
src/Operators/general/InterlaceOperator.jl 23.46% <66.66%> (-57.87%) ⬇️
src/LinearAlgebra/helper.jl 55.58% <100.00%> (-13.35%) ⬇️
src/Multivariate/TensorSpace.jl 39.83% <100.00%> (-45.34%) ⬇️
... and 2 more

... and 60 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jishnub jishnub merged commit 54afbcb into JuliaApproximation:master Aug 3, 2023
@jishnub jishnub deleted the raggedmatrixsubopconstructor branch August 3, 2023 14:16
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