Skip to content

Commit 987df98

Browse files
authored
Inference in Chebyshev/Ultraspherical Conversion (#88)
1 parent bb345cb commit 987df98

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
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.4.14"
3+
version = "0.4.15"
44

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

src/Spaces/Ultraspherical/UltrasphericalOperators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function Conversion(A::Chebyshev,B::Ultraspherical)
123123
else
124124
d=domain(A)
125125
US=Ultraspherical(order(B)-1,d)
126-
ConversionWrapper(TimesOperator(Conversion(US,B),
126+
ConversionWrapper(TimesOperator(ConcreteConversion(US,B),
127127
Conversion(Chebyshev(d),US)))
128128
end
129129
end
@@ -148,7 +148,7 @@ function Conversion(A::Ultraspherical,B::Ultraspherical)
148148
ConcreteConversion(A,B)
149149
elseif b-a > 1
150150
d=domain(A)
151-
ConversionWrapper(TimesOperator(Conversion(Ultraspherical(b-1,d),B),
151+
ConversionWrapper(TimesOperator(ConcreteConversion(Ultraspherical(b-1,d),B),
152152
Conversion(A,Ultraspherical(b-1,d))))
153153
else
154154
throw(ArgumentError("Cannot convert from $A to $B"))

test/UltrasphericalTest.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,24 @@ import ApproxFunOrthogonalPolynomials: jacobip
99
# Tests whether invalid/unimplemented arguments correctly throws ArgumentError
1010
@test_throws ArgumentError Conversion(Ultraspherical(2), Ultraspherical(1))
1111
@test_throws ArgumentError Conversion(Ultraspherical(3), Ultraspherical(1.9))
12+
13+
# Conversions from Chebyshev to Ultraspherical should lead to a small union of types
14+
Tallowed = Union{
15+
ApproxFunBase.ConcreteConversion{
16+
Chebyshev{ChebyshevInterval{Float64}, Float64},
17+
Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}, Float64},
18+
ApproxFunBase.ConversionWrapper{TimesOperator{Float64, Tuple{Int64, Int64}}, Float64}};
19+
@inferred Tallowed Conversion(Chebyshev(), Ultraspherical(1));
20+
@inferred Tallowed Conversion(Chebyshev(), Ultraspherical(2));
21+
# Conversions between Ultraspherical should lead to a small union of types
22+
Tallowed = Union{
23+
ApproxFunBase.ConcreteConversion{
24+
Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64},
25+
Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}, Float64},
26+
ApproxFunBase.ConversionWrapper{
27+
ConstantOperator{Float64,
28+
Ultraspherical{Int64, ChebyshevInterval{Float64}, Float64}}, Float64},
29+
ApproxFunBase.ConversionWrapper{TimesOperator{Float64, Tuple{Int64, Int64}}, Float64}};
30+
@inferred Tallowed Conversion(Ultraspherical(1), Ultraspherical(2));
1231
end
1332
end

0 commit comments

Comments
 (0)