To the graph package maintainers,

Using 
   G.relabel( [ i+1 for i in range(G.order()) ], inplace=True )
and repeat the same command once more causes the error below.

But using 
   G.relabel(lambda i: i+1, inplace=True)
twice does not produce the error.

(at least this it's not intuitive for me)

Thanks,

Pedro
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.1.1, Release Date: 2014-02-04 │
└────────────────────────────────────────────────────────────────────┘

sage: G = graphs.PetersenGraph()
sage: G.relabel( [ i+1 for i in range(G.order()) ], inplace=True )
sage: G.vertices()
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
sage: G.relabel( [ i+1 for i in range(G.order()) ], inplace=True )
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-4-bf2b8e5b2a10> in <module>()
----> 1 G.relabel( [ i+Integer(1) for i in range(G.order()) ], inplace=True 
)


/home/jpedro/sage-6.1.1/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc
 
in relabel(self, perm, inplace, return_map, check_input, 
complete_partial_function)
16716 if check_input:
16717 if len(set(perm.values())) < len(perm):
> 16718 raise NotImplementedError("Non injective relabeling")
16719 
16720 for v in perm.iterkeys():

NotImplementedError: Non injective relabeling

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to