JuliaApproximation / JuliaApproximation/ApproxFun.jl
Null dimensions for matrices not supported ?
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 559
- Forks
- 71
- PR merge metrics
- No merged PRs in 30d
Description
The following command produces an error
Fun(t->zeros(2,0),Fourier(0..pi))
ERROR: BoundsError: attempt to access 2×0 Matrix{ApproxFunBase.SumSpace{Tuple{CosSpace{PeriodicSegment{Float64}, Float64}, SinSpace{PeriodicSegment{Float64}, Float64}}, PeriodicSegment{Float64}, Float64}} at index [1]
Stacktrace:
[1] getindex
@ .\array.jl:861 [inlined]
[2] first
@ .\abstractarray.jl:398 [inlined]
[3] ArraySpace
@ C:\Users\Andreas\.julia\packages\ApproxFunBase\fvVRN\src\Spaces\ArraySpace.jl:21 [inlined]
[4] Space(sp::Matrix{ApproxFunBase.SumSpace{Tuple{CosSpace{PeriodicSegment{Float64}, Float64}, SinSpace{PeriodicSegment{Float64}, Float64}}, PeriodicSegment{Float64}, Float64}})
@ ApproxFunBase C:\Users\Andreas\.julia\packages\ApproxFunBase\fvVRN\src\Spaces\ArraySpace.jl:28
[5] default_Fun(f::ApproxFunBase.DFunction, d::ApproxFunBase.SumSpace{Tuple{CosSpace{PeriodicSegment{Float64}, Float64}, SinSpace{PeriodicSegment{Float64}, Float64}}, PeriodicSegment{Float64}, Float64})
@ ApproxFunBase C:\Users\Andreas\.julia\packages\ApproxFunBase\fvVRN\src\constructors.jl:109
[6] Fun(f::Function, d::ApproxFunBase.SumSpace{Tuple{CosSpace{PeriodicSegment{Float64}, Float64}, SinSpace{PeriodicSegment{Float64}, Float64}}, PeriodicSegment{Float64}, Float64})
@ ApproxFunBase C:\Users\Andreas\.julia\packages\ApproxFunBase\fvVRN\src\constructors.jl:177
[7] top-level scope
@ REPL[20]:1
Also
Fun(t->zeros(2,0))
fails in a similar way.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two zero-column matrix examples and start with the ArraySpace and Space entry points shown in the stack trace. Determine the expected handling for 2×0 matrices, then add coverage showing that both Fun calls complete without a BoundsError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100