#8987: Add support for rational polyhedral fans
----------------------------------+-----------------------------------------
Reporter: novoselt | Owner: mhampton
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.4.4
Component: geometry | Keywords:
Author: Andrey Novoseltsev | Upstream: N/A
Reviewer: Volker Braun | Merged:
Work_issues: |
----------------------------------+-----------------------------------------
Comment(by novoselt):
Hi Volker,
I have posted a new patch, it is still not a final version but I need
approvals/opinions for some changes once again... After trying to make
things work, I came to the conclusion that `Cone_of_fan` is a natural
class to introduce, but its added functionality should be minimal. On the
other hand, there is no need for `ConeFace` at all. So this class is gone
but `Cone_of_fan` is reincarnated.
It also feels natural to treat fans as cones in many respects and put some
extra functions into `IntegralRayCollection` class. In particular, I have
added `ambient` and `ambient_ray_indices` there. For fans they will always
return fan itself and `range(fan.nrays())`. Should they be hidden as
`_ambient` etc.?
From the coding point of view it would be also convenient to refer to
cones of fans as faces. On the other hand cones feel more natural.
Choices: 1) refer to cones as faces; 2) refer to cones as faces, but also
have aliases allowing to refer to them as cones; 3) refer to cones of fans
as cones only. What would you choose?
I have changed `_repr_` of cones so that they print "face of" if
`self.ambient() is not self`, i.e. if this cone represents a face of
another cone or fan. In the previous version that's how `ConeFace` was
printed, but `Cone_of_fan` was printed just as cone without mentioning the
fan. I have kept the old style so far, but maybe it would be more
consistent to print cones of fans as faces of these fans. This is somewhat
related to the previous question. Your opinion?
Here is a sample of current code output (with an example of how cone of
fan printing may look like):
{{{
sage: fan = FaceFan(lattice_polytope.octahedron(3))
sage: two_face = fan(2)[0]
sage: two_face
2-dimensional cone
sage: print super(type(two_face), two_face)._repr_()
2-dimensional face of Rational polyhedral fan in 3-dimensional lattice N
sage: two_face.facets()
(1-dimensional cone, 1-dimensional cone)
sage: two_face.facet_of()
(3-dimensional cone, 3-dimensional cone)
sage: two_face.adjacent()
(2-dimensional cone, 2-dimensional cone, 2-dimensional cone, 2-dimensional
cone)
sage: two_face.ambient()
Rational polyhedral fan in 3-dimensional lattice N
sage: two_face.ambient_ray_indices()
(0, 1)
sage: two_face.star_generators()
(3-dimensional cone, 3-dimensional cone)
sage: two_face.star_generator_indices()
(0, 4)
sage: fan.ambient()
Rational polyhedral fan in 3-dimensional lattice N
sage: fan.ambient_ray_indices()
(0, 1, 2, 3, 4, 5)
sage: fan.cone_lattice() is fan.face_lattice()
True
}}}
Not all new functions are yet documented, fan module has doctest failures
related to containment checks (which are not yet fully implemented), and
subsequent patches don't work with this version yet. Fully
functional/documented/working_with_other_patches version is guaranteed by
Friday evening.
Thank you!
Andrey
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8987#comment:30>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.