Ticket #12791: trac_12791-edge-iterator.patch

File trac_12791-edge-iterator.patch, 2.6 KB (added by dcoudert, 9 years ago)
  • sage/graphs/generic_graph.py

    # HG changeset patch
    # User dcoudert <david.coudert@inria.fr>
    # Date 1334662567 -7200
    # Node ID 11748ec7db2a24f7b1731b0b820365f0afc27e0f
    # Parent  40bd85dddd8eb20d6411e1fab6aacbdca2512dea
    Trac #12791 -- use of edge iterator in graph products
    
    diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
    a b  
    1294712947        else:
    1294812948            raise TypeError('The graphs should be both directed or both undirected.')
    1294912949        G.add_vertices( [(u,v) for u in self for v in other] )
    12950         for u,w in self.edges(labels=None):
    12951             for v,x in other.edges(labels=None):
     12950        for u,w in self.edge_iterator(labels=None):
     12951            for v,x in other.edge_iterator(labels=None):
    1295212952                G.add_edge((u,v), (w,x))
    1295312953        return G
    1295412954
     
    1301113011        else:
    1301213012            raise TypeError('The graphs should be both directed or both undirected.')
    1301313013        G.add_vertices( [(u,v) for u in self for v in other] )
    13014         for u,w in self.edges(labels=None):
     13014        for u,w in self.edge_iterator(labels=None):
    1301513015            for v in other:
    1301613016                for x in other:
    1301713017                    G.add_edge((u,v), (w,x))
    1301813018        for u in self:
    13019             for v,x in other.edges(labels=None):
     13019            for v,x in other.edge_iterator(labels=None):
    1302013020                G.add_edge((u,v), (u,x))
    1302113021        return G
    1302213022
     
    1308013080            raise TypeError('The graphs should be both directed or both undirected.')
    1308113081
    1308213082        G.add_vertices( [(u,v) for u in self for v in other] )
    13083         for u,w in self.edges(labels=None):
     13083        for u,w in self.edge_iterator(labels=None):
    1308413084            for v in other:
    1308513085                G.add_edge((u,v), (w,v))
    13086             for v,x in other.edges(labels=None):
     13086            for v,x in other.edge_iterator(labels=None):
    1308713087                G.add_edge((u,v), (w,x))
    13088         for v,x in other.edges(labels=None):
     13088        for v,x in other.edge_iterator(labels=None):
    1308913089            for u in self:
    1309013090                G.add_edge((u,v), (u,x))
    1309113091        return G
     
    1314513145            raise TypeError('The graphs should be both directed or both undirected.')
    1314613146
    1314713147        G.add_vertices( [(u,v) for u in self for v in other] )
    13148         for u,w in self.edges(labels=None):
     13148        for u,w in self.edge_iterator(labels=None):
    1314913149            for v in other:
    1315013150                for x in other:
    1315113151                    G.add_edge((u,v), (w,x))
    13152         for v,x in other.edges(labels=None):
     13152        for v,x in other.edge_iterator(labels=None):
    1315313153            for u in self:
    1315413154                for w in self:
    1315513155                    G.add_edge((u,v), (w,x))