Skip to content
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

Handle empty coeff vectors in Multiplication for Ultraspherical spaces #70

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Apr 25, 2022

On master

julia> v1 = Fun(Chebyshev(), Float64[])
(::Fun{Chebyshev{ChebyshevInterval{Float64}, Float64}, Float64, Vector{Float64}}) (generic function with 1 method)

julia> sp = Ultraspherical(1)
Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}(1, -1.0..1.0 (Chebyshev))

julia> Multiplication(v1, sp)
ERROR: BoundsError: attempt to access 0-element Vector{Float64} at index [1]
Stacktrace:
 [1] getindex
   @ ./array.jl:861 [inlined]
 [2] SymToeplitzOperator(V::Vector{Float64})
   @ ApproxFunBase ~/.julia/packages/ApproxFunBase/fvVRN/src/Operators/banded/ToeplitzOperator.jl:25
 [3] Multiplication(f::Fun{Chebyshev{ChebyshevInterval{Float64}, Float64}, Float64, Vector{Float64}}, sp::Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64})
   @ ApproxFunOrthogonalPolynomials ~/Dropbox/PostDoc/RossbyWaves/RossbyWaveSpectrum.jl/dev/ApproxFunOrthogonalPolynomials/src/Spaces/Ultraspherical/UltrasphericalOperators.jl:33
 [4] top-level scope
   @ REPL[14]:1

This PR

julia> Multiplication(v1, sp)
ApproxFunBase.MultiplicationWrapper{Chebyshev{ChebyshevInterval{Float64}, Float64}, Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}, ApproxFunBase.SpaceOperator{HankelOperator{Float64}, Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}, Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}, Float64}, Float64}(Fun{Chebyshev{ChebyshevInterval{Float64}, Float64}, Float64, Vector{Float64}}(Chebyshev{ChebyshevInterval{Float64}, Float64}(-1.0..1.0 (Chebyshev)), Float64[]), ApproxFunBase.SpaceOperator{HankelOperator{Float64}, Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}, Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}, Float64}(HankelOperator{Float64}(Float64[]), Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}(1, -1.0..1.0 (Chebyshev)), Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}(1, -1.0..1.0 (Chebyshev))))

julia> Multiplication(v1, sp)[1:4, 1:4]
4×4 BandedMatrix{Float64} with bandwidths (0, 0):
 0.0            
     0.0        
         0.0    
             0.0

@codecov
Copy link

codecov bot commented Apr 26, 2022

Codecov Report

Merging #70 (dc62f3c) into master (17583d6) will not change coverage.
The diff coverage is n/a.

❗ Current head dc62f3c differs from pull request most recent head b93a8fd. Consider uploading reports for the commit b93a8fd to get more accurate results

@@           Coverage Diff           @@
##           master      #70   +/-   ##
=======================================
  Coverage   57.04%   57.04%           
=======================================
  Files          27       27           
  Lines        2386     2386           
=======================================
  Hits         1361     1361           
  Misses       1025     1025           
Impacted Files Coverage Δ
...c/Spaces/Ultraspherical/UltrasphericalOperators.jl 75.92% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17583d6...b93a8fd. Read the comment docs.

@dlfivefifty
Copy link
Member

Bump the patch version if you want this tagged

@dlfivefifty dlfivefifty merged commit 946e091 into JuliaApproximation:master Apr 26, 2022
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.

2 participants