Ticket #12173: trac_12173-extra.patch

File trac_12173-extra.patch, 4.5 KB (added by jdemeyer, 9 years ago)
  • sage/ext/gen_interpreters.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1366204722 -7200
    # Node ID d9713c21438e797f4bc33a6ca1d9d1e2031e6bc8
    # Parent  06a3f2c98282375d37b3816bcd7d65d2afe14af6
    Additional changes
    
    diff --git a/sage/ext/gen_interpreters.py b/sage/ext/gen_interpreters.py
    a b  
    193193    that we have to incref/decref at appropriate places.
    194194
    195195    Third is "auto-reference" types.  This is how
    196     GMP/MPIR/MPFR/MPFI/flint types work.  For these types, functions
     196    GMP/MPIR/MPFR/MPFI/FLINT types work.  For these types, functions
    197197    expect arguments to be passed by reference, and the C assignment
    198198    operator does not do what we want.  In addition, they take
    199199    advantage of a quirk in C (where arrays are automatically
     
    793793class StorageTypeAutoReference(StorageType):
    794794    r"""
    795795    StorageTypeAutoReference is a subtype of StorageType that deals with
    796     types in the style of GMP/MPIR/MPFR/MPFI/flint, where copies are
     796    types in the style of GMP/MPIR/MPFR/MPFI/FLINT, where copies are
    797797    not cheap, functions expect arguments to be passed by reference,
    798798    and the API takes advantage of the C quirk where arrays are
    799799    automatically converted to pointers to automatically pass
  • sage/libs/flint/fmpz_poly.pxi

    diff --git a/sage/libs/flint/fmpz_poly.pxi b/sage/libs/flint/fmpz_poly.pxi
    a b  
    88    ctypedef void* fmpz_poly_t
    99   
    1010    void fmpz_poly_init(fmpz_poly_t poly)
    11     void fmpz_poly_init2(fmpz_poly_t poly, unsigned long alloc, \
    12             unsigned long limbs)
     11    void fmpz_poly_init2(fmpz_poly_t poly, unsigned long alloc)
    1312    void fmpz_poly_realloc(fmpz_poly_t poly, unsigned long alloc)
    1413   
    1514    void fmpz_poly_fit_length(fmpz_poly_t poly, unsigned long alloc)
    16     void fmpz_poly_resize_limbs(fmpz_poly_t poly, unsigned long limbs)
    17     void fmpz_poly_fit_limbs(fmpz_poly_t poly, unsigned long limbs)
    18     unsigned long fmpz_poly_limbs(fmpz_poly_t poly)
    1915
    2016    void fmpz_poly_clear(fmpz_poly_t poly)
    2117   
     
    5854            unsigned long x)
    5955    void fmpz_poly_scalar_mul_si(fmpz_poly_t output, fmpz_poly_t input, long x)
    6056
    61     void fmpz_poly_scalar_mul_mpz(fmpz_poly_t output, fmpz_poly_t poly,
    62             mpz_t x)
    63     void fmpz_poly_scalar_mul_fmpz(fmpz_poly_t output, fmpz_poly_t poly, \
     57    void fmpz_poly_scalar_mul_fmpz(fmpz_poly_t output, fmpz_poly_t poly,
    6458            fmpz_t x)
     59    void fmpz_poly_scalar_mul_mpz(fmpz_poly_t output, fmpz_poly_t poly, mpz_t x)
    6560
    6661    void fmpz_poly_scalar_divexact_ui(fmpz_poly_t output, fmpz_poly_t poly, \
    6762            unsigned long x)
    6863    void fmpz_poly_scalar_divexact_si(fmpz_poly_t output, fmpz_poly_t poly, \
    6964            long x)
    70     void fmpz_poly_scalar_divexact_mpz(fmpz_poly_t output, fmpz_poly_t poly, \
    71             mpz_t x)
    7265    void fmpz_poly_scalar_divexact_fmpz(fmpz_poly_t output, fmpz_poly_t poly, \
    7366            fmpz_t x)
    7467   
     68    void fmpz_poly_scalar_divexact_mpz( fmpz_poly_t output, fmpz_poly_t poly, mpz_t x)
     69
     70    void fmpz_poly_scalar_fdiv_ui(fmpz_poly_t output, fmpz_poly_t poly, unsigned long x)
    7571    void fmpz_poly_scalar_fdiv_mpz(fmpz_poly_t output, fmpz_poly_t poly, mpz_t x)
    76     void fmpz_poly_scalar_fdiv_ui(fmpz_poly_t output, fmpz_poly_t poly, unsigned long x)
    7772
    7873    void fmpz_poly_div(fmpz_poly_t Q, fmpz_poly_t A, fmpz_poly_t B)
    7974    void fmpz_poly_divrem(fmpz_poly_t Q, fmpz_poly_t R, fmpz_poly_t A, \
     
    119114    void fmpz_poly_derivative(fmpz_poly_t der, fmpz_poly_t poly)
    120115    void fmpz_poly_evaluate_fmpz(fmpz_t output, fmpz_poly_t poly, fmpz_t val)
    121116    void fmpz_poly_compose(fmpz_poly_t output, fmpz_poly_t f, fmpz_poly_t g)
    122     void fmpz_poly_scalar_fdiv_ui(fmpz_poly_t output, fmpz_poly_t poly, unsigned long x)
     117    void fmpz_poly_scalar_div_ui(fmpz_poly_t output, fmpz_poly_t poly, unsigned long x)
    123118
    124119    unsigned long fmpz_poly_max_limbs(fmpz_poly_t poly)
  • sage/libs/flint/ntl_interface.pxd

    diff --git a/sage/libs/flint/ntl_interface.pxd b/sage/libs/flint/ntl_interface.pxd
    a b  
    66from sage.libs.ntl.ntl_ZZX_decl cimport ZZX_c
    77
    88cdef extern from "flint/NTL-interface.h":
    9     unsigned long ZZ_limbs(ZZ_c z)
    109
    1110    void fmpz_poly_get_ZZX(ZZX_c output, fmpz_poly_t poly)
    1211    void fmpz_poly_set_ZZX(fmpz_poly_t output, ZZX_c poly)
    1312
    14     void fmpz_get_mpz(mpz_t res, fmpz_t f)
     13    void fmpz_get_ZZ(ZZ_c output, fmpz_t f)
    1514    void fmpz_set_ZZ(fmpz_t output, ZZ_c z)
    16    
     15