Ticket #1217: 8015.patch

File 8015.patch, 2.4 KB (added by wjp, 15 years ago)
  • sage/libs/fplll/fplll.pyx

    # HG changeset patch
    # User Willem Jan Palenstijn <wpalenst@math.leidenuniv.nl>
    # Date 1200675149 -3600
    # Node ID 95788c7b9898c84e27966c69c4ce73b2e44b0fd3
    # Parent  6f44051873a8dafd1fb829edf30ff3da4b552e38
    check for fpLLL return value != 0 from proved LLL variants
    
    diff -r 6f44051873a8 -r 95788c7b9898 sage/libs/fplll/fplll.pyx
    a b cdef class FP_LLL: 
    183183        ret = w.LLL()
    184184        _sig_off
    185185        wrapper_delete(w)
    186         if ret < 0:
    187             raise RuntimeError, "fpLLL returned %d < 0"%ret
     186        if ret != 0:
     187            raise RuntimeError, "fpLLL returned %d != 0"%ret
    188188       
    189189
    190190    def proved(self, int precision=0, float eta=0.51, float delta=0.99, implementation=None):
    cdef class FP_LLL: 
    268268           _sig_off
    269269           proved_mpfr_delete(pmpfr)
    270270
    271         if ret < 0:
    272             raise RuntimeError, "fpLLL returned %d < 0"%ret
     271        if ret != 0:
     272            raise RuntimeError, "fpLLL returned %d != 0"%ret
    273273
    274274    def fast(self, int precision=0, float eta=0.51, float delta=0.99, implementation=None):
    275275        """
    cdef class FP_LLL: 
    327327        ret = pdouble.LLL()
    328328        _sig_off
    329329        fast_double_delete(pdouble)
    330 
    331         if ret < 0:
    332             raise RuntimeError, "fpLLL returned %d < 0"%ret
    333330
    334331    def fast_early_red(self, int precision=0, float eta=0.51, float delta=0.99, implementation=None):
    335332        """
    cdef class FP_LLL: 
    394391        ret = pdouble.LLL()
    395392        _sig_off
    396393        fast_early_red_double_delete(pdouble)
    397 
    398         if ret < 0:
    399             raise RuntimeError, "fpLLL returned %d < 0"%ret
    400394
    401395    def heuristic(self, int precision=0, float eta=0.51, float delta=0.99, implementation=None):
    402396        """
    cdef class FP_LLL: 
    472466            ret = pmpfr.LLL()
    473467            _sig_off
    474468            heuristic_mpfr_delete(pmpfr)
    475 
    476         if ret < 0:
    477             raise RuntimeError, "fpLLL returned %d < 0"%ret
    478 
    479469
    480470    def heuristic_early_red(self, int precision=0, float eta=0.51, float delta=0.99, implementation=None):
    481471        """
    cdef class FP_LLL: 
    558548           ret = pmpfr.LLL()
    559549           _sig_off
    560550           heuristic_early_red_mpfr_delete(pmpfr)
    561 
    562         if ret < 0:
    563             raise RuntimeError, "fpLLL returned %d < 0"%ret
    564551
    565552def gen_intrel(int d, int b):
    566553    """