JuliaApproximation / ApproxFun.jl

Julia package for function approximation
http://juliaapproximation.github.io/ApproxFun.jl/
Other
528 stars 70 forks source link

Cannot apply multiplication operator on Fourier() space #941

Open Jilhg opened 2 months ago

Jilhg commented 2 months ago

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?