Ticket #11634: trac_11634_fix_sage_5_beta8.patch

File trac_11634_fix_sage_5_beta8.patch, 3.7 KB (added by vbraun, 9 years ago)

Initial patch

  • sage/combinat/root_system/associahedron.py

    # HG changeset patch
    # User Volker Braun <vbraun@stp.dias.ie>
    # Date 1332083129 14400
    # Node ID 223cfbcf4b299db33fcd7580621e2b48cf4b0b73
    # Parent  6ec226849973f0b9be09d010fc81c6c0f5020cc2
    Trac #11634: Fix the Associahedron class introduced in sage-5.0.alpha8
    
    diff --git a/sage/combinat/root_system/associahedron.py b/sage/combinat/root_system/associahedron.py
    a b  
    1919#
    2020#                  http://www.gnu.org/licenses/
    2121#*****************************************************************************
    22 from sage.geometry.polyhedra import Polyhedron
     22from sage.geometry.polyhedron.backend_ppl import Polyhedron_QQ_ppl
    2323from sage.combinat.root_system.cartan_type import CartanType
    2424from sage.modules.free_module_element import vector
    2525
    26 class Associahedron(Polyhedron):
     26class Associahedron(Polyhedron_QQ_ppl):
    2727    r"""
    2828    The generalized associahedron is a polytopal complex with vertices in one-to-one correspondence
    2929    with clusters in the cluster complex, and with edges between two vertices if and only if the associated two
     
    4343        sage: sorted(Asso.Hrepresentation(), key=repr)
    4444        [An inequality (-1, 0) x + 1 >= 0, An inequality (0, -1) x + 1 >= 0, An inequality (0, 1) x + 1 >= 0, An inequality (1, 0) x + 1 >= 0, An inequality (1, 1) x + 1 >= 0]
    4545        sage: Asso.Vrepresentation()
    46         [A vertex at (-1, 1), A vertex at (1, 1), A vertex at (1, -1), A vertex at (0, -1), A vertex at (-1, 0)]
     46        (A vertex at (1, -1), A vertex at (1, 1), A vertex at (-1, 1), A vertex at (-1, 0), A vertex at (0, -1))
    4747
    4848        sage: Associahedron(['B',2])
    4949        Generalized associahedron of type ['B', 2] with 6 vertices
     
    9494            c = rhocheck.coefficient(orbit[0].leading_support())
    9595            for beta in orbit:
    9696                inequalities.append( [c] + [ beta.coefficient(i) for i in I ] )
    97         Polyhedron.__init__(self,ieqs=inequalities)
     97        Polyhedron_QQ_ppl.__init__(self, len(I), None, [inequalities,[]])
    9898        # check that there are non non trivial facets
    9999        assert self.n_facets() == len(inequalities)
    100100
     
    127127        EXAMPLES::
    128128
    129129            sage: Asso = Associahedron(['A',2])
    130 
    131130            sage: Asso.vertices()
    132             [[-1, 1], [1, 1], [1, -1], [0, -1], [-1, 0]]
     131            [[1, -1], [1, 1], [-1, 1], [-1, 0], [0, -1]]
    133132
    134133            sage: Asso.vertices_in_root_space()
    135             [-alpha[1] + alpha[2], alpha[1] + alpha[2], alpha[1] - alpha[2], -alpha[2], -alpha[1]]
     134            (alpha[1] - alpha[2], alpha[1] + alpha[2], -alpha[1] + alpha[2], -alpha[1], -alpha[2])
    136135        """
    137136        root_space = self._cartan_type.root_system().root_space()
    138         return [ root_space.from_vector(vector(V)) for V in self.vertex_generator() ]
     137        return tuple( root_space.from_vector(vector(V)) for V in self.vertex_generator() )
  • sage/geometry/polyhedron/base.py

    diff --git a/sage/geometry/polyhedron/base.py b/sage/geometry/polyhedron/base.py
    a b  
    9191
    9292    - ``ambient_dim`` -- integer. The dimension of the ambient space.
    9393
    94     - ``Vrep`` -- a list `[vertices, rays, lines]``.
     94    - ``Vrep`` -- a list `[vertices, rays, lines]`` or ``None``. The
     95      V-representation of the polyhedron. If ``None``, the polyhedron
     96      is determined by the H-representation.
    9597       
    96     - ``Hrep`` -- a list `[ieqs, eqns]``.
     98    - ``Hrep`` -- a list `[ieqs, eqns]`` or ``None``. The
     99      H-representation of the polyhedron. If ``None``, the polyhedron
     100      is determined by the V-representation.
     101
     102    Only one of ``Vrep`` or ``Hrep`` can be different from ``None``.
    97103
    98104    TESTS::
    99105