Skip to content

Commit 7f435e2

Browse files
authored
don't specialize greater than (#154)
* don't specialize greater than * remove omitted method * version bump to v0.6.8
1 parent 7ced245 commit 7f435e2

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.6.7"
3+
version = "0.6.8"
44

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

src/Domain.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ invfromcanonicalD(d::Domain,x...) = 1/fromcanonicalD(d,x...)
167167
## sorting
168168
# we sort spaces lexigraphically by default
169169

170-
for OP in (:<,:(<=),:>,:(>=),:(isless))
170+
for OP in (:<,:(<=),:(isless))
171171
@eval $OP(a::Domain,b::Domain)=$OP(string(a),string(b))
172172
end
173173

src/Space.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ end
439439
## sorting
440440
# we sort spaces lexigraphically by default
441441

442-
for OP in (:<,:(<=),:>,:(>=),:(isless))
442+
for OP in (:<,:(<=),:(isless))
443443
@eval $OP(a::Space,b::Space)=$OP(string(a),string(b))
444444
end
445445

src/specialfunctions.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ end
312312

313313
## <,≤,>,≥
314314

315-
for op in (:<,:>)
315+
for op in (:<,)
316316
@eval begin
317317
function $op(f::Fun,c::Number)
318318
if length(roots(f-c))==0
@@ -333,7 +333,7 @@ end
333333

334334

335335

336-
for op in (:(<=),:(>=))
336+
for op in (:(<=),)
337337
@eval begin
338338
function $op(f::Fun,c::Number)
339339
rts=roots(f-c)
@@ -429,7 +429,7 @@ for SP in (:ConstantSpace,:PointSpace)
429429
end
430430
end
431431

432-
for OP in (:<,:(Base.isless),:(<=),:>,:(>=))
432+
for OP in (:<,:(Base.isless),:(<=))
433433
@eval begin
434434
$OP(a::Fun{CS},b::Fun{CS}) where {CS<:ConstantSpace} = $OP(convert(Number,a),Number(b))
435435
$OP(a::Fun{CS},b::Number) where {CS<:ConstantSpace} = $OP(convert(Number,a),b)

test/SpacesTest.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ using ApproxFunOrthogonalPolynomials
160160
@test (@inferred convert(Fun, 2)) == Fun(2)
161161
f = Fun(2)
162162
@test (@inferred convert(Fun{typeof(space(f))}, 2)) == f
163+
164+
f = Fun(2, ConstantSpace(0..1))
165+
g = Fun(3, ConstantSpace(0..1))
166+
@test f < g
167+
@test f <= g
168+
@test g > f
169+
@test g >= f
170+
@test 1 < f < 3
163171
end
164172

165173
@testset "promotion" begin
@@ -172,6 +180,10 @@ using ApproxFunOrthogonalPolynomials
172180
end
173181
end
174182

183+
@testset "Comparison" begin
184+
@test PointSpace(1:3) > ConstantSpace(0..1)
185+
end
186+
175187
@testset "union and AmbiguousSpace" begin
176188
a = PointSpace(1:3)
177189
@test (@inferred union(a, a)) == a

test/runtests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ end
8181
@test union(1..2, d) == 1..2
8282
end
8383
end
84+
85+
@testset "comparison" begin
86+
# Lexicographic comparison
87+
@test ApproxFunBase.AnyDomain() < ApproxFunBase.EmptyDomain()
88+
@test 1..2 < 1..3
89+
@test 1..2 <= 1..2
90+
@test 1..2 >= 1..2
91+
@test 1..3 >= 1..2
92+
end
8493
end
8594

8695
@time include("MatrixTest.jl")

0 commit comments

Comments
 (0)