Skip to content

Commit

Permalink
Merge pull request #801 from JuliaReach/schillic/788
Browse files Browse the repository at this point in the history
Fix ambiguities
  • Loading branch information
schillic authored Apr 5, 2024
2 parents 1059d88 + d12f932 commit 1f3db0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
8 changes: 4 additions & 4 deletions docs/src/tutorials/linear_methods/discrete_time.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ V = vertices_list(X0) .|> Singleton |> UnionSetArray
plot!(c)
plot!(V)
plot!(M(pi/4) * c) # rotate 45 degrees
plot!(M(pi/4) * V)
plot!(linear_map(M(pi/4), V))
xlims!(0.0, 1.8) # hide
ylims!(-0.4, 1.4) # hide
Expand All @@ -60,9 +60,9 @@ fig = DisplayAs.Text(DisplayAs.PNG(fig)) # hide
X = sample(X0, 25) .|> Singleton |> UnionSetArray
plot!(X)
plot!(M(pi/4) * X, c=:blue) # rotate 45 degrees
plot!(M(pi/2) * X, c=:green) # rotate 90 degrees
plot!(M(4pi/3) * X, c=:orange) # rotate 180 degrees
plot!(linear_map(M(pi/4), X), c=:blue) # rotate 45 degrees
plot!(linear_map(M(pi/2), X), c=:green) # rotate 90 degrees
plot!(linear_map(M(4pi/3), X), c=:orange) # rotate 180 degrees
plot!(X0, c=:white)
plot!(M(pi/4) * X0, c=:white)
Expand Down
28 changes: 0 additions & 28 deletions src/Flowpipes/setops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ function _split_symmetric_box(D::Int, partition::Vector{Int})
return convert.(IA.IntervalBox, Sp)
end

function Base.:(*)(M::AbstractMatrix, X::UnionSetArray{N,<:AbstractSingleton{N}}) where {N}
return UnionSetArray([linear_map(M, p) for p in array(X)])
end

# ==================================
# Zonotope order reduction methods
# ==================================
Expand Down Expand Up @@ -281,30 +277,6 @@ end
return !_geq(q, min(X)) || !_leq(q, max(X))
end

# if X is polyhedral and Y is the set union of half-spaces, X ∩ Y is empty iff
# X ∩ Hi is empty for each half-space Hi in Y
# NOTE the algorithm below solves an LP for each X ∩ Hi; however, we can proceed
# more efficiently using support functions
# see LazySets.is_intersection_empty_helper_halfspace
@commutative function isdisjoint(X::AbstractPolytope{N},
Y::UnionSetArray{N,<:HalfSpace{N}}) where {N}
if dim(X) == 2 # use vrep in 2D
Xp = convert(VPolygon, X)
return all(Yi -> isdisjoint(Xp, Yi), array(Y))
end

clist_X = constraints_list(X)
for ci in Y.array
# using support functions
#!(-ρ(-hs.a, X) > hs.b) && return false # TODO use robust check

# using LP
Y_ci = vcat(clist_X, ci)
remove_redundant_constraints!(Y_ci) && return false
end
return true
end

# ====================================================================
# Concrete intersection
#
Expand Down

0 comments on commit 1f3db0f

Please sign in to comment.