Ticket #13664: trac_13664.patch

File trac_13664.patch, 1.6 KB (added by ncohen, 7 years ago)
  • sage/graphs/base/c_graph.pyx

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1351413394 -3600
    # Node ID 75f0e0a1b44b1536b978a8087649b115f092361b
    # Parent  4bf4480e8fd30e0cede481f174fa8630cf558133
    Another bug in Graph.add_edge
    
    diff --git a/sage/graphs/base/c_graph.pyx b/sage/graphs/base/c_graph.pyx
    a b  
    13121312
    13131313        TESTS:
    13141314
    1315         Ensure that ticket #8395 is fixed. ::
     1315        Ensure that ticket :trac:`8395` is fixed. ::
    13161316
    13171317            sage: def my_add_edges(G, m, n):
    13181318            ...       for i in range(m):
     
    14071407            sage: G.degree(1)
    14081408            3
    14091409
     1410        Ensure that :trac:`13664` is fixed ::
     1411
     1412            sage: W = WeylGroup(["A",1])
     1413            sage: G = W.cayley_graph()
     1414            sage: Graph(G).degree()
     1415            [1, 1]
     1416            sage: h = Graph()
     1417            sage: h.add_edge(1,2,"a")
     1418            sage: h.add_edge(1,2,"a")
     1419            sage: h.degree()
     1420            [1, 1]
    14101421        """
    14111422        cdef v_int = get_vertex(v,
    14121423                                self.vertex_ints,
  • sage/graphs/base/sparse_graph.pyx

    diff --git a/sage/graphs/base/sparse_graph.pyx b/sage/graphs/base/sparse_graph.pyx
    a b  
    16221622                return
    16231623            else:
    16241624                self._cg.del_all_arcs(u_int, v_int)
     1625                if not directed:
     1626                    self._cg.del_all_arcs(v_int, u_int)
    16251627        if directed:
    16261628            self._cg.add_arc_label(u_int, v_int, l_int)
    16271629            self._cg_rev.add_arc_label(v_int, u_int, l_int)