Ticket #9810: trac_9810_cone_faces_invalidates_facets.patch

File trac_9810_cone_faces_invalidates_facets.patch, 1.6 KB (added by novoselt, 9 years ago)
  • sage/geometry/cone.py

    # HG changeset patch
    # User Andrey Novoseltsev <novoselt@gmail.com>
    # Date 1282858213 21600
    # Node ID fc8a3569c31f53fff533e1aace9980b103fbc3b3
    # Parent  dce01f81c6fed5a4d394d137f224df07d4c782a7
    Trac 9810: Cone faces methods incorrectly sets facets for future use.
    
    diff -r dce01f81c6fe -r fc8a3569c31f sage/geometry/cone.py
    a b  
    16061606              2-d face of 3-d cone in 4-d lattice N,
    16071607              2-d face of 3-d cone in 4-d lattice N),
    16081608             (3-d cone in 4-d lattice N,))
     1609             
     1610        We also ensure that a call to this function does not break
     1611        :meth:`facets` method (see Trac #9780)::
     1612       
     1613            sage: cone = toric_varieties.dP8().fan().generating_cone(0)
     1614            sage: cone
     1615            2-d cone of Rational polyhedral fan in 2-d lattice N
     1616            sage: [f.rays() for f in cone.facets()]
     1617            [(N(1, 1),), (N(0, 1),)]
     1618            sage: len(cone.faces())
     1619            3
     1620            sage: [f.rays() for f in cone.facets()]
     1621            [(N(1, 1),), (N(0, 1),)]       
    16091622        """
    16101623        if dim is not None and codim is not None:
    16111624            raise ValueError(
     
    16191632                                for level in self.face_lattice().level_sets())
    16201633            # To avoid duplication and ensure order consistency
    16211634            if self.dim() > 0:
    1622                 self._facets = self._faces[-1]
     1635                self._facets = self._faces[-2]
    16231636        if dim is None:
    16241637            return self._faces
    16251638        else: