diff --git a/docs/src/lib/sets/Interval.md b/docs/src/lib/sets/Interval.md index b8b175be3c..fad6557076 100644 --- a/docs/src/lib/sets/Interval.md +++ b/docs/src/lib/sets/Interval.md @@ -23,7 +23,6 @@ dim(::Interval) σ(::AbstractVector, ::Interval) ρ(::AbstractVector, ::Interval) ∈(::AbstractVector, ::Interval) -∈(::Number, ::Interval) an_element(::Interval) vertices_list(::Interval) translate(::Interval, ::AbstractVector) diff --git a/src/Sets/Interval/in.jl b/src/Sets/Interval/in.jl index a4506d70fd..22b59f4d25 100644 --- a/src/Sets/Interval/in.jl +++ b/src/Sets/Interval/in.jl @@ -17,21 +17,3 @@ function ∈(v::AbstractVector, x::Interval) "incompatible with an interval" return @inbounds v[1] ∈ x.dat end - -""" - ∈(v::Number, x::Interval) - -Check whether a number is contained in an interval. - -### Input - -- `v` -- scalar -- `x` -- interval - -### Output - -`true` iff `x` contains the singleton `[v]`. -""" -function ∈(v::Number, x::Interval) - return v ∈ x.dat -end diff --git a/test/Sets/BallInf.jl b/test/Sets/BallInf.jl index 45cfe13dac..5b4df4443f 100644 --- a/test/Sets/BallInf.jl +++ b/test/Sets/BallInf.jl @@ -70,7 +70,7 @@ for N in [Float64, Rational{Int}, Float32] # support vector for single entry vector svec = σ(SingleEntryVector(2, 3, N(2)), BallInf(zeros(N, 3), N(2))) - @test svec[1] ∈ Interval(N[-2, 2]) && svec[2] == N(2) && svec[3] ∈ Interval(N[-2, 2]) + @test -2 <= svec[1] <= 2 && svec[2] == N(2) && -2 <= svec[3] <= 2 # support function B = BallInf(N[1, 2], N(1)) diff --git a/test/Sets/Interval.jl b/test/Sets/Interval.jl index a110993ef4..0ee2eb55bc 100644 --- a/test/Sets/Interval.jl +++ b/test/Sets/Interval.jl @@ -37,6 +37,8 @@ for N in [Float64, Float32, Rational{Int}] # test interface method an_element and membership @test an_element(x) ∈ x + # number in interval is invalid + @test_throws MethodError N(1) ∈ x # test containment @test x ⊆ x @test x ⊈ N(0.2) * x