Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ambiguities #801

Merged
merged 2 commits into from
Apr 5, 2024
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
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))
mforets marked this conversation as resolved.
Show resolved Hide resolved
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},
mforets marked this conversation as resolved.
Show resolved Hide resolved
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
Loading