Skip to content

Commit 5e540b0

Browse files
authored
improve inference in maxspace_rule (#65)
1 parent 2d3239f commit 5e540b0

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-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 = "ApproxFunSingularities"
22
uuid = "f8fcb915-6b99-5be2-b79a-d6dbef8e6e7e"
3-
version = "0.3.11"
3+
version = "0.3.12"
44

55
[deps]
66
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"

src/JacobiWeightOperators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,15 @@ for (OPrule,OP) in ((:maxspace_rule,:maxspace),(:union_rule,:union))
251251
function $OPrule(A::JacobiWeight, B::JacobiWeight)
252252
if domainscompatible(A,B) && isapproxinteger(A.β-B.β) && isapproxinteger(A.α-B.α)
253253
ms=$OP(A.space,B.space)
254-
if min(A.β,B.β)==0.0 && min(A.α,B.α) == 0.0
254+
if min(A.β,B.β) == 0 && min(A.α,B.α) == 0
255255
return ms
256256
else
257257
return JacobiWeight(min(A.β,B.β),min(A.α,B.α),ms)
258258
end
259259
end
260260
NoSpace()
261261
end
262-
$OPrule(A::JacobiWeight, B::Space{<:IntervalOrSegmentDomain}) = $OPrule(A,JacobiWeight(0.,0.,B))
262+
$OPrule(A::JacobiWeight, B::Space{<:IntervalOrSegmentDomain}) = $OPrule(A,JacobiWeight(0,0,B))
263263
end
264264
end
265265

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ end
193193
s = JacobiWeight(1, 1, us)
194194
@test order(s) == order(us)
195195
end
196+
197+
@testset "inference in maxspace" begin
198+
sp = JacobiWeight(half(Odd(1)), half(Odd(1)), Legendre())
199+
@test (@inferred maxspace(sp, sp)) == sp
200+
201+
@test (@inferred maxspace(sp, Legendre())) == ApproxFunBase.NoSpace()
202+
end
196203
end
197204

198205
@testset "Ray and Line" begin

0 commit comments

Comments
 (0)