Skip to content

Commit

Permalink
Remove new file and increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
krish8484 committed Aug 3, 2020
1 parent 5653ca3 commit 1d88133
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/IntervalArithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ include("plot_recipes/plot_recipes.jl")

include("deprecated.jl")

include("overlap.jl")

"""
Region{T} = Union{Interval{T}, IntervalBox{T}}
Expand Down
4 changes: 4 additions & 0 deletions src/decorations/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,7 @@ for (f, domain) in restricted_functions2
DecoratedInterval(r, trv)
end
end

function overlap(xx::DecoratedInterval, yy::DecoratedInterval) where T
return overlap(interval_part(xx) , interval_part(yy))
end
19 changes: 19 additions & 0 deletions src/intervals/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,22 @@ end
hypot(a::Interval{BigFloat}, b::Interval{BigFloat}) = sqrt(a^2 + b^2)

hypot(a::Interval{T}, b::Interval{T}) where T= atomic(Interval{T}, hypot(big53(a), big53(b)))

function overlap(a::Interval, b::Interval)
isempty(a) && isempty(b) && return "bothEmpty"
isempty(a) && !isempty(b) && return "firstEmpty"
!isempty(a) && isempty(b) && return "secondEmpty"
a.hi < b.lo && return "before"
a.lo < a.hi && a.hi == b.lo && b.lo < b.hi && return "meets"
a.lo < b.lo && b.lo < a.hi && a.hi < b.hi && return "overlaps"
a.lo == b.lo && a.hi < b.hi && return "starts"
b.lo < a.lo && a.hi < b.hi && return "containedBy"
b.lo < a.lo && a.hi == b.hi && return "finishes"
a.lo == b.lo && a.hi == b.hi && return "equals"
a.lo < b.lo && b.hi == a.hi && return "finishedBy"
a.lo < b.lo && b.hi < a.hi && return "contains"
b.lo == a.lo && b.hi < a.hi && return "startedBy"
b.lo < a.lo && a.lo < b.hi && b.hi < a.hi && return "overlappedBy"
b.lo < b.hi && b.hi == a.lo && a.lo < a.hi && return "metBy"
b.hi < a.lo && return "after"
end
22 changes: 0 additions & 22 deletions src/overlap.jl

This file was deleted.

1 change: 1 addition & 0 deletions test/ITF1788_tests/ITF1788_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ include("libieeep1788_tests_rev.jl")
include("libieeep1788_tests_set.jl")
include("mpfi.jl")
include("fi_lib.jl")
include("libieeep1788_tests_overlap.jl")

0 comments on commit 1d88133

Please sign in to comment.