Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-08-03 Thread Robert Miller
On Sun, Jul 25, 2010 at 6:50 PM, Robert Miller r...@rlmiller.org wrote: On Sun, Jul 25, 2010 at 8:10 PM, Carl Witty carl.wi...@gmail.com wrote: You seem to want to make the vertex dictionary respect the equivalence relation defined by Sage equality.  If so, you're going to be in trouble, since

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-08-03 Thread William Stein
On Tue, Aug 3, 2010 at 10:33 AM, Robert Miller r...@rlmiller.org wrote: On Sun, Jul 25, 2010 at 6:50 PM, Robert Miller r...@rlmiller.org wrote: On Sun, Jul 25, 2010 at 8:10 PM, Carl Witty carl.wi...@gmail.com wrote: You seem to want to make the vertex dictionary respect the equivalence

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-08-03 Thread Robert Miller
On Tue, Aug 3, 2010 at 2:29 PM, William Stein wst...@gmail.com wrote: +1    It makes no sense for to mean subset because should be a total order. If you want to check for subsets we should use a method like in python: sage: a = set([1,2,3]) sage: b = set([2,3,4]) sage: a.issubset(b)

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-27 Thread Robert Miller
See trac #9610 for a patch which fixes this issue. -- Robert L. Miller http://www.rlmiller.org/ -- 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

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-25 Thread Robert Miller
Nathann, Using the following instead fixes the problem: g.add_edges( (Mod(i,n),Mod(i+j,n)) for i in range(n) for j in range(1,k+1) ) This is more consistent, since we are actually using the same vertex objects. However, that should just work, right? Why doesn't it? This is coming from the code

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-25 Thread Nathann Cohen
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

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-25 Thread Robert Miller
Nathann, 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 ! :-) I think the information was there, but I was not very clear.

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-25 Thread Nathann Cohen
Nononon, I understood why there are two copies of what appears to be a zero, and I think it's fine like that ! My question was about the number of vertices as remembered by the graph : in one case, it says 21, but g.vertices() is only long of 20 elements. Why aren't there two zeroes in

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-25 Thread Robert Miller
On Sun, Jul 25, 2010 at 2:01 PM, Nathann Cohen nathann.co...@gmail.com wrote: Nononon, I understood why there are two copies of what appears to be a zero, and I think it's fine like that ! This is definitely *not* fine, since we have sage: int(0) == Mod(0, 20) True As input, the

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-25 Thread Carl Witty
On Sun, Jul 25, 2010 at 10:27 AM, Robert Miller r...@rlmiller.org wrote: On Sun, Jul 25, 2010 at 2:01 PM, Nathann Cohen nathann.co...@gmail.com wrote: Nononon, I understood why there are two copies of what appears to be a zero, and I think it's fine like that ! This is definitely *not*

Re: [sage-devel] Re: Scary things in Sage's Digraphs

2010-07-25 Thread Robert Miller
On Sun, Jul 25, 2010 at 8:10 PM, Carl Witty carl.wi...@gmail.com wrote: You seem to want to make the vertex dictionary respect the equivalence relation defined by Sage equality.  If so, you're going to be in trouble, since Sage equality actually is not an equivalence relation: Is it really too