#9972: Add toric lattice morphisms
-------------------------------------+--------------------------------------
Reporter: novoselt | Owner: mhampton
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.6
Component: geometry | Keywords:
Author: Andrey Novoseltsev | Upstream: N/A
Reviewer: Volker Braun | Merged:
Work_issues: switch to FanMorphism |
-------------------------------------+--------------------------------------
Comment(by vbraun):
Replying to [comment:19 novoselt]:
> In what sense ambient_ray_indices is dangerous? If ambient structures of
two cones are different, there is no point to look at these attributes at
all.
Thats of course true, but we got that wrong in the `ToricDivisor`
constructor (no check that the ambient was the same) and you didn't catch
it ;-)
I'm just trying to explore options that make it impossible to make this
mistake in the future. One more idea would be to force the user to pass
the ambient to `ambient_ray_indices()`,
{{{
sage: fan1 = ...
sage: fan2 = ...
sage: fan1.generating_cone(2).ambient_ray_indices(fan1) # fast
sage: fan1.generating_cone(2).ambient_ray_indices(fan2) # slower
}}}
This would also get rid of the need for `get_cone()`
The point of the `get_cone` method is to avoid this extra branch whenever
the user passes a cone that is not necessarilly within the same ambient:
{{{
if is_Cone(c):
if c.ambient()==fan
indices = c.ambient_ray_indices()
else:
try:
indices = tuple(sorted([ fan.rays().index(r) for r in
c.rays() ]))
except ValueError:
...
}}}
and instead just write
{{{
if is_Cone(c):
indices = fan.get_cone(c).ambient_ray_indices()
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9972#comment:20>
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.