Ticket #4000: trac4000_fmpq_poly_pxd.patch

File trac4000_fmpq_poly_pxd.patch, 4.3 KB (added by spancratz, 8 years ago)

fmpq_poly.pxd

  • new file sage/libs/flint/fmpq_poly.pxd

    # HG changeset patch
    # User Sebastian Pancratz <sage@pancratz.org>
    # Date 1279830954 25200
    # Node ID f0fa8ae939161a5603e4d792eaf8c24494309b7d
    # Parent  040e85ea22a4fa6865f0c9d8ba58332932eecc93
    Trac 4000.  Adds fmpq_poly.pxd to provide an interface to the C code
    
    diff -r 040e85ea22a4 -r f0fa8ae93916 sage/libs/flint/fmpq_poly.pxd
    - +  
     1###############################################################################
     2#          Copyright (C) 2010 Sebastian Pancratz <sfp@pancratz.org>           #
     3#                                                                             #
     4#     Distributed under the terms of the GNU General Public License (GPL)     #
     5#                                                                             #
     6#                        http://www.gnu.org/licenses/                         #
     7###############################################################################
     8
     9#include "fmpz_poly.pxi"
     10#include "fmpz.pxi"
     11
     12cdef extern from "gmp.h":
     13    ctypedef void * mpz_t
     14    ctypedef void * mpq_t
     15
     16cdef extern from "fmpq_poly.h":
     17    ctypedef void * fmpz_t
     18    ctypedef void * fmpz_poly_p
     19    struct fmpq_poly:
     20        fmpz_poly_p num
     21        fmpz_t den
     22       
     23    ctypedef fmpq_poly fmpq_poly_struct
     24    ctypedef fmpq_poly_struct fmpq_poly_t[1]
     25
     26    void * fmpq_poly_canonicalize(fmpq_poly_t, fmpz_t)
     27
     28    void * fmpq_poly_numref(fmpq_poly_t)
     29    void * fmpq_poly_denref(fmpq_poly_t)
     30
     31    void fmpq_poly_init(fmpq_poly_t)
     32    void fmpq_poly_clear(fmpq_poly_t)
     33
     34    void fmpq_poly_set(fmpq_poly_t, fmpq_poly_t)
     35    void fmpq_poly_set_si(fmpq_poly_t, long)
     36    void fmpq_poly_set_mpz(fmpq_poly_t, mpz_t)
     37    void fmpq_poly_set_mpq(fmpq_poly_t, mpq_t)
     38    void fmpq_poly_swap(fmpq_poly_t, fmpq_poly_t)
     39    void fmpq_poly_zero(fmpq_poly_t)
     40    void fmpq_poly_neg(fmpq_poly_t, fmpq_poly_t)
     41
     42    void fmpq_poly_get_coeff_mpq(mpq_t, fmpq_poly_t, unsigned long)
     43    void fmpq_poly_set_coeff_si(fmpq_poly_t, unsigned long, long)
     44    void fmpq_poly_set_coeff_mpq(fmpq_poly_t, unsigned long, mpq_t)
     45    void fmpq_poly_set_coeff_mpz(fmpq_poly_t, unsigned long, mpz_t)
     46   
     47    int fmpq_poly_equal(fmpq_poly_t, fmpq_poly_t)
     48    int fmpq_poly_cmp(fmpq_poly_t, fmpq_poly_t)
     49    int fmpq_poly_is_zero(fmpq_poly_t)
     50
     51    long fmpq_poly_degree(fmpq_poly_t)
     52    unsigned long fmpq_poly_length(fmpq_poly_t)
     53   
     54    void fmpq_poly_add(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     55    void fmpq_poly_sub(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     56   
     57    void fmpq_poly_scalar_mul_mpq(fmpq_poly_t, fmpq_poly_t, mpq_t)
     58    void fmpq_poly_scalar_div_mpq(fmpq_poly_t, fmpq_poly_t, mpq_t)
     59   
     60    void fmpq_poly_mul(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     61
     62    void fmpq_poly_divrem(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     63    void fmpq_poly_floordiv(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     64    void fmpq_poly_mod(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     65
     66    void fmpq_poly_power(fmpq_poly_t, fmpq_poly_t, unsigned long)
     67
     68    void fmpq_poly_left_shift(fmpq_poly_t, fmpq_poly_t, unsigned long)
     69    void fmpq_poly_right_shift(fmpq_poly_t, fmpq_poly_t, unsigned long)
     70   
     71    void fmpq_poly_gcd(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     72    void fmpq_poly_xgcd(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     73    void fmpq_poly_lcm(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     74
     75    void fmpq_poly_derivative(fmpq_poly_t, fmpq_poly_t)
     76
     77    void fmpq_poly_evaluate_mpz(mpq_t, fmpq_poly_t, mpz_t)
     78    void fmpq_poly_evaluate_mpq(mpq_t, fmpq_poly_t, mpq_t)
     79
     80    void fmpq_poly_content(mpq_t, fmpq_poly_t)
     81    void fmpq_poly_primitive_part(fmpq_poly_t, fmpq_poly_t)
     82
     83    void fmpq_poly_resultant(mpq_t, fmpq_poly_t, fmpq_poly_t)
     84
     85    void fmpq_poly_compose(fmpq_poly_t, fmpq_poly_t, fmpq_poly_t)
     86
     87    void fmpq_poly_getslice(fmpq_poly_t, fmpq_poly_t, unsigned long, unsigned long)
     88    void fmpq_poly_truncate(fmpq_poly_t, fmpq_poly_t, unsigned long)
     89    void fmpq_poly_reverse(fmpq_poly_t, fmpq_poly_t, unsigned long)
     90
     91    void _fmpq_poly_from_list(fmpq_poly_t, mpq_t *, unsigned long)
     92    void fmpq_poly_from_string(fmpq_poly_t, char *)
     93    char * fmpq_poly_to_string(fmpq_poly_t, char *)
     94    char * fmpq_poly_to_string_pretty(fmpq_poly_t, char *)
     95