예제 #1
0
파일: graph.py 프로젝트: oktomus/rez3
 def __eq__(self, other):
     """
     Return whether this graph is equal to another one.
     
     @type other: graph, digraph
     @param other: Other graph or digraph
     
     @rtype: boolean
     @return: Whether this graph and the other are equal.
     """
     return common.__eq__(self, other) and labeling.__eq__(self, other)
예제 #2
0
파일: graph.py 프로젝트: LumaPictures/rez
 def __eq__(self, other):
     """
     Return whether this graph is equal to another one.
     
     @type other: graph, digraph
     @param other: Other graph or digraph
     
     @rtype: boolean
     @return: Whether this graph and the other are equal.
     """
     return common.__eq__(self, other) and labeling.__eq__(self, other)
예제 #3
0
 def __eq__(self, other):
     """
     Return whether this hypergraph is equal to another one.
     
     @type other: hypergraph
     @param other: Other hypergraph
     
     @rtype: boolean
     @return: Whether this hypergraph and the other are equal.
     """
     def links_eq():
         for edge in self.edges():
             for link in self.links(edge):
                 if (link not in other.links(edge)): return False
         for edge in other.edges():
             for link in other.links(edge):
                 if (link not in self.links(edge)): return False
         return True
     
     return common.__eq__(self, other) and links_eq() and labeling.__eq__(self, other)
예제 #4
0
    def __eq__(self, other):
        """
        Return whether this hypergraph is equal to another one.
        
        @type other: hypergraph
        @param other: Other hypergraph
        
        @rtype: boolean
        @return: Whether this hypergraph and the other are equal.
        """
        def links_eq():
            for edge in self.edges():
                for link in self.links(edge):
                    if (link not in other.links(edge)): return False
            for edge in other.edges():
                for link in other.links(edge):
                    if (link not in self.links(edge)): return False
            return True

        return common.__eq__(self, other) and links_eq() and labeling.__eq__(
            self, other)