Ticket #13133: pbori_monomoial_index_crash.patch

File pbori_monomoial_index_crash.patch, 1.0 KB (added by Bouillaguet, 10 years ago)

patch fixing the problem (with doctest)

  • sage/rings/polynomial/pbori.pyx

    # HG changeset patch
    # User Charles Bouillaguet <charles.bouillaguet@gmail.com>
    # Date 1340060044 -7200
    # Node ID 3157ed4db429d7bf7df77e66242a3a62b1de3487
    # Parent  c239be1054e01526a1b0b62da6691061b9dd5587
    Trac #13133: workaround crach inside PolyBori (BooleanMonomial.index() on constants)
    
    diff --git a/sage/rings/polynomial/pbori.pyx b/sage/rings/polynomial/pbori.pyx
    a b  
    21662166            sage: m.index()
    21672167            0
    21682168
     2169            # Check that Ticket #13133 is resolved:
     2170            sage: B(1).lm().index()
     2171            Traceback (most recent call last):
     2172            ...
     2173            ValueError: no variables in constant monomial ; cannot take index()
     2174
    21692175        .. note::
    21702176
    21712177           This function is part of the upstream PolyBoRi interface.
    21722178        """
     2179        if self.is_one():
     2180            raise ValueError, "no variables in constant monomial ; cannot take index()"
    21732181        return self._pbmonom.firstIndex()
    21742182
    21752183    def deg(BooleanMonomial self):