From 8a475ae96de77e1b8ad177e87ab4662de7e24fe4 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 14 Oct 2018 10:51:59 +0200 Subject: [PATCH] remove 'check_intersection' flag --- src/Intersection.jl | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/Intersection.jl b/src/Intersection.jl index b45e2656df..1b049f4e24 100644 --- a/src/Intersection.jl +++ b/src/Intersection.jl @@ -215,14 +215,13 @@ end function ρ_helper(d::AbstractVector{N}, cap::Intersection{N}, - algorithm::String, - check_intersection::Bool; + algorithm::String; kwargs...) where N<:Real X = cap.X # compact set H = cap.Y # halfspace or hyperplane or line # if the intersection is empty => stop - if check_intersection && is_intersection_empty(X, H, false) + if is_intersection_empty(X, H, false) error("the intersection is empty") end @@ -246,7 +245,6 @@ end <:LazySet{N}, <:Union{HalfSpace{N}, Hyperplane{N}, Line{N}}}; [algorithm]::String="line_search", - [check_intersection]::Bool=true, [kwargs...]) where N<:Real Return the support function of the intersection of a compact set and a @@ -270,10 +268,6 @@ half-space/hyperplane/line in a given direction. generated by the given direction `d` and the hyperplane's normal vector `n` -- `check_intersection` -- (optional, default: `true`) if `true`, check if the - intersection is empty before actually calculating the - support function - ### Output The scalar value of the support function of the set `cap` in the given @@ -283,9 +277,6 @@ direction. It is assumed that the set `cap.X` is compact. -The `check_intersection` flag can be useful if it is known in advance that the -intersection is non-empty. - Any additional number of arguments to the algorithm backend can be passed as keyword arguments. @@ -313,9 +304,8 @@ function ρ(d::AbstractVector{N}, <:LazySet{N}, <:Union{HalfSpace{N}, Hyperplane{N}, Line{N}}}; algorithm::String="line_search", - check_intersection::Bool=true, kwargs...) where N<:Real - return ρ_helper(d, cap, algorithm, check_intersection, kwargs...) + return ρ_helper(d, cap, algorithm; kwargs...) end # symmetric method @@ -324,9 +314,8 @@ function ρ(d::AbstractVector{N}, <:Union{HalfSpace{N}, Hyperplane{N}, Line{N}}, <:LazySet{N}}; algorithm::String="line_search", - check_intersection::Bool=true, kwargs...) where N<:Real - return ρ_helper(d, cap.Y ∩ cap.X, algorithm, check_intersection, kwargs...) + return ρ_helper(d, cap.Y ∩ cap.X, algorithm; kwargs...) end """ @@ -396,9 +385,8 @@ function ρ(d::AbstractVector{N}, <:AbstractPolytope{N}, <:Union{HalfSpace{N}, Hyperplane{N}, Line{N}}}; algorithm::String="line_search", - check_intersection::Bool=true, kwargs...) where N<:Real - return ρ_helper(d, cap, algorithm, check_intersection; kwargs...) + return ρ_helper(d, cap, algorithm; kwargs...) end # symmetric method @@ -407,9 +395,8 @@ function ρ(d::AbstractVector{N}, <:Union{HalfSpace{N}, Hyperplane{N}, Line{N}}, <:AbstractPolytope{N}}; algorithm::String="line_search", - check_intersection::Bool=true, kwargs...) where N<:Real - return ρ_helper(d, cap.Y ∩ cap.X, algorithm, check_intersection; kwargs...) + return ρ_helper(d, cap.Y ∩ cap.X, algorithm; kwargs...) end """