#10360: Polyhedron.vertex_adjacencies() gives different answers because of a
side
effect
------------------------+---------------------------------------------------
Reporter: jplabbe | Owner: mhampton
Type: defect | Status: new
Priority: major | Milestone: sage-4.6.1
Component: geometry | Keywords: vertex adjacencies, polyhedron
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
The vertex_adjacencies function returns a list giving the adjacency of
every vertex of a polyhedron.
If you assign this list and modify it, it will also modify the output of
any new call of vertex_adjacencies, which shouldn't be the case.
This can be reproduced in the following manner:
{{{
sage:
P=Polyhedron([[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]);P.vertex_adjacencies()
[[0, [1, 2]], [1, [0, 3]], [2, [0, 4]], [3, [1, 5]], [4, [2, 5]], [5, [3,
4]]]
sage: V_adj=P.vertex_adjacencies();V_adj
[[0, [1, 2]], [1, [0, 3]], [2, [0, 4]], [3, [1, 5]], [4, [2, 5]], [5, [3,
4]]]
sage: V_adj[0][1].remove(1);V_adj
[[0, [2]], [1, [0, 3]], [2, [0, 4]], [3, [1, 5]], [4, [2, 5]], [5, [3,
4]]]
sage: P.vertex_adjacencies()
[[0, [2]], [1, [0, 3]], [2, [0, 4]], [3, [1, 5]], [4, [2, 5]], [5, [3,
4]]]
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10360>
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.