Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
version:
- '1.5'
- '^1.6.0-0'
- '1.6'
- 'nightly'
os:
- ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name = "IntervalConstraintProgramming"
uuid = "138f1668-1576-5ad7-91b9-7425abbf3153"
version = "0.12.2"
version = "0.12.3"

[compat]
IntervalArithmetic = "0.16, 0.17"
IntervalArithmetic = "0.16, 0.17, 0.18"
IntervalContractors = "0.4"
IntervalRootFinding = "0.5"
MacroTools = "0.4, 0.5"
Expand Down
35 changes: 20 additions & 15 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,37 @@ end
S1 = S1a ∩ S1b
paving = pave(S1, IntervalBox(-3..3, -3..3), 2.0, 0.5)

@test paving.inner == [IntervalBox(1.5..3, 0..3), IntervalBox(0..1.5, 1.5..3)]
@test Set(paving.inner) == Set([IntervalBox(1.5..3, 0..3), IntervalBox(0..1.5, 1.5..3)])
@test length(paving.inner) == 2
@test isempty(paving.boundary) == false

S2 = S1a ∪ S1b
paving = pave(S2, IntervalBox(-3..3, -3..3), 0.1)
@test paving.inner == [IntervalBox(-3..0, 0..3), IntervalBox(0..3, -3..3)]
@test Set(paving.inner) == Set([IntervalBox(-3..0, 0..3), IntervalBox(0..3, -3..3)])
@test length(paving.inner) == 2
@test isempty(paving.boundary) == false


S3 = @constraint x^2 + y^2 <= 1
X = IntervalBox(-∞..∞, -∞..∞)
paving = pave(S3, X, 1.0, 0.5)

@test paving.inner == [IntervalBox(Interval(0.0, 0.5), Interval(0.0, 0.8660254037844386)),
IntervalBox(Interval(0.0, 0.5), Interval(-0.8660254037844386, 0.0)),
IntervalBox(Interval(-0.5, 0.0), Interval(0.0, 0.8660254037844386)),
IntervalBox(Interval(-0.5, 0.0), Interval(-0.8660254037844386, 0.0))]

@test paving.boundary == [ IntervalBox(Interval(0.5, 1.0), Interval(0.0, 0.8660254037844387)),
IntervalBox(Interval(0.0, 0.5), Interval(0.8660254037844386, 1.0)),
IntervalBox(Interval(0.5, 1.0), Interval(-0.8660254037844387, 0.0)),
IntervalBox(Interval(0.0, 0.5), Interval(-1.0, -0.8660254037844386)),
IntervalBox(Interval(-0.5, 0.0), Interval(0.8660254037844386, 1.0)),
IntervalBox(Interval(-1.0, -0.5), Interval(0.0, 0.8660254037844387)),
IntervalBox(Interval(-0.5, 0.0), Interval(-1.0, -0.8660254037844386)),
IntervalBox(Interval(-1.0, -0.5), Interval(-0.8660254037844387, 0.0))]
@test Set(paving.inner) == Set([IntervalBox(Interval(0.0, 0.5), Interval(0.0, 0.8660254037844386)),
IntervalBox(Interval(0.0, 0.5), Interval(-0.8660254037844386, 0.0)),
IntervalBox(Interval(-0.5, 0.0), Interval(0.0, 0.8660254037844386)),
IntervalBox(Interval(-0.5, 0.0), Interval(-0.8660254037844386, 0.0))])

@test Set(paving.boundary) == Set([ IntervalBox(Interval(0.5, 1.0), Interval(0.0, 0.8660254037844387)),
IntervalBox(Interval(0.0, 0.5), Interval(0.8660254037844386, 1.0)),
IntervalBox(Interval(0.5, 1.0), Interval(-0.8660254037844387, 0.0)),
IntervalBox(Interval(0.0, 0.5), Interval(-1.0, -0.8660254037844386)),
IntervalBox(Interval(-0.5, 0.0), Interval(0.8660254037844386, 1.0)),
IntervalBox(Interval(-1.0, -0.5), Interval(0.0, 0.8660254037844387)),
IntervalBox(Interval(-0.5, 0.0), Interval(-1.0, -0.8660254037844386)),
IntervalBox(Interval(-1.0, -0.5), Interval(-0.8660254037844387, 0.0))])

@test length(paving.inner) == 4
@test length(paving.boundary) == 8
end


Expand Down