Ticket #4364: trac_4364.patch

File trac_4364.patch, 4.5 KB (added by malb, 12 years ago)
  • sage/rings/polynomial/multi_polynomial_libsingular.pyx

    # HG changeset patch
    # User Martin Albrecht <malb@informatik.uni-bremen.de>
    # Date 1232673894 28800
    # Node ID b769159836d12b43d0f583b8a506df4bce058cbf
    # Parent  f8fb0bf3e547d65a0f90f5b27d543c8cf4ca9da0
    added checks for max prime when calling any factory function
    
    diff -r f8fb0bf3e547 -r b769159836d1 sage/rings/polynomial/multi_polynomial_libsingular.pyx
    a b  
    33983398        if right.is_zero():
    33993399            raise ZeroDivisionError
    34003400
     3401        if (<MPolynomial_libsingular>self)._parent._base.is_finite() and (<MPolynomial_libsingular>self)._parent._base.characteristic() > 1<<29:
     3402            raise NotImplementedError, "Division of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented."
     3403
    34013404        cdef int count = polyLengthBounded(_self._poly,15)
    34023405        if count >= 15:  # note that _right._poly must be of shorter length than self._poly for us to care about this call
    34033406            _sig_on
     
    37933796
    37943797        _ring = (<MPolynomialRing_libsingular>self._parent)._ring
    37953798
     3799        if self._parent._base.is_finite() and self._parent._base.characteristic() > 1<<29:
     3800            raise NotImplementedError, "GCD of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented."
     3801           
    37963802        if(_ring != currRing): rChangeCurrRing(_ring)
    37973803       
    37983804        if not PY_TYPE_CHECK(right, MPolynomial_libsingular):
     
    38533859        else:
    38543860            _g = <MPolynomial_libsingular>g
    38553861
     3862        if self._parent._base.is_finite() and self._parent._base.characteristic() > 1<<29:
     3863            raise NotImplementedError, "LCM of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented."
     3864
    38563865        cdef int count = polyLengthBounded(self._poly,20)+polyLengthBounded(_g._poly,20)
    38573866        if count >= 20:
    38583867            _sig_on
     
    38803889        """
    38813890        cdef ring *_ring = (<MPolynomialRing_libsingular>self._parent)._ring
    38823891        if(_ring != currRing): rChangeCurrRing(_ring)
     3892
     3893        if self._parent._base.is_finite() and self._parent._base.characteristic() > 1<<29:
     3894            raise NotImplementedError, "is_squarefree of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented."
     3895
    38833896        return bool(singclap_isSqrFree(self._poly))
    38843897
    38853898    def quo_rem(self, MPolynomial_libsingular right):
     
    39303943            py_rem = self - right*py_quo
    39313944            return py_quo, py_rem
    39323945
     3946        if self._parent._base.is_finite() and self._parent._base.characteristic() > 1<<29:
     3947            raise NotImplementedError, "Division of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented."
     3948
    39333949        cdef int count = polyLengthBounded(self._poly,15)
    39343950        if count >= 15:  # note that _right._poly must be of shorter length than self._poly for us to care about this call
    39353951            _sig_on
     
    42254241        if not variable.parent() is self.parent():
    42264242            raise TypeError, "second parameter needs to be an element of self.parent() or None"
    42274243
     4244
     4245        if self._parent._base.is_finite() and self._parent._base.characteristic() > 1<<29:
     4246            raise NotImplementedError, "Resultants of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented."
     4247
    42284248        cdef int count = polyLengthBounded(self._poly,20)+polyLengthBounded(other._poly,20)
    42294249        if count >= 20:
    42304250            _sig_on
  • sage/schemes/elliptic_curves/ell_generic.py

    diff -r f8fb0bf3e547 -r b769159836d1 sage/schemes/elliptic_curves/ell_generic.py
    a b  
    21362136            ...       f = E.multiplication_by_m(-n)
    21372137            ...       Q = -n*P
    21382138            ...       assert Q == E(eval(f,P))
     2139
     2140        The following test shows that #4364 is indeed fixed.
     2141            sage: p = next_prime(2^30-41)
     2142            sage: a = GF(p)(1)
     2143            sage: b = GF(p)(1)
     2144            sage: E = EllipticCurve([a, b])
     2145            sage: P = E.random_point()
     2146            sage: my_eval = lambda f,P: [fi(P[0],P[1]) for fi in f]
     2147            sage: f = E.multiplication_by_m(2)
     2148            sage: assert(E(eval(f,P)) == 2*P)
    21392149        """
    21402150        # Coerce the input m to be an integer
    21412151        m = rings.Integer(m)