Skip to content

Commit 4f2c6e4

Browse files
authored
conversion_type for normalized spaces and canonical (#94)
1 parent 75d6dd8 commit 4f2c6e4

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.5.1"
3+
version = "0.5.2"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Spaces/PolynomialSpace.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ function Fun(::typeof(identity), S::NormalizedPolynomialSpace)
377377
Fun(S, coeffs)
378378
end
379379

380+
function conversion_rule(a::NormalizedPolynomialSpace{S}, b::S) where S<:PolynomialSpace
381+
domainscompatible(domain(a), domain(b)) ? a : NoSpace()
382+
end
383+
380384
bandwidths(C::ConcreteConversion{NormalizedPolynomialSpace{S,D,R},S}) where {S,D,R} = (0, 0)
381385
bandwidths(C::ConcreteConversion{S,NormalizedPolynomialSpace{S,D,R}}) where {S,D,R} = (0, 0)
382386

test/ChebyshevTest.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,12 @@ import ApproxFunOrthogonalPolynomials: forwardrecurrence
254254
@test f1 == f2
255255
@test D1 * f1 == D2 * f2
256256
end
257+
258+
@testset "space promotion" begin
259+
s = NormalizedChebyshev()
260+
f = (Derivative() + Fun(s)) * Fun(s)
261+
g = ones(s) + Fun(s)^2
262+
@test f g
263+
end
257264
end
258265
end

0 commit comments

Comments
 (0)