JuliaApproximation / JuliaApproximation/ApproxFun.jl

Cannot apply multiplication operator on Fourier() space

Open
#941 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
559
Forks
71
PR merge metrics
No merged PRs in 30d

Description

I tried to construct a multiplication operator on Fourier() space, but it produces an error once I apply it on a function. On any other space it works without problems

#multiply 1x1 in different spaces
fc = ones(CosSpace())
fL = ones(Laurent())
fF = ones(Fourier())

mulc = Multiplication(fc,CosSpace()) # type: ConcreteMultiplication
mulL = Multiplication(fL,Laurent()) # type: ConcreteMultiplication
mulF = Multiplication(fF,Fourier()) # type: MultiplicationWrapper

println(mulc*fc) # works
println(mulL*fL) # works
println(mulF*fF) # doesn't work

The last step multiplication produces the following error:

ERROR: MethodError: no method matching axpy!(::Float64, ::ApproxFunBase.SubOperator{Float64, ApproxFunBase.ConcreteMultiplication{CosSpace{PeriodicSegment{Float64}, Float64}, CosSpace{PeriodicSegment{Float64}, Float64}, Float64}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, Tuple{Int64, Int64}, Tuple{Int64, Int64}}, ::SubArray{Float64, 2, BandedMatrices.BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}, Tuple{Vector{Int64}, Vector{Int64}}, false})

I noticed that the multiplication operators on CosSpace and Laurent are ConcreteMultiplications, while the multiplication operator on Fourier is a MultiplicationWrapper. Maybe this causes the error?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example with Multiplication on CosSpace, Laurent, and Fourier, then trace the Fourier MultiplicationWrapper and its interaction with ConcreteMultiplication. Use the failing axpy! MethodError as the immediate investigation point. Done means multiplying the Fourier function succeeds as it does for the other spaces, with a regression test covering the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.