Ticket #8148: trac_8148_dual_uses_poset_constructor.patch

File trac_8148_dual_uses_poset_constructor.patch, 975 bytes (added by brunellus, 17 months ago)
  • sage/combinat/posets/posets.py

    # HG changeset patch
    # User Lukas Lansky <lansky@kam.mff.cuni.cz>
    # Date 1323823264 0
    # Node ID 40549b5de09efc02d185bf82df4a0498f8af4163
    # Parent  9e29a3d84c48c399daaf3920bcb8b17273a0e876
    Trac 8148: FinitePoset.dual() now uses the Poset constructor -- it sanitize its input
    
    diff --git a/sage/combinat/posets/posets.py b/sage/combinat/posets/posets.py
    a b  
    14061406            sage: P = Poset([[1,2],[4],[3],[4],[]]) 
    14071407            sage: P.dual() 
    14081408            Finite poset containing 5 elements 
     1409 
     1410            sage: Poset({1: [], 3: [], 2: [1, 3]}).dual().relations() 
     1411            [[3, 3], [3, 2], [1, 1], [1, 2], [2, 2]] 
    14091412        """ 
    14101413        dual_graph = self._hasse_diagram.reverse() 
    14111414        dual_graph.relabel(self._elements) 
    1412         return FinitePoset(dual_graph) 
     1415        return Poset(dual_graph) 
    14131416 
    14141417    def graphviz_string(self,graph_string="graph",edge_string="--"): 
    14151418        r"""