# HG changeset patch
# User Andrey Novoseltsev <novoselt@gmail.com>
# Date 1364881023 21600
# Node ID 8d16c45427d45f4b3c19c3a5ee618f062818c00c
# Parent 144c26a1c5f127cf5b3b79b405973448f2b39d0f
Reviewers tweaks to FaceFan and NormalFan.
diff git a/sage/geometry/fan.py b/sage/geometry/fan.py
a

b


594  594  
595  595  def FaceFan(polytope, lattice=None): 
596  596  r""" 
597   Construct the face fan of the given lattice ``polytope``. 
 597  Construct the face fan of the given rational ``polytope``. 
598  598  
599  599  INPUT: 
600  600  
… 
… 

692  692  cones = [ [ v.index() for v in facet.incident() ] 
693  693  for facet in polytope.inequalities() ] 
694  694  rays = map(vector, polytope.vertices()) 
695   fan = Fan(cones, rays, lattice=lattice, check=False) 
696   fan._is_complete = polytope.dim() == polytope.ambient_dim() 
 695  fan = Fan(cones, rays, lattice=lattice, check=False, 
 696  is_complete=(polytope.dim() == polytope.ambient_dim())) 
697  697  return fan 
698  698  
699  699  
700  700  def NormalFan(polytope, lattice=None): 
701  701  r""" 
702   Construct the normal fan of the given lattice ``polytope``. 
 702  Construct the normal fan of the given rational ``polytope``. 
703  703  
704  704  INPUT: 
705  705  
706    ``polytope``  a :func:`polytope 
 706   ``polytope``  a fulldimensional :func:`polytope 
707  707  <sage.geometry.polyhedron.constructor.Polyhedron>` over `\QQ` 
708  708  or:class:`lattice polytope 
709   <sage.geometry.lattice_polytope.LatticePolytopeClass>`. A 
710   fulldimensional polytope containing the origin as an interior 
711   point. 
 709  <sage.geometry.lattice_polytope.LatticePolytopeClass>`. 
712  710  
713  711   ``lattice``  :class:`ToricLattice 
714  712  <sage.geometry.toric_lattice.ToricLatticeFactory>`, `\ZZ^n`, or any 
… 
… 

769  767  cones = (vertex.facets() for vertex in polytope.faces(dim=0)) 
770  768  else: 
771  769  if not polytope.is_compact(): 
772   raise ValueError('the normal fan is only defined for polytopes (compact polyhedra).') 
 770  raise NotImplementedError('the normal fan is only supported for polytopes (compact polyhedra).') 
773  771  cones = [ [ ieq.index() for ieq in vertex.incident() ] 
774  772  for vertex in polytope.vertices() ] 
775  773  rays =[ ieq.A() for ieq in polytope.inequalities() ] 
776   fan = Fan(cones, rays, lattice=lattice, check=False) 
777   fan._is_complete = polytope.dim() == polytope.ambient_dim() 
 774  fan = Fan(cones, rays, lattice=lattice, check=False, 
 775  is_complete=(polytope.dim() == polytope.ambient_dim())) 
778  776  return fan 
779  777  
780  778  