Skip to content

Commit

Permalink
fix and reorder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jan 3, 2021
1 parent 09af14c commit 55a5bc8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/unit_Zonotope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,23 +301,22 @@ for N in [Float64]

gens = N[1 1; -1 1]
Z1 = Zonotope(N[1, 1], gens)
Z2 = Zonotope(N[-1, 1], Matrix{N}(I, 2, 2))
Z3 = minkowski_sum(Z1, Z2)
Z2 = Zonotope(N[-2, -1], Matrix{N}(I, 2, 2))

# intersection with a hyperplane
# isdisjoint with a hyperplane
H1 = Hyperplane(N[1, 1], N(3))
intersection_empty, point = is_intersection_empty(Z1, H1, true)
@test point Z1 && point H1
@test !intersection_empty && point Z1 && point H1
# zonotope without generators (#2204)
Z3 = Zonotope(N[0, 0], Matrix{N}(undef, 2, 0))
@test isdisjoint(Z3, H1)

# isdisjoint
# isdisjoint with another zonotope
result, w = isdisjoint(Z1, Z2, true)
@test isdisjoint(Z1, Z2) && result && w == N[]
Z3 = Zonotope(N[2, 1], Matrix{N}(I, 2, 2))
@test_throws ErrorException isdisjoint(Z2, Z3, true)
@test !isdisjoint(Z2, Z3)
@test_throws ErrorException isdisjoint(Z1, Z3, true)
@test !isdisjoint(Z1, Z3)

# issubset
Z = Zonotope(N[0, 0], N[1 1; -1 1])
Expand Down

0 comments on commit 55a5bc8

Please sign in to comment.