Skip to content

Commit 803d0fc

Browse files
authored
Fix conversion_type for NormalizedPolynomialSpace (#243)
* Fix conversion_type for NormalizedPolynomialSpace * don't return nospace * update test
1 parent 6a17e5a commit 803d0fc

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Spaces/PolynomialSpace.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,13 @@ function Fun(::typeof(identity), S::NormalizedPolynomialSpace)
476476
end
477477

478478
function conversion_rule(a::NormalizedPolynomialSpace{S}, b::S) where S<:PolynomialSpace
479-
domainscompatible(domain(a), domain(b)) ? a : NoSpace()
479+
asp = a.space
480+
c = conversion_type(asp, b)
481+
if c == asp
482+
return a
483+
else
484+
return c
485+
end
480486
end
481487

482488
bandwidths(C::ConcreteConversion{NormalizedPolynomialSpace{S,D,R},S}) where {S,D,R} = (0, 0)

test/JacobiTest.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ using Static
191191
@test NormalizedPolynomialSpace(Ultraspherical(j)) ==
192192
NormalizedUltraspherical(NormalizedPolynomialSpace(j))
193193
end
194+
195+
@test conversion_type(NormalizedLegendre(), Jacobi(1,1)) == NormalizedLegendre()
196+
@test conversion_type(Jacobi(1,1), NormalizedLegendre()) == NormalizedLegendre()
197+
@test conversion_type(Jacobi(1,1), NormalizedJacobi(2,2)) == Jacobi(1,1)
198+
@test conversion_type(NormalizedJacobi(2,2), Jacobi(1,1)) == Jacobi(1,1)
194199
end
195200

196201
@test ApproxFunOrthogonalPolynomials.normalization(ComplexF64, Jacobi(-0.5, -0.5), 0) pi

0 commit comments

Comments
 (0)