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
Parents for polyhedra #11763
Comments
comment:1
Would there be any benefit in supporting real fields of arbitrary precision? |
comment:2
We don't have an implementation of the double description algorithm for other base rings, so we wouldn't be able to compute anything. |
Attachment: trac_11763_ZZ_polyhedron.patch.gz Initial patch |
Initial patch |
This comment has been minimized.
This comment has been minimized.
comment:3
Attachment: trac_11763_parents_for_polyhedron.py.gz This is now ready for inclusion. Marshall, are you interested in reviewing this patch and its dependency? ;-) |
Author: Volker Braun |
This comment has been minimized.
This comment has been minimized.
comment:5
Fix comparison of H/V-representation objects:
Now returns |
Updated patch |
Attachment: trac_11763_parents_for_polyhedron.patch.gz Attachment: trac_11763_ZZ_polyhedron-rebase.patch.gz Rebased for new patch at 11634 |
Attachment: trac_11763_parents-rebase.patch.gz Rebased for new patch at #11634 |
comment:6
The new patch I posted at #11634 broke these, so I rebased them. Apply trac_11763_ZZ_polyhedron-rebase.patch, trac_11763_parents-rebase.patch |
This comment has been minimized.
This comment has been minimized.
comment:7
Apply trac_11763_zz_polyhedron-rebase.patch, trac_11763_parents-rebase.patch (bloody patchbot!) |
comment:8
No matter what I do, the patchbot won't pick up the two patches above, so I've done a single qfolded patch. Hopefully this will now work! |
This comment has been minimized.
This comment has been minimized.
Apply only this patch. Patch against 5.0.beta7 |
comment:10
Attachment: trac_11763-polyhedra_coercion_folded.patch.gz Sorry, I made a hash of rebasing the patch, so here's a new version. |
comment:11
This changes the behavior of the .vertices() method, returning "sage.geometry.polyhedron.representation.Vertex" objects instead of simple lists of coordinates. This breaks some code of mine, so I think there should be a deprecation warning before introducing this. I don't really like the behavior, but I see that .vertices_list() does return a list of lists of coordinates. This patch also seems to slow things down a bit, but I haven't carefully tested that aspect. |
comment:12
The |
comment:13
Well, no, there is quite a bit of my code that does not work fine, and I am not talking about artificial test cases. Here is a shortened example of something this patch breaks:
This now gives a "TypeError: 'sage.rings.integer.Integer' object does not support indexing". |
comment:14
For the record: #12541 and #12544 have a similar situation. I replaced tuples with tuple-like containers and some stuff got broken. As it turned out, it was not too difficult to fix it by eliminating some "hard typechecks", although they are still waiting for an approval. If this is the case here, perhaps it is also not too difficult to fix. As I understand it, direct typechecking is not welcomed in either Python or Sage, so if the new class implements list interface, it should be OK to use in place of the old one. If it does break some code, it is a bug and it should be fixed before merging, but not a reason for avoiding the change entirely or inventing elaborate deprecation scheme... |
comment:15
There is a doctest failing on 5.0.beta10, according to the patchbot (something to do with the new associahedron class from #10817) |
comment:50
For the patchbot: Apply trac_11763-polyhedra_coercion_folded.2.patch, trac_11763_fix_associahedron.patch, trac_11763_lazy_import.patch |
Reviewer: Dmitrii Pasechnik |
comment:52
On some systems, such as OS X >= 10.6 and Itanium:
|
Attachment: trac_11763-polyhedra_coercion_folded.2.patch.gz Updated patch |
comment:54
I've added the trivial fix. |
comment:55
And now I noticed that this was already fixed in #12193. |
Merged: sage-5.6.beta1 |
Attachment: trac_11763-polyhedra_coercion_folded.3.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:57
Rebased to sage-5.6.beta0. |
comment:58
Hey Volker, Do you remember what was the reason for this change in diff --git a/sage/geometry/cone.py b/sage/geometry/cone.py
Index: sage/geometry/cone.py
===================================================================
--- a/sage/geometry/cone.py
+++ b/sage/geometry/cone.py
@@ -568,7 +568,10 @@
V = lattice.base_extend(QQ)
for n, ray in enumerate(rays):
try:
- ray = V(ray)
+ if isinstance(ray, (list, tuple, V._element_class)):
+ ray = V(ray)
+ else:
+ ray = V(list(ray))
except TypeError:
raise TypeError("cannot convert %s to %s!" % (ray, V))
if ray.is_zero(): It seems that if |
comment:59
I think the idea is to allow arbitrary iterables in |
comment:60
I just was wondering what was the particular use case - found this bit because of the fuzz with another patch. I don't mind it, although changing what |
comment:61
Replying to @novoselt:
Wasn't that one of our design decisions, that the ToricLattice should forbid conversion between the lattice and its dual? |
comment:62
Replying to @vbraun:
We prohibit coercion, conversion is certainly possible, and here |
The Polyhedron class is, so far, free-standing with some sort of coercion for the base ring tacked manually. This ticket strives to add parents for polyhedra and make the base ring coercion work more naturally.
There will be 3 supported base rings:
Apply:
Depends on #11634
Depends on #13109
Depends on #11310
CC: @robertwb
Component: geometry
Author: Volker Braun
Reviewer: Dmitrii Pasechnik
Merged: sage-5.6.beta1
Issue created by migration from https://trac.sagemath.org/ticket/11763
The text was updated successfully, but these errors were encountered: