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

Unifying and streamlining Polytopes interfaces #677

Closed
10 of 12 tasks
lkastner opened this issue Sep 10, 2021 · 5 comments · Fixed by #700
Closed
10 of 12 tasks

Unifying and streamlining Polytopes interfaces #677

lkastner opened this issue Sep 10, 2021 · 5 comments · Fixed by #700
Labels
enhancement New feature or request topic: polyhedral geometry Issue concerns polyhedral geometry code

Comments

@lkastner
Copy link
Member

lkastner commented Sep 10, 2021

This is a list of some issues with the current implementation that need to be straightened out. In particular, the Cone and Polyhedron interfaces need to be unified. Some of these issues might already be solved, @alexej-jordan @benlorenz feel free to check off those (or add issues I missed).

  • There should be facets(C::Cone) similar to facets(P::Polyhedron)
  • facets_as_point_matrix should be integrated into facets using the as parameter
  • facets_as_halfspace_matrix_pair should be integrated into facets using the as parameter
  • There should be f_vector(C::Cone)
  • Should PolyhedronRayIterator, PolyhedralFanRayIterator, and ConeRayIterator be the same?
  • Since vertices, rays, and facets return iterators, lineality_space should also return an iterator
  • Did we add a constructor for a cone from inequalities yet?
  • We should probably add linear_hull(C::Cone) and affine_hull(P::Polyhedron)
  • There should be f_vector(F::PolyhedralFan)
  • Should we make a submodule for the Polytopes part?
  • We need to check that the following n* functions are available wherever applicable: nrays, nfacets, nvertices
  • The as parameter does not need separate structs, it should just take e.g. Matrix when returning a matrix, Polyhedron when returning an iterator over polyhedra, etc.
@lkastner lkastner added enhancement New feature or request topic: polyhedral geometry Issue concerns polyhedral geometry code labels Sep 10, 2021
@alexej-jordan
Copy link
Collaborator

alexej-jordan commented Sep 11, 2021

I checked off some of theses which are already covered within #578 . Functionality is already implemented, I am mostly working on documentation and tests right now. these are points number 1, 2, 3, 5 and 6.
I have implemented a different solution for number 2 and 3, where this is replaced by point_matrix(iter::VectorIterator) so that you now can for example call point_matrix(vertices(P)) (analogue for halfspace_matrix_pair).

Concerning the last point, I do also agree. I would like to apply these changes within #578 because I already interfered with this issue there, and it has a lot to do with the iterators.

I am not sure if we should make a submodule. How is the consensus on the split up into submodules within Oscar?

EDIT: Also, I noticed that facets(as::Type{T}, P::Polyhedron) allows as = Polyhedron. It would be consequent to transfer this to cones, as well. The way data is stored within a HalfspaceIterator (return type of facets for both Polyhedron and Cone) requires point number 7, a way to construct a cone from inequalities, which again should also allow fitting iterator input. In conclusion, these changes should be part of #578 , too.

@fieker
Copy link
Contributor

fieker commented Sep 13, 2021 via email

@lkastner
Copy link
Member Author

So one of the reasons was the struct Point which also exists in the experimental section, but not in the form that we want to use it. If we made a submodule we would not have to come up with an awkward name.

Another reason I was thinking about this is the tabcompletion. If you do Oscar. + tab it will get cluttered after a while, but we could at least group the functions in a meaningful way using modules.

@fieker
Copy link
Contributor

fieker commented Sep 15, 2021 via email

@lkastner lkastner mentioned this issue Sep 26, 2021
@lkastner
Copy link
Member Author

I postpone the submodule question to a different PR.

@lkastner lkastner linked a pull request Sep 28, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: polyhedral geometry Issue concerns polyhedral geometry code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants