From 9c6efe8b15c02ebd3cee37d10f3cac4e90167898 Mon Sep 17 00:00:00 2001 From: Marcelo Forets Date: Sat, 14 May 2022 22:31:01 -0700 Subject: [PATCH 1/3] Update intervalbox.jl --- src/multidim/intervalbox.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/multidim/intervalbox.jl b/src/multidim/intervalbox.jl index df7db112d..7cd545d4e 100644 --- a/src/multidim/intervalbox.jl +++ b/src/multidim/intervalbox.jl @@ -81,6 +81,11 @@ end ∈(X::AbstractVector, Y::IntervalBox{N,T}) where {N,T} = all(X .∈ Y) ∈(X, Y::IntervalBox{N,T}) where {N,T} = throw(ArgumentError("$X ∈ $Y is not defined")) +# mixing intervals with one-dimensional interval boxes +for op in (:⊆, :⊂, :⊃, :∩, :∪) + @eval $(op)(a::Interval, X::IntervalBox{1}) = $(op)(a, first(X)) + @eval $(op)(X::IntervalBox{1}, a::Interval) = $(op)(first(X), a) +end #= On Julia 0.6 can now write From 6d3a0ada963a7da7604f832b99870e22956e450f Mon Sep 17 00:00:00 2001 From: Marcelo Forets Date: Sun, 15 May 2022 01:55:24 -0700 Subject: [PATCH 2/3] Update multidim.jl --- test/multidim_tests/multidim.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/multidim_tests/multidim.jl b/test/multidim_tests/multidim.jl index dfe9ce775..d210da253 100644 --- a/test/multidim_tests/multidim.jl +++ b/test/multidim_tests/multidim.jl @@ -66,7 +66,12 @@ let X, A # avoid problems with global variables @test A ∪ B.v == B end - + x = 0.5 .. 3 + a = IntervalBox(A[1]) # 1 .. 2 + @test !(x ⊆ a) && a ⊆ x + @test !(x ⊂ a) && a ⊂ x + @test x ∩ a == a ∩ x == A[1] + @test x ∪ a == a ∪ x == x X = IntervalBox(1..2, 3..4) Y = IntervalBox(3..4, 3..4) From aaad6db1ae2cc75c39b467cd3436e1fccf87aced Mon Sep 17 00:00:00 2001 From: Marcelo Forets Date: Sun, 15 May 2022 01:56:03 -0700 Subject: [PATCH 3/3] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 8df0c7368..1402ad95f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "IntervalArithmetic" uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" repo = "https://github.com/JuliaIntervals/IntervalArithmetic.jl.git" -version = "0.20.5" +version = "0.20.6" [deps] CRlibm = "96374032-68de-5a5b-8d9e-752f78720389"