Ticket #14394: trac_14394_reviewer.patch

File trac_14394_reviewer.patch, 2.5 KB (added by novoselt, 6 years ago)
  • sage/geometry/fan.py

    # 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  
    594594
    595595def FaceFan(polytope, lattice=None):
    596596    r"""
    597     Construct the face fan of the given lattice ``polytope``.
     597    Construct the face fan of the given rational ``polytope``.
    598598
    599599    INPUT:
    600600
     
    692692        cones = [ [ v.index() for v in facet.incident() ]
    693693                  for facet in polytope.inequalities() ]
    694694        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()))
    697697    return fan
    698698
    699699
    700700def NormalFan(polytope, lattice=None):
    701701    r"""
    702     Construct the normal fan of the given lattice ``polytope``.
     702    Construct the normal fan of the given rational ``polytope``.
    703703
    704704    INPUT:
    705705
    706     - ``polytope`` -- a :func:`polytope
     706    - ``polytope`` -- a full-dimensional :func:`polytope
    707707      <sage.geometry.polyhedron.constructor.Polyhedron>` over `\QQ`
    708708      or:class:`lattice polytope
    709       <sage.geometry.lattice_polytope.LatticePolytopeClass>`. A
    710       full-dimensional polytope containing the origin as an interior
    711       point.
     709      <sage.geometry.lattice_polytope.LatticePolytopeClass>`.
    712710
    713711    - ``lattice`` -- :class:`ToricLattice
    714712      <sage.geometry.toric_lattice.ToricLatticeFactory>`, `\ZZ^n`, or any
     
    769767        cones = (vertex.facets() for vertex in polytope.faces(dim=0))
    770768    else:
    771769        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).')
    773771        cones = [ [ ieq.index() for ieq in vertex.incident() ]
    774772                  for vertex in polytope.vertices() ]
    775773        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()))
    778776    return fan
    779777
    780778