-
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
Use constraints_list when converting from polytope to HPolytope #932
Comments
Since #416 is now done, shall we reconsider this issue? The fallback implementation to convert from an abstract polytope to an I think that function convert(::Type{HPolytope}, P::AbstractPolytope)
return convert(HPolytope, convert(VPolytope, P))
end
function convert(::Type{HPolyhedron}, P::AbstractPolytope)
return HPolyhedron(constraints_list(P))
end can be unified into function convert(T::Union{Type{HPolytope}, Type{HPolyhedron}}, P::AbstractPolytope;
use_constraint_representation=true)
if use_constraint_representation
return T(constraints_list(P))
else
return convert(T, convert(VPolytope, P))
end
end |
No need for the flag. To create these two types, you always need a list of constraints. So this implementation only makes sense for types that do not support |
True, thanks for the correction. Either the inner call |
#932 - Use constraints list in HPolytope conversion
Currently we have this implementation:
It would be better to not use the V-representation. Every
AbstractPolytope
provides theconstraints_list
method now.There is one problem with
Zonotope
, however, where theconstraints_list
method falls back toconvert
. So we first need #416.The text was updated successfully, but these errors were encountered: