-
Notifications
You must be signed in to change notification settings - Fork 32
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
Revise support function for (un)bounded sets #1115
Comments
With the half-space, i think that the actual behavior is fine: julia> h = HalfSpace([1.0, -1.0], 0.0);
julia> σ([1.0, -1.0], h)
2-element Array{Float64,1}:
0.0
0.0
julia> σ([-1.0, 1.0], h)
ERROR: the support vector for the halfspace with normal direction [1.0, -1.0] is not defined along a direction [-1.0, 1.0]
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] #σ_helper#65 at /Users/forets/.julia/dev/LazySets/src/Hyperplane.jl:351 [inlined]
[3] (::getfield(LazySets, Symbol("#kw##σ_helper")))(::NamedTuple{(:error_unbounded, :halfspace),Tuple{Bool,Bool}}, ::typeof(LazySets.σ_helper), ::Array{Float64,1}, ::Hyperplane{Float64}) at ./none:0
[4] σ(::Array{Float64,1}, ::HalfSpace{Float64}) at /Users/forets/.julia/dev/LazySets/src/HalfSpace.jl:112
[5] top-level scope at none:0
julia> ρ([1.0, -1.0], h)
0.0
julia> ρ([-1.0, 1.0], h)
Inf |
I know that this result is inconsistent with the julia> p = HPolyhedron([h])
HPolyhedron{Float64}(HalfSpace{Float64}[HalfSpace{Float64}([1.0, -1.0], 0.0)])
julia> σ([1.0, -1.0], p)
2-element Array{Float64,1}:
0.0
0.0
julia> σ([-1.0, 1.0], p)
2-element Array{Float64,1}:
-Inf
0.0
julia> ρ([1.0, -1.0], p)
0.0
julia> ρ([-1.0, 1.0], p)
Inf I doubt that there is "practical" interest in returning |
Yes, because we explicitly define the behavior in those cases. But I did not say anything about the
That we want to resolve in #750. Again, the reason why the problem does not occur here is that we explicitly handle this case.
Please not, we spent efforts to support it after we discussed that we want this.
The main application where the result of |
I found out that we already define the support function for all possibly unbounded set types (except for |
|
#1115 - Add better documentation for ρ to LazySet
There is a problem with the support function for unbounded sets. If an entry of the direction is zero, and the corresponding entry of the support vector is
±Inf
, then the result isNaN
.The reason for this is:
In #1114 we defined (but reverted again) a new dot product and replaced the definition of ρ. However, this makes the computation less efficient. For sets that are known to be bounded, this modification is not needed.
So we should actually define the old version as a more efficient alternative, and call it from (statically) bounded set types.
The text was updated successfully, but these errors were encountered: