Thanks very much for taking a look at polyhedra.py. I really enjoy working on it, and I have some research interests in polyhedra, but I am not a deep expert in the subject and I have been hoping for constructive criticism and help.
I thought the union command made sense, but I think I understand why you don't like it. I have been thinking about what the right sort of classes need to be created to handle more general polytopes - i.e. non- convex polytopes like some stellated ones, which can be thought of as the union of convex polytopes in the sense you are thinking of (I hope). It seems to me that it would be good to have more structure than simply a list of polytopes, but I am not sure what that should be. A polyhedron with just rays should be valid. I know my code is quite buggy for unbounded polyhedra - all of my use cases are for Newton polytopes, so I have mostly tested things on bounded polytopes with exact coordinates. I am more than happy to referee patches on that. There is one patch I have that hasn't been merged - http://trac.sagemath.org/sage_trac/ticket/4676. It adds some new methods (Gale transform, edge truncation, perspective projection) - but doesn't address what you are talking about so its pretty orthogonal to what you talking about. Where is your patch? Is it on trac somewhere? - if so I can't find it. Cheers, Marshall Hampton On Dec 11, 1:18 pm, "Sébastien Barthélemy" <sebastien.barthel...@gmail.com> wrote: > Hello, > > I'd have some questions and suggestions about the functions in > polyhedra.py. I attached a patch with some very simple doc and error > handling improvements. Please tell me if it sound useful. (the patch > is against sage 3.2.1, if you prefer me to use a more current version > of polyhedra, please tell). > > I was also wondering in which circumstances is the Polyhedron.union() > method [1] useful ? For polytopes ? By the way this method name is > IMHO misleading, I would have expected it to return the union of the > polyhedra (which may not be a polyhedron). > > I also do not fully understand how cdd is called (and packaged). Is it > a separated process ? If so, is there a particular reason for not > wrapping cddlib instead ? > > Last question: do you consider a Polyhedron defined with rays and no > vertex as valid from a theoretical point of view ? For instance > p = Polyhedron(rays = [[0,1],[1,0]]) is invalid > p = Polyhedron(vertices=[[0,0]], rays = [[0,1],[1,0]]) is valid > p = Polyhedron(vertices=[[0,0]], rays = [[0,1],[0,-1],[1,0],[-1,0]]) is valid > p = Polyhedron(rays = [[0,1],[0,-1],[1,0],[-1,0]]) is ???? > > If the last is invalid too, some sanity checks can be easily added to > the __init__() method. > > [1] > def union(self, other): > """ > Returns a polyhedron whose vertices are the union of the vertices > of the two polyhedra. > .... > -- > Best regards > bastien Barthélemy --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---