Opened 3 years ago
Last modified 8 weeks ago
#27063 closed task
Transition of combinatorial computations of Polyhedron to Combinatorial Type — at Version 20
Reported by: | gh-kliem | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | geometry | Keywords: | polyhedron, face lattice |
Cc: | jipilab, mkoeppe | Merged in: | |
Authors: | Jonathan Kliem | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | public/27063 (Commits, GitHub, GitLab) | Commit: | c4ccf860ba2906123bd20b4e3a49ad3e94ca7bdb |
Dependencies: | #28621, #28625, #28626 | Stopgaps: |
Description (last modified by )
In #26887 we created a new class, that handles the calculations depending only on the combinatorial type more quickly.
The goal of this ticket is to make use of this class through Polyhedron_base
.
Add methods:
Replace the existing computation:
- #28625:
f_vector
, - #28646
faces
, - #28626:
graph
/vertex_graph
, vertex_adjacency_matrix
vertex_digraph
facet_adjacency_matrix
,face_lattice
.
Migrate code to CombinatorialPolyhedron?:
is_prism
Change History (20)
comment:1 Changed 3 years ago by
- Milestone changed from sage-8.6 to sage-8.7
comment:2 Changed 3 years ago by
- Milestone changed from sage-8.7 to sage-8.8
comment:3 Changed 3 years ago by
- Branch set to public/27063
- Commit set to 25407f852d524693571b97e1d26e4fdd264b51fe
- Dependencies changed from #26887 to #26887, #27987
- Description modified (diff)
Last 10 new commits:
9b69f50 | added documentation and examples to each module
|
4e8fd8c | correct hyperlinks
|
72ac3b0 | documentation fix
|
611099f | Do not iterate twice for CombinatorialPolyhedron.facets()
|
d38e130 | added combinatorial face
|
ca60665 | improved docstring in list_of_all_faces
|
abe00b6 | fixed small issues
|
8765313 | A number of small edits.
|
d419d72 | Merge branch 'public/26887' of git://trac.sagemath.org/sage into public/27063
|
25407f8 | faces, f_vector, vertex_graph, vertex_digraph, neighborliness now use CombinatorialPolyhedron
|
comment:4 Changed 3 years ago by
- Commit changed from 25407f852d524693571b97e1d26e4fdd264b51fe to c4ccf860ba2906123bd20b4e3a49ad3e94ca7bdb
Branch pushed to git repo; I updated commit sha1. New commits:
c4ccf86 | face lattice by CombinatorialPolyhedron
|
comment:5 Changed 3 years ago by
- Milestone sage-8.8 deleted
As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).
comment:6 Changed 3 years ago by
- Milestone set to sage-8.9
comment:7 follow-up: ↓ 8 Changed 3 years ago by
- Milestone changed from sage-8.9 to sage-pending
Concerning the .faces()
method. Currently, .iter_face
only deals with proper faces. ... is that the intended behavior?
From an old list (so maybe some of them are renamed), I also saw the following methods make use of .face_lattice
, and probably would benefit from the combinatorial polyhedra:
- adjacency_matrix
- facet_adjacency_matrix
- facial_adjacencies
- is_simple
- vertex_adjacency_matrix
It would be nice to make a thorough checking of which methods make use of "old style face lattice" things. It would be bad to not make the whole Polyhedron
objects not benefit from this new class...
comment:8 in reply to: ↑ 7 ; follow-up: ↓ 9 Changed 3 years ago by
Replying to jipilab:
Concerning the
.faces()
method. Currently,.iter_face
only deals with proper faces. ... is that the intended behavior?
This is simply, because my method of intersecting faces and avoiding double counting has no guarantee to hit the empty face in the unbounded case. So one has to manually add it anyway. I would prefer leaving it like this in FaceIterator
. But I can see that one wants to add those two extra faces (or only one for the empty polyhedron) when wrapping the class.
From an old list (so maybe some of them are renamed), I also saw the following methods make use of
.face_lattice
, and probably would benefit from the combinatorial polyhedra:
- adjacency_matrix
- facet_adjacency_matrix
- facial_adjacencies
what does it do, I can't find it
- is_simple
not anymore
- vertex_adjacency_matrix
It would be nice to make a thorough checking of which methods make use of "old style face lattice" things. It would be bad to not make the whole
Polyhedron
objects not benefit from this new class...
Yes, that's my plan. If I actually go through with it and make CombinatorialPolyhedron
a parent of Polyhedron_base
, as was proposed in #10777, then CombinatorialPolyhedron
should do all calculations that depend only on the incidence matrix.
comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 3 years ago by
Replying to gh-kliem:
Replying to jipilab:
Concerning the
.faces()
method. Currently,.iter_face
only deals with proper faces. ... is that the intended behavior?This is simply, because my method of intersecting faces and avoiding double counting has no guarantee to hit the empty face in the unbounded case. So one has to manually add it anyway. I would prefer leaving it like this in
FaceIterator
. But I can see that one wants to add those two extra faces (or only one for the empty polyhedron) when wrapping the class.
Sounds good.
From an old list (so maybe some of them are renamed), I also saw the following methods make use of
.face_lattice
, and probably would benefit from the combinatorial polyhedra:
- adjacency_matrix
- facet_adjacency_matrix
- facial_adjacencies
what does it do, I can't find it
Then, fine.
- is_simple
not anymore
Good
- vertex_adjacency_matrix
It would be nice to make a thorough checking of which methods make use of "old style face lattice" things. It would be bad to not make the whole
Polyhedron
objects not benefit from this new class...Yes, that's my plan. If I actually go through with it and make
CombinatorialPolyhedron
a parent ofPolyhedron_base
, as was proposed in #10777, thenCombinatorialPolyhedron
should do all calculations that depend only on the incidence matrix.
Great! Then, one should also take care to not let the Polyhedron_base
overwrite them, but duh... I'm sure you know what your doing... :)
comment:10 in reply to: ↑ 9 ; follow-up: ↓ 11 Changed 3 years ago by
Replying to jipilab:
Great! Then, one should also take care to not let the
Polyhedron_base
overwrite them, but duh... I'm sure you know what your doing... :)
Well, you can always access overwritten methods using super
.
Does it make sense to leave a method as e.g. simple
in Polyhedron_base
just to have a more specific docstring? Otherwise we would eventually end up with docstrings gathering all examples from Polyhedron
, LatticePolytope
and Cone
.
comment:11 in reply to: ↑ 10 Changed 3 years ago by
Replying to gh-kliem:
Replying to jipilab:
Great! Then, one should also take care to not let the
Polyhedron_base
overwrite them, but duh... I'm sure you know what your doing... :)Well, you can always access overwritten methods using
super
.Does it make sense to leave a method as e.g.
simple
inPolyhedron_base
just to have a more specific docstring? Otherwise we would eventually end up with docstrings gathering all examples fromPolyhedron
,LatticePolytope
andCone
.
I am not 100% sure about this. I believe that the method would stay in Polyhedron_base
(think about the documentation online too) because one expects to see it there (and one does not directly think about the CombinatorialPolyhedron
class directly, maybe) and the method would be only a couple of lines long and calling the combinatorial algorithm using super
with the appropriate parameters.
On the long run, CombinatorialPolyhedron
will contain the bulk of codes that strictly makes use of combinatorial data and Polyhedron_base
things that use the geometry.
Further, concerning the present ticket, I believe it would make sense to make it a preparation ticket. Then each method would have 1 ticket. This way the changes will be more manageable.
Another open question: currently how is the relation between a Polyhedron
object and a CombinatorialPolyhedron
object? I guess that as of now, since the double description is computed by default, it is worth maybe creating the combinatorial counter part as an attribute and make it accessible via a method say named .combinatorial_polyhedron
. This might make it easier to then transfer the computations to the combinatorial type.
When I create a combinatorial polyhedron from a polyhedron, it seems to keep the polyhedron object. Ideally, it would be nice to be able to go back and forth between them like it is for LP
and Polyhedron
(okay, it is not fully bakc and forth but still).
... and it would be nice if the methods of CombinatorialPolyhedron
have exactly the same names for the same things H_representation
vs Hrepr
.
comment:12 Changed 3 years ago by
Ok, this is a bunch of things. I realized that at some point it makes sense to create some sort of meta ticket for CombinatorialPolyhedron
, also I realize that this ticket is more an agenda than anything else.
First of all, we should figure out, whether Polyhedron
shall inherit from CombinatorialPolyhedron
as a base class or whether its better to have it as a (lazy) method available.
Having it as a base class was proposed in #10777.
Maybe I should start a discussion on sage-devel to see what (interested) people think.
comment:13 follow-up: ↓ 16 Changed 3 years ago by
- Dependencies changed from #26887, #27987 to #28621
- Description modified (diff)
- Status changed from new to needs_review
comment:14 Changed 3 years ago by
- Description modified (diff)
comment:15 Changed 3 years ago by
- Status changed from needs_review to needs_work
- Type changed from enhancement to task
comment:16 in reply to: ↑ 13 Changed 3 years ago by
- Summary changed from Polyhedron: let CombinatorialPolyhedron do all combinatorial calculations to Transition of combinatorial computations of Polyhedron to Combinatorial Type
Replying to gh-kliem:
I'm going to put this on needs review, so that people looking at #22420 will notice.
This way I can avoid adding each of the tickets to #22420.
If there is a better way of doing it, please tell me.
Putting it at needs review is not the appropriate status. In #22420, change the title of the #27063 ticket to "TASK: XXX", where XXX is the current title. Then, what is written will be sufficient to understand what is going on in this ticket. No need to add every single ticket from here, to #22420.
comment:17 Changed 3 years ago by
- Description modified (diff)
Finally, it might make sense to move code to
CombinatorialPolyhedron
. E.g.is_prism
can be checked there and should only be checked there to avoid code duplication.
Yes, I agree, I adapted the description of the ticket.
comment:18 Changed 3 years ago by
- Dependencies changed from #28621 to #28621, #28625, #28626
- Description modified (diff)
comment:19 Changed 3 years ago by
- Description modified (diff)
comment:20 Changed 3 years ago by
- Description modified (diff)
Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist.