Skip to content

Commit da2d24d

Browse files
authored
multiplication of real and complex Fun (#178)
1 parent 8b581c6 commit da2d24d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Operators/banded/Multiplication.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ function transformtimes(f::Fun,g::Fun, n = ncoefficients(f) + ncoefficients(g) -
151151
iszero(ncoefficients(f)) && return f
152152
iszero(ncoefficients(g)) && return g
153153
f2,g2 = pad(f,n), pad(g,n)
154-
v = values(f2)
155-
v .*= values(g2)
156-
hc = transform(sp, v)
154+
hc = transform(sp, values(f2) .* values(g2))
157155
chop!(Fun(sp,hc),10eps(eltype(hc)))
158156
end
159157

test/SpacesTest.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ using BandedMatrices: rowrange, colrange, BandedMatrix
322322
@test values(f2) values(f3)
323323
end
324324

325+
@testset "multiplication of Funs" begin
326+
f = Fun(Chebyshev(), Float64[1:101;])
327+
g = Fun(Chebyshev(), Float64[1:101;]*im)
328+
@test f(0.5)*g(0.5) (f*g)(0.5)
329+
end
330+
325331
@testset "Multivariate" begin
326332
@testset for S in Any[Chebyshev(), Legendre()]
327333
f = Fun(x->ones(2,2), S)

0 commit comments

Comments
 (0)