FastTransforms.jl
FastTransforms.jl copied to clipboard
Can't use empty vectors in `th_cheb2leg` or `th_leg2cheb`
This originally came up in https://github.com/JuliaApproximation/ClassicalOrthogonalPolynomials.jl/issues/196
julia> FastTransforms.th_leg2cheb(Float64[])
ERROR: BoundsError: attempt to access 0×0 Matrix{Float64} at index [1, 1:0]
Stacktrace:
[1] throw_boundserror(A::Matrix{Float64}, I::Tuple{Int64, Base.Slice{Base.OneTo{Int64}}})
@ Base .\abstractarray.jl:737
[2] checkbounds
@ .\abstractarray.jl:702 [inlined]
[3] view
@ .\subarray.jl:184 [inlined]
[4] maybeview
@ .\views.jl:148 [inlined]
[5] dotview
@ .\broadcast.jl:1244 [inlined]
[6] _leg2chebTH_TLC(::Type{Float64}, mn::Tuple{Int64}, d::Int64)
@ FastTransforms C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:181
[7] _broadcast_getindex_evalf
@ .\broadcast.jl:709 [inlined]
[8] _broadcast_getindex
@ .\broadcast.jl:692 [inlined]
[9] #31
@ .\broadcast.jl:1118 [inlined]
[10] ntuple
@ .\ntuple.jl:48 [inlined]
[11] copy
@ .\broadcast.jl:1118 [inlined]
[12] materialize
@ .\broadcast.jl:903 [inlined]
[13] plan_th_leg2cheb!
@ C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:203 [inlined]
[14] plan_th_leg2cheb!
@ C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:651 [inlined]
[15] th_leg2cheb(::Vector{Float64})
@ FastTransforms C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:652
[16] top-level scope
@ REPL[20]:1
julia> FastTransforms.th_cheb2leg(Float64[])
ERROR: ArgumentError: invalid Array dimensions
Stacktrace:
[1] Array
@ .\boot.jl:477 [inlined]
[2] Array
@ .\boot.jl:486 [inlined]
[3] zeros
@ .\array.jl:636 [inlined]
[4] zeros
@ .\array.jl:632 [inlined]
[5] _cheb2legTH_TLC(::Type{Float64}, mn::Tuple{Int64}, d::Int64)
@ FastTransforms C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:218
[6] _broadcast_getindex_evalf
@ .\broadcast.jl:709 [inlined]
[7] _broadcast_getindex
@ .\broadcast.jl:692 [inlined]
[8] #31
@ .\broadcast.jl:1118 [inlined]
[9] ntuple
@ .\ntuple.jl:48 [inlined]
[10] copy
@ .\broadcast.jl:1118 [inlined]
[11] materialize
@ .\broadcast.jl:903 [inlined]
[12] plan_th_cheb2leg!
@ C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:235 [inlined]
[13] plan_th_cheb2leg!
@ C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:651 [inlined]
[14] th_cheb2leg(::Vector{Float64})
@ FastTransforms C:\Users\danjv\.julia\packages\FastTransforms\S7huq\src\toeplitzhankel.jl:652
[15] top-level scope
@ REPL[21]:1