Skip to content

Commit

Permalink
remove 'check_intersection' flag
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Oct 14, 2018
1 parent e5615f8 commit 8a475ae
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions src/Intersection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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

"""
Expand Down Expand Up @@ -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
Expand All @@ -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

"""
Expand Down

0 comments on commit 8a475ae

Please sign in to comment.