#11181: edge labels should be unique
-------------------------------+--------------------------------------------
Reporter: rlm | Owner: jason, ncohen, rlm
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7
Component: graph theory | Keywords:
Author: Robert Miller | Upstream: N/A
Reviewer: Christian Stump | Merged:
Work_issues: |
-------------------------------+--------------------------------------------
Comment(by ncohen):
Hello Christian !
As there is still no sign from the patchbot (and yeah, I like to read
what's happening in the graph backends) I began to review this patch....
I've got two questions though :
- The first one is about line 1597... It begins with an "else" after a
"for" loop, and I really don't understand how it compiles or what it means
`O_o`
- I edited several areas of the code to "cache" the label of a vertex
which was called several times... I can not do that for the (tricky)
iterators appearing just afterwards
{{{
return iter([tuple(sorted(
(vertex_label(v_int, self.vertex_ints, self.vertex_labels,
self._cg),
vertex_label(u_int, self.vertex_ints, self.vertex_labels,
self._cg)
)))
for v_int in vertices
for u_int in self._cg.out_neighbors(v_int)
if u_int >= v_int or u_int not in vertices
for l_int in self._cg.all_arcs(v_int, u_int)])
}}}
do you think it's woth doing ? In which case I would copy the code
from the lines above thise one, and remove the label-related tests....
`:-)`
- There is a ``self.edge_labels.pop(ll_int)`` in ``set_edge_label``
but not in `del_arc_unsafe`... Is there any reason ? `:-)`
Have fuuuuuuuuuun !
Nathann
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11181#comment:7>
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.