Ticket #12173: n_factor.patch

File n_factor.patch, 1.8 KB (added by Jean-Pierre Flori, 10 years ago)

Update n_factor structure and initialize it before use

  • sage/libs/flint/ulong_extras.pxd

    # HG changeset patch
    # User Jean-Pierre Flori <jean-pierre.flor@ssi.gouv.fr>
    # Date 1338990205 -7200
    # Node ID 60a983383751025d95fb91cd4cf63f930a2a6b3f
    # Parent  14d55477e4d33778fe80bb5f4447205dfe122700
    #12173: Update n_factor structure and initialize it before use
    
    diff --git a/sage/libs/flint/ulong_extras.pxd b/sage/libs/flint/ulong_extras.pxd
    a b  
    88
    99    ctypedef struct n_factor_t:
    1010        int num
     11        unsigned long exp[15]
    1112        unsigned long p[15]
    12         unsigned long exp[15]
    1313
    1414    cdef int n_jacobi(long x, unsigned long y)
    1515
     
    1818    cdef unsigned long n_gcd(long x, long y)
    1919
    2020    cdef void n_factor(n_factor_t * factors, unsigned long n, int proved)
     21    cdef void n_factor_init(n_factor_t * factors)
  • sage/rings/integer.pyx

    diff --git a/sage/rings/integer.pyx b/sage/rings/integer.pyx
    a b  
    33693369            if proof is None:
    33703370                from sage.structure.proof.proof import get_flag
    33713371                proof = get_flag(proof, "arithmetic")
     3372            n_factor_init(&f)
    33723373            n_factor(&f, mpz_get_ui(n.value), proof)
    33733374            F = [(Integer(f.p[i]), int(f.exp[i])) for i from 0 <= i < f.num]
    33743375            F.sort()
  • sage/schemes/elliptic_curves/descent_two_isogeny.pyx

    diff --git a/sage/schemes/elliptic_curves/descent_two_isogeny.pyx b/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
    a b  
    12271227        p_list_mpz = <mpz_t *> sage_malloc(20 * sizeof(mpz_t))
    12281228        mpz_init_set_ui(p_list_mpz[0], ui2)
    12291229        p_list_len = 1
     1230        n_factor_init(&fact)
    12301231        n_factor(&fact, mpz_get_ui(d_mpz), proof)
    12311232        for i from 0 <= i < fact.num:
    12321233            p = fact.p[i]