# 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 sage5.0.alpha8
diff git a/sage/combinat/root_system/associahedron.py b/sage/combinat/root_system/associahedron.py
a

b


19  19  # 
20  20  # http://www.gnu.org/licenses/ 
21  21  #***************************************************************************** 
22   from sage.geometry.polyhedra import Polyhedron 
 22  from sage.geometry.polyhedron.backend_ppl import Polyhedron_QQ_ppl 
23  23  from sage.combinat.root_system.cartan_type import CartanType 
24  24  from sage.modules.free_module_element import vector 
25  25  
26   class Associahedron(Polyhedron): 
 26  class Associahedron(Polyhedron_QQ_ppl): 
27  27  r""" 
28  28  The generalized associahedron is a polytopal complex with vertices in onetoone correspondence 
29  29  with clusters in the cluster complex, and with edges between two vertices if and only if the associated two 
… 
… 

43  43  sage: sorted(Asso.Hrepresentation(), key=repr) 
44  44  [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] 
45  45  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)) 
47  47  
48  48  sage: Associahedron(['B',2]) 
49  49  Generalized associahedron of type ['B', 2] with 6 vertices 
… 
… 

94  94  c = rhocheck.coefficient(orbit[0].leading_support()) 
95  95  for beta in orbit: 
96  96  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,[]]) 
98  98  # check that there are non non trivial facets 
99  99  assert self.n_facets() == len(inequalities) 
100  100  
… 
… 

127  127  EXAMPLES:: 
128  128  
129  129  sage: Asso = Associahedron(['A',2]) 
130   
131  130  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]] 
133  132  
134  133  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]) 
136  135  """ 
137  136  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() ) 
diff git a/sage/geometry/polyhedron/base.py b/sage/geometry/polyhedron/base.py
a

b


91  91  
92  92   ``ambient_dim``  integer. The dimension of the ambient space. 
93  93  
94    ``Vrep``  a list `[vertices, rays, lines]``. 
 94   ``Vrep``  a list `[vertices, rays, lines]`` or ``None``. The 
 95  Vrepresentation of the polyhedron. If ``None``, the polyhedron 
 96  is determined by the Hrepresentation. 
95  97  
96    ``Hrep``  a list `[ieqs, eqns]``. 
 98   ``Hrep``  a list `[ieqs, eqns]`` or ``None``. The 
 99  Hrepresentation of the polyhedron. If ``None``, the polyhedron 
 100  is determined by the Vrepresentation. 
 101  
 102  Only one of ``Vrep`` or ``Hrep`` can be different from ``None``. 
97  103  
98  104  TESTS:: 
99  105  