Hello !!! > This is coming from the code around line 1000 of c_graph, which goes > from vertex labels to ints and back. The IntegerMod case was not in > mind when this code was written. The real problem is that when the > Python int 0 gets passed to get_vertex, it does not add the entry to > the translation dictionary. The idea being that it would be more > efficient for the majority of graphs, which only use [0, 1, ..., n-1] > as labels, going through dictionaries a bunch would be a waste. > However, when the IntegerMod 0 gets passed in, it does not find an > equal object in the dict, and since it is not one of {int, long, > Integer}, it assigns a new int in the translation dictionary for it. > > So that's what's happening, what do people think about what we should > do about this? Technically the input is a bit fuzzy, but this raises > the question of how many other objects are there which will pass the > test int(0) == IntegerMod(0, 20)... I am very reluctant to support > adding all the labels to the dicts, unless someone can show that there > really isn't any overhead there...
Hmmmm.. I would not want to see any loss of performance because of such matters either, I think we quite agree on this point.. I understood from your explanation why Mod(1,n) is considered different from 0, and it is to me the correct behaviour... But what about this g has 21 vertices len(g.vertices) == 20 ? Sorry if you answered already ! :-) Nathann -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org