From 2a3dd1148c8e2e3ded6d0a07e6414bf1504cd1c4 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Sun, 8 Sep 2024 21:46:18 +0100 Subject: [PATCH 1/2] bindings: regenerate bindings with FLINT 3.1.3-p1 --- src/flint/flintlib/functions/acb_poly.pxd | 1 + src/flint/flintlib/functions/arb.pxd | 18 +- src/flint/flintlib/functions/arf.pxd | 10 +- src/flint/flintlib/functions/arith.pxd | 25 +- src/flint/flintlib/functions/fmpq_mpoly.pxd | 8 +- src/flint/flintlib/functions/fmpz.pxd | 57 ++- src/flint/flintlib/functions/fmpz_factor.pxd | 26 +- src/flint/flintlib/functions/fmpz_mat.pxd | 6 +- .../flintlib/functions/fmpz_mod_mpoly.pxd | 4 +- src/flint/flintlib/functions/fmpz_mpoly.pxd | 16 +- src/flint/flintlib/functions/fmpz_mpoly_q.pxd | 4 +- src/flint/flintlib/functions/fmpz_poly.pxd | 28 +- src/flint/flintlib/functions/fmpz_vec.pxd | 12 +- src/flint/flintlib/functions/fq_default.pxd | 8 +- src/flint/flintlib/functions/fq_nmod.pxd | 18 +- src/flint/flintlib/functions/fq_nmod_poly.pxd | 3 +- src/flint/flintlib/functions/fq_zech.pxd | 12 +- src/flint/flintlib/functions/nmod.pxd | 34 +- src/flint/flintlib/functions/nmod_mat.pxd | 32 +- src/flint/flintlib/functions/nmod_mpoly.pxd | 10 +- src/flint/flintlib/functions/nmod_poly.pxd | 325 +++++++++--------- .../flintlib/functions/nmod_poly_factor.pxd | 12 +- src/flint/flintlib/functions/nmod_vec.pxd | 51 ++- src/flint/flintlib/functions/ulong_extras.pxd | 39 ++- 24 files changed, 384 insertions(+), 375 deletions(-) diff --git a/src/flint/flintlib/functions/acb_poly.pxd b/src/flint/flintlib/functions/acb_poly.pxd index 9db1b6d4..da3c1ae0 100644 --- a/src/flint/flintlib/functions/acb_poly.pxd +++ b/src/flint/flintlib/functions/acb_poly.pxd @@ -236,6 +236,7 @@ cdef extern from "flint/acb_poly.h": void acb_poly_root_bound_fujiwara(mag_t bound, acb_poly_t poly) void _acb_poly_root_inclusion(acb_t r, const acb_t m, acb_srcptr poly, acb_srcptr polyder, slong len, slong prec) slong _acb_poly_validate_roots(acb_ptr roots, acb_srcptr poly, slong len, slong prec) + void _acb_poly_refine_roots_durand_kerner(acb_ptr roots, acb_srcptr poly, slong len, slong prec) slong _acb_poly_find_roots(acb_ptr roots, acb_srcptr poly, acb_srcptr initial, slong len, slong maxiter, slong prec) slong acb_poly_find_roots(acb_ptr roots, const acb_poly_t poly, acb_srcptr initial, slong maxiter, slong prec) int _acb_poly_validate_real_roots(acb_srcptr roots, acb_srcptr poly, slong len, slong prec) diff --git a/src/flint/flintlib/functions/arb.pxd b/src/flint/flintlib/functions/arb.pxd index c2003820..43421200 100644 --- a/src/flint/flintlib/functions/arb.pxd +++ b/src/flint/flintlib/functions/arb.pxd @@ -1,6 +1,6 @@ from flint.flintlib.types.arb cimport arb_ptr, arb_srcptr, arb_t, mag_srcptr, mag_t from flint.flintlib.types.arf cimport arf_rnd_t, arf_srcptr, arf_t -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, mp_ptr, mp_size_t, mp_srcptr, slong, ulong from flint.flintlib.types.fmpq cimport fmpq_t # unknown type FILE @@ -318,14 +318,14 @@ cdef extern from "flint/arb.h": void arb_partitions_ui(arb_t res, ulong n, slong prec) void arb_primorial_nth_ui(arb_t res, ulong n, slong prec) void arb_primorial_ui(arb_t res, ulong n, slong prec) - void _arb_atan_taylor_naive(nn_ptr y, ulong * error, nn_srcptr x, slong xn, ulong N, int alternating) - void _arb_atan_taylor_rs(nn_ptr y, ulong * error, nn_srcptr x, slong xn, ulong N, int alternating) - void _arb_exp_taylor_naive(nn_ptr y, ulong * error, nn_srcptr x, slong xn, ulong N) - void _arb_exp_taylor_rs(nn_ptr y, ulong * error, nn_srcptr x, slong xn, ulong N) - void _arb_sin_cos_taylor_naive(nn_ptr ysin, nn_ptr ycos, ulong * error, nn_srcptr x, slong xn, ulong N) - void _arb_sin_cos_taylor_rs(nn_ptr ysin, nn_ptr ycos, ulong * error, nn_srcptr x, slong xn, ulong N, int sinonly, int alternating) - int _arb_get_mpn_fixed_mod_log2(nn_ptr w, fmpz_t q, ulong * error, const arf_t x, slong wn) - int _arb_get_mpn_fixed_mod_pi4(nn_ptr w, fmpz_t q, int * octant, ulong * error, const arf_t x, slong wn) + void _arb_atan_taylor_naive(mp_ptr y, mp_limb_t * error, mp_srcptr x, mp_size_t xn, ulong N, int alternating) + void _arb_atan_taylor_rs(mp_ptr y, mp_limb_t * error, mp_srcptr x, mp_size_t xn, ulong N, int alternating) + void _arb_exp_taylor_naive(mp_ptr y, mp_limb_t * error, mp_srcptr x, mp_size_t xn, ulong N) + void _arb_exp_taylor_rs(mp_ptr y, mp_limb_t * error, mp_srcptr x, mp_size_t xn, ulong N) + void _arb_sin_cos_taylor_naive(mp_ptr ysin, mp_ptr ycos, mp_limb_t * error, mp_srcptr x, mp_size_t xn, ulong N) + void _arb_sin_cos_taylor_rs(mp_ptr ysin, mp_ptr ycos, mp_limb_t * error, mp_srcptr x, mp_size_t xn, ulong N, int sinonly, int alternating) + int _arb_get_mpn_fixed_mod_log2(mp_ptr w, fmpz_t q, mp_limb_t * error, const arf_t x, mp_size_t wn) + int _arb_get_mpn_fixed_mod_pi4(mp_ptr w, fmpz_t q, int * octant, mp_limb_t * error, const arf_t x, mp_size_t wn) slong _arb_exp_taylor_bound(slong mag, slong prec) void arb_exp_arf_bb(arb_t z, const arf_t x, slong prec, int m1) void _arb_exp_sum_bs_simple(fmpz_t T, fmpz_t Q, flint_bitcnt_t * Qexp, const fmpz_t x, flint_bitcnt_t r, slong N) diff --git a/src/flint/flintlib/functions/arf.pxd b/src/flint/flintlib/functions/arf.pxd index cb7a40d2..22161716 100644 --- a/src/flint/flintlib/functions/arf.pxd +++ b/src/flint/flintlib/functions/arf.pxd @@ -1,6 +1,6 @@ from flint.flintlib.types.arb cimport mag_t from flint.flintlib.types.arf cimport arf_rnd_t, arf_srcptr, arf_t -from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, mp_limb_t, mp_ptr, mp_size_t, mp_srcptr, slong, ulong from flint.flintlib.types.fmpq cimport fmpq_t # unknown type FILE @@ -161,8 +161,8 @@ cdef extern from "flint/arf.h": int arf_complex_mul(arf_t e, arf_t f, const arf_t a, const arf_t b, const arf_t c, const arf_t d, slong prec, arf_rnd_t rnd) int arf_complex_mul_fallback(arf_t e, arf_t f, const arf_t a, const arf_t b, const arf_t c, const arf_t d, slong prec, arf_rnd_t rnd) int arf_complex_sqr(arf_t e, arf_t f, const arf_t a, const arf_t b, slong prec, arf_rnd_t rnd) - int _arf_get_integer_mpn(nn_ptr y, nn_srcptr xp, slong xn, slong exp) - int _arf_set_mpn_fixed(arf_t z, nn_srcptr xp, slong xn, slong fixn, int negative, slong prec, arf_rnd_t rnd) + int _arf_get_integer_mpn(mp_ptr y, mp_srcptr xp, mp_size_t xn, slong exp) + int _arf_set_mpn_fixed(arf_t z, mp_srcptr xp, mp_size_t xn, mp_size_t fixn, int negative, slong prec, arf_rnd_t rnd) int _arf_set_round_ui(arf_t z, ulong x, int sgnbit, slong prec, arf_rnd_t rnd) - int _arf_set_round_uiui(arf_t z, slong * fix, ulong hi, ulong lo, int sgnbit, slong prec, arf_rnd_t rnd) - int _arf_set_round_mpn(arf_t z, slong * exp_shift, nn_srcptr x, slong xn, int sgnbit, slong prec, arf_rnd_t rnd) + int _arf_set_round_uiui(arf_t z, slong * fix, mp_limb_t hi, mp_limb_t lo, int sgnbit, slong prec, arf_rnd_t rnd) + int _arf_set_round_mpn(arf_t z, slong * exp_shift, mp_srcptr x, mp_size_t xn, int sgnbit, slong prec, arf_rnd_t rnd) diff --git a/src/flint/flintlib/functions/arith.pxd b/src/flint/flintlib/functions/arith.pxd index 773ae7c8..197e2dc2 100644 --- a/src/flint/flintlib/functions/arith.pxd +++ b/src/flint/flintlib/functions/arith.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport fmpz_struct, fmpz_t, nmod_t, nn_ptr, slong, ulong +from flint.flintlib.types.flint cimport fmpz_struct, fmpz_t, mp_limb_t, mp_ptr, nmod_t, slong, ulong from flint.flintlib.types.fmpq cimport fmpq_poly_t, fmpq_struct, fmpq_t from flint.flintlib.types.fmpz cimport fmpz_mat_t, fmpz_poly_t @@ -7,6 +7,7 @@ from flint.flintlib.types.fmpz cimport fmpz_mat_t, fmpz_poly_t cdef extern from "flint/arith.h": + void arith_primorial(fmpz_t res, slong n) void _arith_harmonic_number(fmpz_t num, fmpz_t den, slong n) void arith_harmonic_number(fmpq_t x, slong n) void arith_stirling_number_1u(fmpz_t s, ulong n, ulong k) @@ -27,11 +28,11 @@ cdef extern from "flint/arith.h": void arith_bell_number_vec(fmpz_struct * b, slong n) void arith_bell_number_vec_recursive(fmpz_struct * b, slong n) void arith_bell_number_vec_multi_mod(fmpz_struct * b, slong n) - ulong arith_bell_number_nmod(ulong n, nmod_t mod) - void arith_bell_number_nmod_vec(nn_ptr b, slong n, nmod_t mod) - void arith_bell_number_nmod_vec_recursive(nn_ptr b, slong n, nmod_t mod) - void arith_bell_number_nmod_vec_ogf(nn_ptr b, slong n, nmod_t mod) - int arith_bell_number_nmod_vec_series(nn_ptr b, slong n, nmod_t mod) + mp_limb_t arith_bell_number_nmod(ulong n, nmod_t mod) + void arith_bell_number_nmod_vec(mp_ptr b, slong n, nmod_t mod) + void arith_bell_number_nmod_vec_recursive(mp_ptr b, slong n, nmod_t mod) + void arith_bell_number_nmod_vec_ogf(mp_ptr b, slong n, nmod_t mod) + int arith_bell_number_nmod_vec_series(mp_ptr b, slong n, nmod_t mod) double arith_bell_number_size(ulong n) void _arith_bernoulli_number(fmpz_t num, fmpz_t den, ulong n) void arith_bernoulli_number(fmpq_t x, ulong n) @@ -46,14 +47,22 @@ cdef extern from "flint/arith.h": void arith_euler_number_vec(fmpz_struct * res, slong n) double arith_euler_number_size(ulong n) void arith_euler_polynomial(fmpq_poly_t poly, ulong n) + void arith_euler_phi(fmpz_t res, const fmpz_t n) + int arith_moebius_mu(const fmpz_t n) + void arith_divisor_sigma(fmpz_t res, ulong k, const fmpz_t n) void arith_divisors(fmpz_poly_t res, const fmpz_t n) void arith_ramanujan_tau(fmpz_t res, const fmpz_t n) void arith_ramanujan_tau_series(fmpz_poly_t res, slong n) void arith_landau_function_vec(fmpz_struct * res, slong len) + void arith_dedekind_sum_naive(fmpq_t s, const fmpz_t h, const fmpz_t k) + double arith_dedekind_sum_coprime_d(double h, double k) + void arith_dedekind_sum_coprime_large(fmpq_t s, const fmpz_t h, const fmpz_t k) + void arith_dedekind_sum_coprime(fmpq_t s, const fmpz_t h, const fmpz_t k) + void arith_dedekind_sum(fmpq_t s, const fmpz_t h, const fmpz_t k) void arith_number_of_partitions_vec(fmpz_struct * res, slong len) - void arith_number_of_partitions_nmod_vec(nn_ptr res, slong len, nmod_t mod) + void arith_number_of_partitions_nmod_vec(mp_ptr res, slong len, nmod_t mod) # void trig_prod_init(trig_prod_t prod) - # void arith_hrr_expsum_factored(trig_prod_t prod, ulong k, ulong n) + # void arith_hrr_expsum_factored(trig_prod_t prod, mp_limb_t k, mp_limb_t n) # void arith_number_of_partitions_mpfr(mpfr_t x, ulong n) void arith_number_of_partitions(fmpz_t x, ulong n) void arith_sum_of_squares(fmpz_t r, ulong k, const fmpz_t n) diff --git a/src/flint/flintlib/functions/fmpq_mpoly.pxd b/src/flint/flintlib/functions/fmpq_mpoly.pxd index 1dc1d0ad..6cb9d598 100644 --- a/src/flint/flintlib/functions/fmpq_mpoly.pxd +++ b/src/flint/flintlib/functions/fmpq_mpoly.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, slong, ulong from flint.flintlib.types.fmpq cimport fmpq_mpoly_ctx_t, fmpq_mpoly_struct, fmpq_mpoly_t, fmpq_poly_struct, fmpq_poly_t, fmpq_struct, fmpq_t from flint.flintlib.types.fmpz cimport fmpz_mpoly_struct from flint.flintlib.types.mpoly cimport ordering_t @@ -95,9 +95,9 @@ cdef extern from "flint/fmpq_mpoly.h": void fmpq_mpoly_sort_terms(fmpq_mpoly_t A, const fmpq_mpoly_ctx_t ctx) void fmpq_mpoly_combine_like_terms(fmpq_mpoly_t A, const fmpq_mpoly_ctx_t ctx) void fmpq_mpoly_reverse(fmpq_mpoly_t A, const fmpq_mpoly_t B, const fmpq_mpoly_ctx_t ctx) - void fmpq_mpoly_randtest_bound(fmpq_mpoly_t A, flint_rand_t state, slong length, ulong coeff_bits, ulong exp_bound, const fmpq_mpoly_ctx_t ctx) - void fmpq_mpoly_randtest_bounds(fmpq_mpoly_t A, flint_rand_t state, slong length, ulong coeff_bits, ulong * exp_bounds, const fmpq_mpoly_ctx_t ctx) - void fmpq_mpoly_randtest_bits(fmpq_mpoly_t A, flint_rand_t state, slong length, ulong coeff_bits, ulong exp_bits, const fmpq_mpoly_ctx_t ctx) + void fmpq_mpoly_randtest_bound(fmpq_mpoly_t A, flint_rand_t state, slong length, mp_limb_t coeff_bits, ulong exp_bound, const fmpq_mpoly_ctx_t ctx) + void fmpq_mpoly_randtest_bounds(fmpq_mpoly_t A, flint_rand_t state, slong length, mp_limb_t coeff_bits, ulong * exp_bounds, const fmpq_mpoly_ctx_t ctx) + void fmpq_mpoly_randtest_bits(fmpq_mpoly_t A, flint_rand_t state, slong length, mp_limb_t coeff_bits, mp_limb_t exp_bits, const fmpq_mpoly_ctx_t ctx) void fmpq_mpoly_add_fmpq(fmpq_mpoly_t A, const fmpq_mpoly_t B, const fmpq_t c, const fmpq_mpoly_ctx_t ctx) void fmpq_mpoly_add_fmpz(fmpq_mpoly_t A, const fmpq_mpoly_t B, const fmpz_t c, const fmpq_mpoly_ctx_t ctx) void fmpq_mpoly_add_ui(fmpq_mpoly_t A, const fmpq_mpoly_t B, ulong c, const fmpq_mpoly_ctx_t ctx) diff --git a/src/flint/flintlib/functions/fmpz.pxd b/src/flint/flintlib/functions/fmpz.pxd index 2b278bb2..c55cd531 100644 --- a/src/flint/flintlib/functions/fmpz.pxd +++ b/src/flint/flintlib/functions/fmpz.pxd @@ -1,31 +1,30 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, nmod_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, mp_ptr, mp_size_t, mp_srcptr, nmod_t, slong, ulong from flint.flintlib.types.fmpz cimport fmpz_factor_t, fmpz_preinvn_t # unknown type FILE +# unknown type __mpz_struct # unknown type fmpz_comb_t # unknown type fmpz_comb_temp_t # unknown type fmpz_multi_CRT_t # unknown type mpf_t # unknown type mpfr_rnd_t # unknown type mpfr_t -# unknown type mpz_ptr # unknown type mpz_t # unknown type size_t # .. macro:: COEFF_MAX # .. macro:: COEFF_MIN # .. macro:: COEFF_IS_MPZ(f) -# .. macro:: MPZ_MIN_ALLOC cdef extern from "flint/fmpz.h": - # fmpz_struct PTR_TO_COEFF(mpz_ptr ptr) - # mpz_ptr COEFF_TO_PTR(fmpz_struct f) - # mpz_ptr _fmpz_new_mpz(void) + # fmpz_struct PTR_TO_COEFF(__mpz_struct * ptr) + # __mpz_struct * COEFF_TO_PTR(fmpz_struct f) + # __mpz_struct * _fmpz_new_mpz(void) void _fmpz_clear_mpz(fmpz_struct f) void _fmpz_cleanup_mpz_content() void _fmpz_cleanup() - # mpz_ptr _fmpz_promote(fmpz_t f) - # mpz_ptr _fmpz_promote_val(fmpz_t f) + # __mpz_struct * _fmpz_promote(fmpz_t f) + # __mpz_struct * _fmpz_promote_val(fmpz_t f) void _fmpz_demote(fmpz_t f) void _fmpz_demote_val(fmpz_t f) int _fmpz_is_canonical(const fmpz_t f) @@ -35,10 +34,9 @@ cdef extern from "flint/fmpz.h": void fmpz_init_set(fmpz_t f, const fmpz_t g) void fmpz_init_set_ui(fmpz_t f, ulong g) void fmpz_init_set_si(fmpz_t f, slong g) - void fmpz_randbits_unsigned(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits) void fmpz_randbits(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits) - void fmpz_randtest_unsigned(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits) void fmpz_randtest(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits) + void fmpz_randtest_unsigned(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits) void fmpz_randtest_not_zero(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits) void fmpz_randm(fmpz_t f, flint_rand_t state, const fmpz_t m) void fmpz_randtest_mod(fmpz_t f, flint_rand_t state, const fmpz_t m) @@ -46,34 +44,33 @@ cdef extern from "flint/fmpz.h": void fmpz_randprime(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits, int proved) slong fmpz_get_si(const fmpz_t f) ulong fmpz_get_ui(const fmpz_t f) - void fmpz_get_uiui(ulong * hi, ulong * low, const fmpz_t f) - ulong fmpz_get_nmod(const fmpz_t f, nmod_t mod) + void fmpz_get_uiui(mp_limb_t * hi, mp_limb_t * low, const fmpz_t f) + mp_limb_t fmpz_get_nmod(const fmpz_t f, nmod_t mod) double fmpz_get_d(const fmpz_t f) # void fmpz_set_mpf(fmpz_t f, const mpf_t x) # void fmpz_get_mpf(mpf_t x, const fmpz_t f) # void fmpz_get_mpfr(mpfr_t x, const fmpz_t f, mpfr_rnd_t rnd) double fmpz_get_d_2exp(slong * exp, const fmpz_t f) # void fmpz_get_mpz(mpz_t x, const fmpz_t f) - int fmpz_get_mpn(nn_ptr * n, fmpz_t n_in) + int fmpz_get_mpn(mp_ptr * n, fmpz_t n_in) char * fmpz_get_str(char * str, int b, const fmpz_t f) void fmpz_set_si(fmpz_t f, slong val) void fmpz_set_ui(fmpz_t f, ulong val) void fmpz_set_d(fmpz_t f, double c) void fmpz_set_d_2exp(fmpz_t f, double d, slong exp) void fmpz_neg_ui(fmpz_t f, ulong val) - void fmpz_set_uiui(fmpz_t f, ulong hi, ulong lo) - void fmpz_neg_uiui(fmpz_t f, ulong hi, ulong lo) + void fmpz_set_uiui(fmpz_t f, mp_limb_t hi, mp_limb_t lo) + void fmpz_neg_uiui(fmpz_t f, mp_limb_t hi, mp_limb_t lo) void fmpz_set_signed_uiui(fmpz_t f, ulong hi, ulong lo) void fmpz_set_signed_uiuiui(fmpz_t f, ulong hi, ulong mid, ulong lo) void fmpz_set_ui_array(fmpz_t out, const ulong * in_, slong n) void fmpz_set_signed_ui_array(fmpz_t out, const ulong * in_, slong n) void fmpz_get_ui_array(ulong * out, slong n, const fmpz_t in_) void fmpz_get_signed_ui_array(ulong * out, slong n, const fmpz_t in_) - void fmpz_set_mpn_large(fmpz_t z, nn_srcptr src, slong n, int negative) void fmpz_get_signed_uiui(ulong * hi, ulong * lo, const fmpz_t in_) # void fmpz_set_mpz(fmpz_t f, const mpz_t x) int fmpz_set_str(fmpz_t f, const char * str, int b) - void fmpz_set_ui_smod(fmpz_t f, ulong x, ulong m) + void fmpz_set_ui_smod(fmpz_t f, mp_limb_t x, mp_limb_t m) # void flint_mpz_init_set_readonly(mpz_t z, const fmpz_t f) # void flint_mpz_clear_readonly(mpz_t z) # void fmpz_init_set_readonly(fmpz_t f, const mpz_t z) @@ -86,7 +83,7 @@ cdef extern from "flint/fmpz.h": # size_t fmpz_out_raw(FILE * fout, const fmpz_t x ) # size_t fmpz_sizeinbase(const fmpz_t f, int b) flint_bitcnt_t fmpz_bits(const fmpz_t f) - slong fmpz_size(const fmpz_t f) + mp_size_t fmpz_size(const fmpz_t f) int fmpz_sgn(const fmpz_t f) flint_bitcnt_t fmpz_val2(const fmpz_t f) void fmpz_swap(fmpz_t f, fmpz_t g) @@ -97,8 +94,8 @@ cdef extern from "flint/fmpz.h": int fmpz_fits_si(const fmpz_t f) void fmpz_setbit(fmpz_t f, ulong i) int fmpz_tstbit(const fmpz_t f, ulong i) - ulong fmpz_abs_lbound_ui_2exp(slong * exp, const fmpz_t x, int bits) - ulong fmpz_abs_ubound_ui_2exp(slong * exp, const fmpz_t x, int bits) + mp_limb_t fmpz_abs_lbound_ui_2exp(slong * exp, const fmpz_t x, int bits) + mp_limb_t fmpz_abs_ubound_ui_2exp(slong * exp, const fmpz_t x, int bits) int fmpz_cmp(const fmpz_t f, const fmpz_t g) int fmpz_cmp_ui(const fmpz_t f, ulong g) int fmpz_cmp_si(const fmpz_t f, slong g) @@ -209,9 +206,9 @@ cdef extern from "flint/fmpz.h": int fmpz_jacobi(const fmpz_t a, const fmpz_t n) int fmpz_kronecker(const fmpz_t a, const fmpz_t n) void fmpz_divides_mod_list(fmpz_t xstart, fmpz_t xstride, fmpz_t xlength, const fmpz_t a, const fmpz_t b, const fmpz_t n) - int fmpz_bit_pack(ulong * arr, flint_bitcnt_t shift, flint_bitcnt_t bits, const fmpz_t coeff, int negate, int borrow) - int fmpz_bit_unpack(fmpz_t coeff, ulong * arr, flint_bitcnt_t shift, flint_bitcnt_t bits, int negate, int borrow) - void fmpz_bit_unpack_unsigned(fmpz_t coeff, const ulong * arr, flint_bitcnt_t shift, flint_bitcnt_t bits) + int fmpz_bit_pack(mp_limb_t * arr, flint_bitcnt_t shift, flint_bitcnt_t bits, const fmpz_t coeff, int negate, int borrow) + int fmpz_bit_unpack(fmpz_t coeff, mp_limb_t * arr, flint_bitcnt_t shift, flint_bitcnt_t bits, int negate, int borrow) + void fmpz_bit_unpack_unsigned(fmpz_t coeff, const mp_limb_t * arr, flint_bitcnt_t shift, flint_bitcnt_t bits) void fmpz_complement(fmpz_t r, const fmpz_t f) void fmpz_clrbit(fmpz_t f, ulong i) void fmpz_combit(fmpz_t f, ulong i) @@ -221,9 +218,9 @@ cdef extern from "flint/fmpz.h": ulong fmpz_popcnt(const fmpz_t a) void fmpz_CRT_ui(fmpz_t out, const fmpz_t r1, const fmpz_t m1, ulong r2, ulong m2, int sign) void fmpz_CRT(fmpz_t out, const fmpz_t r1, const fmpz_t m1, const fmpz_t r2, const fmpz_t m2, int sign) - # void fmpz_multi_mod_ui(ulong * out, const fmpz_t in_, const fmpz_comb_t comb, fmpz_comb_temp_t temp) - # void fmpz_multi_CRT_ui(fmpz_t output, nn_srcptr residues, const fmpz_comb_t comb, fmpz_comb_temp_t ctemp, int sign) - # void fmpz_comb_init(fmpz_comb_t comb, nn_srcptr primes, slong num_primes) + # void fmpz_multi_mod_ui(mp_limb_t * out, const fmpz_t in_, const fmpz_comb_t comb, fmpz_comb_temp_t temp) + # void fmpz_multi_CRT_ui(fmpz_t output, mp_srcptr residues, const fmpz_comb_t comb, fmpz_comb_temp_t ctemp, int sign) + # void fmpz_comb_init(fmpz_comb_t comb, mp_srcptr primes, slong num_primes) # void fmpz_comb_temp_init(fmpz_comb_temp_t temp, const fmpz_comb_t comb) # void fmpz_comb_clear(fmpz_comb_t comb) # void fmpz_comb_temp_clear(fmpz_comb_temp_t temp) @@ -237,10 +234,10 @@ cdef extern from "flint/fmpz.h": int fmpz_is_probabprime_BPSW(const fmpz_t n) int fmpz_is_probabprime(const fmpz_t p) int fmpz_is_prime_pseudosquare(const fmpz_t n) - int fmpz_is_prime_pocklington(fmpz_t F, fmpz_t R, const fmpz_t n, nn_ptr pm1, slong num_pm1) - void _fmpz_nm1_trial_factors(const fmpz_t n, nn_ptr pm1, slong * num_pm1, ulong limit) - int fmpz_is_prime_morrison(fmpz_t F, fmpz_t R, const fmpz_t n, nn_ptr pp1, slong num_pp1) - void _fmpz_np1_trial_factors(const fmpz_t n, nn_ptr pp1, slong * num_pp1, ulong limit) + int fmpz_is_prime_pocklington(fmpz_t F, fmpz_t R, const fmpz_t n, mp_ptr pm1, slong num_pm1) + void _fmpz_nm1_trial_factors(const fmpz_t n, mp_ptr pm1, slong * num_pm1, ulong limit) + int fmpz_is_prime_morrison(fmpz_t F, fmpz_t R, const fmpz_t n, mp_ptr pp1, slong num_pp1) + void _fmpz_np1_trial_factors(const fmpz_t n, mp_ptr pp1, slong * num_pp1, ulong limit) int fmpz_is_prime(const fmpz_t n) void fmpz_lucas_chain(fmpz_t Vm, fmpz_t Vm1, const fmpz_t A, const fmpz_t m, const fmpz_t n) void fmpz_lucas_chain_full(fmpz_t Vm, fmpz_t Vm1, const fmpz_t A, const fmpz_t B, const fmpz_t m, const fmpz_t n) diff --git a/src/flint/flintlib/functions/fmpz_factor.pxd b/src/flint/flintlib/functions/fmpz_factor.pxd index 3afe2e54..c57e4b94 100644 --- a/src/flint/flintlib/functions/fmpz_factor.pxd +++ b/src/flint/flintlib/functions/fmpz_factor.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, nn_ptr, slong, ulong +from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, mp_limb_t, mp_ptr, slong, ulong from flint.flintlib.types.fmpz cimport fmpz_factor_t # unknown type FILE @@ -8,7 +8,7 @@ from flint.flintlib.types.fmpz cimport fmpz_factor_t cdef extern from "flint/fmpz_factor.h": void fmpz_factor_init(fmpz_factor_t factor) void fmpz_factor_clear(fmpz_factor_t factor) - void _fmpz_factor_append_ui(fmpz_factor_t factor, ulong p, ulong exp) + void _fmpz_factor_append_ui(fmpz_factor_t factor, mp_limb_t p, ulong exp) void _fmpz_factor_append(fmpz_factor_t factor, const fmpz_t p, ulong exp) void fmpz_factor(fmpz_factor_t factor, const fmpz_t n) int fmpz_factor_smooth(fmpz_factor_t factor, const fmpz_t n, slong bits, int proved) @@ -18,16 +18,18 @@ cdef extern from "flint/fmpz_factor.h": void fmpz_factor_refine(fmpz_factor_t res, const fmpz_factor_t f) void fmpz_factor_expand_iterative(fmpz_t n, const fmpz_factor_t factor) int fmpz_factor_pp1(fmpz_t factor, const fmpz_t n, ulong B1, ulong B2_sqrt, ulong c) - int fmpz_factor_pollard_brent_single(fmpz_t p_factor, fmpz_t n_in, fmpz_t yi, fmpz_t ai, ulong max_iters) - int fmpz_factor_pollard_brent(fmpz_t factor, flint_rand_t state, fmpz_t n, ulong max_tries, ulong max_iters) + int fmpz_factor_pollard_brent_single(fmpz_t p_factor, fmpz_t n_in, fmpz_t yi, fmpz_t ai, mp_limb_t max_iters) + int fmpz_factor_pollard_brent(fmpz_t factor, flint_rand_t state, fmpz_t n, mp_limb_t max_tries, mp_limb_t max_iters) # int fmpz_factor_fprint(FILE * fs, const fmpz_factor_t factor) int fmpz_factor_print(const fmpz_factor_t factor) - # void fmpz_factor_ecm_init(ecm_t ecm_inf, ulong sz) + # void fmpz_factor_ecm_init(ecm_t ecm_inf, mp_limb_t sz) # void fmpz_factor_ecm_clear(ecm_t ecm_inf) - # void fmpz_factor_ecm_double(nn_ptr x, nn_ptr z, nn_ptr x0, nn_ptr z0, nn_ptr n, ecm_t ecm_inf) - # void fmpz_factor_ecm_add(nn_ptr x, nn_ptr z, nn_ptr x1, nn_ptr z1, nn_ptr x2, nn_ptr z2, nn_ptr x0, nn_ptr z0, nn_ptr n, ecm_t ecm_inf) - # void fmpz_factor_ecm_mul_montgomery_ladder(nn_ptr x, nn_ptr z, nn_ptr x0, nn_ptr z0, ulong k, nn_ptr n, ecm_t ecm_inf) - # int fmpz_factor_ecm_select_curve(nn_ptr f, nn_ptr sigma, nn_ptr n, ecm_t ecm_inf) - # int fmpz_factor_ecm_stage_I(nn_ptr f, const ulong * prime_array, ulong num, ulong B1, nn_ptr n, ecm_t ecm_inf) - # int fmpz_factor_ecm_stage_II(nn_ptr f, ulong B1, ulong B2, ulong P, nn_ptr n, ecm_t ecm_inf) - int fmpz_factor_ecm(fmpz_t f, ulong curves, ulong B1, ulong B2, flint_rand_t state, const fmpz_t n_in) + void fmpz_factor_ecm_addmod(mp_ptr a, mp_ptr b, mp_ptr c, mp_ptr n, mp_limb_t n_size) + void fmpz_factor_ecm_submod(mp_ptr x, mp_ptr a, mp_ptr b, mp_ptr n, mp_limb_t n_size) + # void fmpz_factor_ecm_double(mp_ptr x, mp_ptr z, mp_ptr x0, mp_ptr z0, mp_ptr n, ecm_t ecm_inf) + # void fmpz_factor_ecm_add(mp_ptr x, mp_ptr z, mp_ptr x1, mp_ptr z1, mp_ptr x2, mp_ptr z2, mp_ptr x0, mp_ptr z0, mp_ptr n, ecm_t ecm_inf) + # void fmpz_factor_ecm_mul_montgomery_ladder(mp_ptr x, mp_ptr z, mp_ptr x0, mp_ptr z0, mp_limb_t k, mp_ptr n, ecm_t ecm_inf) + # int fmpz_factor_ecm_select_curve(mp_ptr f, mp_ptr sigma, mp_ptr n, ecm_t ecm_inf) + # int fmpz_factor_ecm_stage_I(mp_ptr f, const mp_limb_t * prime_array, mp_limb_t num, mp_limb_t B1, mp_ptr n, ecm_t ecm_inf) + # int fmpz_factor_ecm_stage_II(mp_ptr f, mp_limb_t B1, mp_limb_t B2, mp_limb_t P, mp_ptr n, ecm_t ecm_inf) + int fmpz_factor_ecm(fmpz_t f, mp_limb_t curves, mp_limb_t B1, mp_limb_t B2, flint_rand_t state, const fmpz_t n_in) diff --git a/src/flint/flintlib/functions/fmpz_mat.pxd b/src/flint/flintlib/functions/fmpz_mat.pxd index 48718a0c..fb496cc6 100644 --- a/src/flint/flintlib/functions/fmpz_mat.pxd +++ b/src/flint/flintlib/functions/fmpz_mat.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, slong, ulong from flint.flintlib.types.fmpq cimport fmpq_t from flint.flintlib.types.fmpz cimport fmpz_mat_t, fmpz_poly_t from flint.flintlib.types.nmod cimport nmod_mat_t @@ -132,7 +132,7 @@ cdef extern from "flint/fmpz_mat.h": int fmpz_mat_solve_cramer(fmpz_mat_t X, fmpz_t den, const fmpz_mat_t A, const fmpz_mat_t B) void fmpz_mat_solve_bound(fmpz_t N, fmpz_t D, const fmpz_mat_t A, const fmpz_mat_t B) int fmpz_mat_solve_dixon(fmpz_mat_t X, fmpz_t M, const fmpz_mat_t A, const fmpz_mat_t B) - void _fmpz_mat_solve_dixon_den(fmpz_mat_t X, fmpz_t den, const fmpz_mat_t A, const fmpz_mat_t B, const nmod_mat_t Ainv, ulong p, const fmpz_t N, const fmpz_t D) + void _fmpz_mat_solve_dixon_den(fmpz_mat_t X, fmpz_t den, const fmpz_mat_t A, const fmpz_mat_t B, const nmod_mat_t Ainv, mp_limb_t p, const fmpz_t N, const fmpz_t D) int fmpz_mat_solve_dixon_den(fmpz_mat_t X, fmpz_t den, const fmpz_mat_t A, const fmpz_mat_t B) int fmpz_mat_solve_multi_mod_den(fmpz_mat_t X, fmpz_t den, const fmpz_mat_t A, const fmpz_mat_t B) int fmpz_mat_can_solve_multi_mod_den(fmpz_mat_t X, fmpz_t den, const fmpz_mat_t A, const fmpz_mat_t B) @@ -167,8 +167,8 @@ cdef extern from "flint/fmpz_mat.h": int fmpz_mat_hadamard(fmpz_mat_t H) # int fmpz_mat_get_d_mat(d_mat_t B, const fmpz_mat_t A) # int fmpz_mat_get_d_mat_transpose(d_mat_t B, const fmpz_mat_t A) - # void fmpz_mat_chol_d(d_mat_t R, const fmpz_mat_t A) void fmpz_mat_is_spd(const fmpz_mat_t A) + # void fmpz_mat_chol_d(d_mat_t R, const fmpz_mat_t A) int fmpz_mat_is_reduced(const fmpz_mat_t A, double delta, double eta) int fmpz_mat_is_reduced_gram(const fmpz_mat_t A, double delta, double eta) int fmpz_mat_is_reduced_with_removal(const fmpz_mat_t A, double delta, double eta, const fmpz_t gs_B, int newd) diff --git a/src/flint/flintlib/functions/fmpz_mod_mpoly.pxd b/src/flint/flintlib/functions/fmpz_mod_mpoly.pxd index 86c761b8..4e156e05 100644 --- a/src/flint/flintlib/functions/fmpz_mod_mpoly.pxd +++ b/src/flint/flintlib/functions/fmpz_mod_mpoly.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, slong, ulong from flint.flintlib.types.fmpz cimport fmpz_poly_struct, fmpz_poly_t from flint.flintlib.types.fmpz_mod cimport fmpz_mod_mpoly_ctx_t, fmpz_mod_mpoly_struct, fmpz_mod_mpoly_t from flint.flintlib.types.mpoly cimport ordering_t @@ -91,7 +91,7 @@ cdef extern from "flint/fmpz_mod_mpoly.h": void fmpz_mod_mpoly_reverse(fmpz_mod_mpoly_t A, const fmpz_mod_mpoly_t B, const fmpz_mod_mpoly_ctx_t ctx) void fmpz_mod_mpoly_randtest_bound(fmpz_mod_mpoly_t A, flint_rand_t state, slong length, ulong exp_bound, const fmpz_mod_mpoly_ctx_t ctx) void fmpz_mod_mpoly_randtest_bounds(fmpz_mod_mpoly_t A, flint_rand_t state, slong length, ulong * exp_bounds, const fmpz_mod_mpoly_ctx_t ctx) - void fmpz_mod_mpoly_randtest_bits(fmpz_mod_mpoly_t A, flint_rand_t state, slong length, ulong exp_bits, const fmpz_mod_mpoly_ctx_t ctx) + void fmpz_mod_mpoly_randtest_bits(fmpz_mod_mpoly_t A, flint_rand_t state, slong length, mp_limb_t exp_bits, const fmpz_mod_mpoly_ctx_t ctx) void fmpz_mod_mpoly_add_fmpz(fmpz_mod_mpoly_t A, const fmpz_mod_mpoly_t B, const fmpz_t c, const fmpz_mod_mpoly_ctx_t ctx) void fmpz_mod_mpoly_add_ui(fmpz_mod_mpoly_t A, const fmpz_mod_mpoly_t B, ulong c, const fmpz_mod_mpoly_ctx_t ctx) void fmpz_mod_mpoly_add_si(fmpz_mod_mpoly_t A, const fmpz_mod_mpoly_t B, slong c, const fmpz_mod_mpoly_ctx_t ctx) diff --git a/src/flint/flintlib/functions/fmpz_mpoly.pxd b/src/flint/flintlib/functions/fmpz_mpoly.pxd index 783d47c7..0616371d 100644 --- a/src/flint/flintlib/functions/fmpz_mpoly.pxd +++ b/src/flint/flintlib/functions/fmpz_mpoly.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, slong, ulong from flint.flintlib.types.fmpz cimport fmpz_mpoly_ctx_t, fmpz_mpoly_struct, fmpz_mpoly_t, fmpz_mpoly_vec_t, fmpz_poly_struct, fmpz_poly_t from flint.flintlib.types.mpoly cimport ordering_t @@ -104,9 +104,9 @@ cdef extern from "flint/fmpz_mpoly.h": void fmpz_mpoly_sort_terms(fmpz_mpoly_t A, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_combine_like_terms(fmpz_mpoly_t A, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_reverse(fmpz_mpoly_t A, const fmpz_mpoly_t B, const fmpz_mpoly_ctx_t ctx) - void fmpz_mpoly_randtest_bound(fmpz_mpoly_t A, flint_rand_t state, slong length, ulong coeff_bits, ulong exp_bound, const fmpz_mpoly_ctx_t ctx) - void fmpz_mpoly_randtest_bounds(fmpz_mpoly_t A, flint_rand_t state, slong length, ulong coeff_bits, ulong * exp_bounds, const fmpz_mpoly_ctx_t ctx) - void fmpz_mpoly_randtest_bits(fmpz_mpoly_t A, flint_rand_t state, slong length, ulong coeff_bits, ulong exp_bits, const fmpz_mpoly_ctx_t ctx) + void fmpz_mpoly_randtest_bound(fmpz_mpoly_t A, flint_rand_t state, slong length, mp_limb_t coeff_bits, ulong exp_bound, const fmpz_mpoly_ctx_t ctx) + void fmpz_mpoly_randtest_bounds(fmpz_mpoly_t A, flint_rand_t state, slong length, mp_limb_t coeff_bits, ulong * exp_bounds, const fmpz_mpoly_ctx_t ctx) + void fmpz_mpoly_randtest_bits(fmpz_mpoly_t A, flint_rand_t state, slong length, mp_limb_t coeff_bits, mp_limb_t exp_bits, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_add_fmpz(fmpz_mpoly_t A, const fmpz_mpoly_t B, const fmpz_t c, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_add_ui(fmpz_mpoly_t A, const fmpz_mpoly_t B, ulong c, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_add_si(fmpz_mpoly_t A, const fmpz_mpoly_t B, slong c, const fmpz_mpoly_ctx_t ctx) @@ -182,17 +182,17 @@ cdef extern from "flint/fmpz_mpoly.h": void fmpz_mpoly_pow_fps(fmpz_mpoly_t A, const fmpz_mpoly_t B, ulong k, const fmpz_mpoly_ctx_t ctx) slong _fmpz_mpoly_divides_array(fmpz_struct ** poly1, ulong ** exp1, slong * alloc, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, slong * mults, slong num, slong bits) int fmpz_mpoly_divides_array(fmpz_mpoly_t poly1, const fmpz_mpoly_t poly2, const fmpz_mpoly_t poly3, const fmpz_mpoly_ctx_t ctx) - slong _fmpz_mpoly_divides_monagan_pearce(fmpz_struct ** poly1, ulong ** exp1, slong * alloc, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, ulong bits, slong N, const ulong * cmpmask) + slong _fmpz_mpoly_divides_monagan_pearce(fmpz_struct ** poly1, ulong ** exp1, slong * alloc, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, ulong bits, slong N, const mp_limb_t * cmpmask) int fmpz_mpoly_divides_monagan_pearce(fmpz_mpoly_t poly1, const fmpz_mpoly_t poly2, const fmpz_mpoly_t poly3, const fmpz_mpoly_ctx_t ctx) int fmpz_mpoly_divides_heap_threaded(fmpz_mpoly_t Q, const fmpz_mpoly_t A, const fmpz_mpoly_t B, const fmpz_mpoly_ctx_t ctx) - slong _fmpz_mpoly_div_monagan_pearce(fmpz_struct ** polyq, ulong ** expq, slong * allocq, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, slong bits, slong N, const ulong * cmpmask) + slong _fmpz_mpoly_div_monagan_pearce(fmpz_struct ** polyq, ulong ** expq, slong * allocq, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, slong bits, slong N, const mp_limb_t * cmpmask) void fmpz_mpoly_div_monagan_pearce(fmpz_mpoly_t polyq, const fmpz_mpoly_t poly2, const fmpz_mpoly_t poly3, const fmpz_mpoly_ctx_t ctx) - slong _fmpz_mpoly_divrem_monagan_pearce(slong * lenr, fmpz_struct ** polyq, ulong ** expq, slong * allocq, fmpz_struct ** polyr, ulong ** expr, slong * allocr, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, slong bits, slong N, const ulong * cmpmask) + slong _fmpz_mpoly_divrem_monagan_pearce(slong * lenr, fmpz_struct ** polyq, ulong ** expq, slong * allocq, fmpz_struct ** polyr, ulong ** expr, slong * allocr, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, slong bits, slong N, const mp_limb_t * cmpmask) void fmpz_mpoly_divrem_monagan_pearce(fmpz_mpoly_t q, fmpz_mpoly_t r, const fmpz_mpoly_t poly2, const fmpz_mpoly_t poly3, const fmpz_mpoly_ctx_t ctx) slong _fmpz_mpoly_divrem_array(slong * lenr, fmpz_struct ** polyq, ulong ** expq, slong * allocq, fmpz_struct ** polyr, ulong ** expr, slong * allocr, const fmpz_struct * poly2, const ulong * exp2, slong len2, const fmpz_struct * poly3, const ulong * exp3, slong len3, slong * mults, slong num, slong bits) int fmpz_mpoly_divrem_array(fmpz_mpoly_t q, fmpz_mpoly_t r, const fmpz_mpoly_t poly2, const fmpz_mpoly_t poly3, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_quasidivrem_heap(fmpz_t scale, fmpz_mpoly_t q, fmpz_mpoly_t r, const fmpz_mpoly_t poly2, const fmpz_mpoly_t poly3, const fmpz_mpoly_ctx_t ctx) - slong _fmpz_mpoly_divrem_ideal_monagan_pearce(fmpz_mpoly_struct ** polyq, fmpz_struct ** polyr, ulong ** expr, slong * allocr, const fmpz_struct * poly2, const ulong * exp2, slong len2, fmpz_mpoly_struct * const * poly3, ulong * const * exp3, slong len, slong N, slong bits, const fmpz_mpoly_ctx_t ctx, const ulong * cmpmask) + slong _fmpz_mpoly_divrem_ideal_monagan_pearce(fmpz_mpoly_struct ** polyq, fmpz_struct ** polyr, ulong ** expr, slong * allocr, const fmpz_struct * poly2, const ulong * exp2, slong len2, fmpz_mpoly_struct * const * poly3, ulong * const * exp3, slong len, slong N, slong bits, const fmpz_mpoly_ctx_t ctx, const mp_limb_t * cmpmask) void fmpz_mpoly_divrem_ideal_monagan_pearce(fmpz_mpoly_struct ** q, fmpz_mpoly_t r, const fmpz_mpoly_t poly2, fmpz_mpoly_struct * const * poly3, slong len, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_vec_init(fmpz_mpoly_vec_t vec, slong len, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_vec_clear(fmpz_mpoly_vec_t vec, const fmpz_mpoly_ctx_t ctx) diff --git a/src/flint/flintlib/functions/fmpz_mpoly_q.pxd b/src/flint/flintlib/functions/fmpz_mpoly_q.pxd index aac2c55c..467456dd 100644 --- a/src/flint/flintlib/functions/fmpz_mpoly_q.pxd +++ b/src/flint/flintlib/functions/fmpz_mpoly_q.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, slong, ulong +from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, mp_limb_t, slong from flint.flintlib.types.fmpq cimport fmpq_t from flint.flintlib.types.fmpz cimport fmpz_mpoly_ctx_t, fmpz_mpoly_q_t, fmpz_mpoly_t @@ -27,7 +27,7 @@ cdef extern from "flint/fmpz_mpoly_q.h": void fmpz_mpoly_q_print_pretty(const fmpz_mpoly_q_t f, const char ** x, const fmpz_mpoly_ctx_t ctx) char * fmpz_mpoly_q_get_str_pretty(const fmpz_mpoly_q_t f, const char ** x, const fmpz_mpoly_ctx_t ctx) int fmpz_mpoly_q_set_str_pretty(fmpz_mpoly_q_t res, const char * s, const char ** x, fmpz_mpoly_ctx_t ctx) - void fmpz_mpoly_q_randtest(fmpz_mpoly_q_t res, flint_rand_t state, slong length, ulong coeff_bits, slong exp_bound, const fmpz_mpoly_ctx_t ctx) + void fmpz_mpoly_q_randtest(fmpz_mpoly_q_t res, flint_rand_t state, slong length, mp_limb_t coeff_bits, slong exp_bound, const fmpz_mpoly_ctx_t ctx) int fmpz_mpoly_q_equal(const fmpz_mpoly_q_t x, const fmpz_mpoly_q_t y, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_q_neg(fmpz_mpoly_q_t res, const fmpz_mpoly_q_t x, const fmpz_mpoly_ctx_t ctx) void fmpz_mpoly_q_add(fmpz_mpoly_q_t res, const fmpz_mpoly_q_t x, const fmpz_mpoly_q_t y, const fmpz_mpoly_ctx_t ctx) diff --git a/src/flint/flintlib/functions/fmpz_poly.pxd b/src/flint/flintlib/functions/fmpz_poly.pxd index 91782fd7..c1a4e723 100644 --- a/src/flint/flintlib/functions/fmpz_poly.pxd +++ b/src/flint/flintlib/functions/fmpz_poly.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_bitcnt_t, mp_limb_t, mp_ptr, mp_srcptr, slong, ulong from flint.flintlib.types.fmpq cimport fmpq_struct, fmpq_t from flint.flintlib.types.fmpz cimport fmpz_poly_factor_t, fmpz_poly_t, fmpz_preinvn_t from flint.flintlib.types.nmod cimport nmod_poly_factor_t, nmod_poly_t @@ -42,9 +42,9 @@ cdef extern from "flint/fmpz_poly.h": void fmpz_poly_randtest_unsigned(fmpz_poly_t f, flint_rand_t state, slong len, flint_bitcnt_t bits) void fmpz_poly_randtest_not_zero(fmpz_poly_t f, flint_rand_t state, slong len, flint_bitcnt_t bits) void fmpz_poly_randtest_no_real_root(fmpz_poly_t p, flint_rand_t state, slong len, flint_bitcnt_t bits) - void fmpz_poly_randtest_irreducible1(fmpz_poly_t pol, flint_rand_t state, slong len, flint_bitcnt_t bits) - void fmpz_poly_randtest_irreducible2(fmpz_poly_t pol, flint_rand_t state, slong len, flint_bitcnt_t bits) - void fmpz_poly_randtest_irreducible(fmpz_poly_t pol, flint_rand_t state, slong len, flint_bitcnt_t bits) + void fmpz_poly_randtest_irreducible1(fmpz_poly_t pol, flint_rand_t state, slong len, mp_bitcnt_t bits) + void fmpz_poly_randtest_irreducible2(fmpz_poly_t pol, flint_rand_t state, slong len, mp_bitcnt_t bits) + void fmpz_poly_randtest_irreducible(fmpz_poly_t pol, flint_rand_t state, slong len, mp_bitcnt_t bits) void fmpz_poly_get_coeff_fmpz(fmpz_t x, const fmpz_poly_t poly, slong n) slong fmpz_poly_get_coeff_si(const fmpz_poly_t poly, slong n) ulong fmpz_poly_get_coeff_ui(const fmpz_poly_t poly, slong n) @@ -90,9 +90,9 @@ cdef extern from "flint/fmpz_poly.h": void fmpz_poly_scalar_smod_fmpz(fmpz_poly_t poly1, const fmpz_poly_t poly2, const fmpz_t p) slong _fmpz_poly_remove_content_2exp(fmpz_struct * pol, slong len) void _fmpz_poly_scale_2exp(fmpz_struct * pol, slong len, slong k) - void _fmpz_poly_bit_pack(nn_ptr arr, const fmpz_struct * poly, slong len, flint_bitcnt_t bit_size, int negate) - int _fmpz_poly_bit_unpack(fmpz_struct * poly, slong len, nn_srcptr arr, flint_bitcnt_t bit_size, int negate) - void _fmpz_poly_bit_unpack_unsigned(fmpz_struct * poly, slong len, nn_srcptr arr, flint_bitcnt_t bit_size) + void _fmpz_poly_bit_pack(mp_ptr arr, const fmpz_struct * poly, slong len, flint_bitcnt_t bit_size, int negate) + int _fmpz_poly_bit_unpack(fmpz_struct * poly, slong len, mp_srcptr arr, flint_bitcnt_t bit_size, int negate) + void _fmpz_poly_bit_unpack_unsigned(fmpz_struct * poly, slong len, mp_srcptr arr, flint_bitcnt_t bit_size) void fmpz_poly_bit_pack(fmpz_t f, const fmpz_poly_t poly, flint_bitcnt_t bit_size) void fmpz_poly_bit_unpack(fmpz_poly_t poly, const fmpz_t f, flint_bitcnt_t bit_size) void fmpz_poly_bit_unpack_unsigned(fmpz_poly_t poly, const fmpz_t f, flint_bitcnt_t bit_size) @@ -167,7 +167,7 @@ cdef extern from "flint/fmpz_poly.h": void fmpz_poly_height(fmpz_t height, const fmpz_poly_t poly) void _fmpz_poly_2norm(fmpz_t res, const fmpz_struct * poly, slong len) void fmpz_poly_2norm(fmpz_t res, const fmpz_poly_t poly) - ulong _fmpz_poly_2norm_normalised_bits(const fmpz_struct * poly, slong len) + mp_limb_t _fmpz_poly_2norm_normalised_bits(const fmpz_struct * poly, slong len) void _fmpz_poly_gcd_subresultant(fmpz_struct * res, const fmpz_struct * poly1, slong len1, const fmpz_struct * poly2, slong len2) void fmpz_poly_gcd_subresultant(fmpz_poly_t res, const fmpz_poly_t poly1, const fmpz_poly_t poly2) int _fmpz_poly_gcd_heuristic(fmpz_struct * res, const fmpz_struct * poly1, slong len1, const fmpz_struct * poly2, slong len2) @@ -279,8 +279,8 @@ cdef extern from "flint/fmpz_poly.h": void fmpz_poly_evaluate_horner_fmpq(fmpq_t res, const fmpz_poly_t f, const fmpq_t a) void _fmpz_poly_evaluate_fmpq(fmpz_t rnum, fmpz_t rden, const fmpz_struct * f, slong len, const fmpz_t anum, const fmpz_t aden) void fmpz_poly_evaluate_fmpq(fmpq_t res, const fmpz_poly_t f, const fmpq_t a) - ulong _fmpz_poly_evaluate_mod(const fmpz_struct * poly, slong len, ulong a, ulong n, ulong ninv) - ulong fmpz_poly_evaluate_mod(const fmpz_poly_t poly, ulong a, ulong n) + mp_limb_t _fmpz_poly_evaluate_mod(const fmpz_struct * poly, slong len, mp_limb_t a, mp_limb_t n, mp_limb_t ninv) + mp_limb_t fmpz_poly_evaluate_mod(const fmpz_poly_t poly, mp_limb_t a, mp_limb_t n) void fmpz_poly_evaluate_fmpz_vec(fmpz_struct * res, const fmpz_poly_t f, const fmpz_struct * a, slong n) double _fmpz_poly_evaluate_horner_d(const fmpz_struct * poly, slong n, double d) double fmpz_poly_evaluate_horner_d(const fmpz_poly_t poly, double d) @@ -360,8 +360,8 @@ cdef extern from "flint/fmpz_poly.h": void fmpz_poly_get_nmod_poly(nmod_poly_t Amod, const fmpz_poly_t A) void fmpz_poly_set_nmod_poly(fmpz_poly_t A, const nmod_poly_t Amod) void fmpz_poly_set_nmod_poly_unsigned(fmpz_poly_t A, const nmod_poly_t Amod) - void _fmpz_poly_CRT_ui_precomp(fmpz_struct * res, const fmpz_struct * poly1, slong len1, const fmpz_t m1, nn_srcptr poly2, slong len2, ulong m2, ulong m2inv, fmpz_t m1m2, ulong c, int sign) - void _fmpz_poly_CRT_ui(fmpz_struct * res, const fmpz_struct * poly1, slong len1, const fmpz_t m1, nn_srcptr poly2, slong len2, ulong m2, ulong m2inv, int sign) + void _fmpz_poly_CRT_ui_precomp(fmpz_struct * res, const fmpz_struct * poly1, slong len1, const fmpz_t m1, mp_srcptr poly2, slong len2, mp_limb_t m2, mp_limb_t m2inv, fmpz_t m1m2, mp_limb_t c, int sign) + void _fmpz_poly_CRT_ui(fmpz_struct * res, const fmpz_struct * poly1, slong len1, const fmpz_t m1, mp_srcptr poly2, slong len2, mp_limb_t m2, mp_limb_t m2inv, int sign) void fmpz_poly_CRT_ui(fmpz_poly_t res, const fmpz_poly_t poly1, const fmpz_t m, const nmod_poly_t poly2, int sign) void _fmpz_poly_product_roots_fmpz_vec(fmpz_struct * poly, const fmpz_struct * xs, slong n) void fmpz_poly_product_roots_fmpz_vec(fmpz_poly_t poly, const fmpz_struct * xs, slong n) @@ -373,7 +373,7 @@ cdef extern from "flint/fmpz_poly.h": slong fmpz_poly_num_real_roots_sturm(const fmpz_poly_t pol) slong _fmpz_poly_num_real_roots(const fmpz_struct * pol, slong len) slong fmpz_poly_num_real_roots(const fmpz_poly_t pol) - void _fmpz_poly_cyclotomic(fmpz_struct * a, ulong n, nn_ptr factors, slong num_factors, ulong phi) + void _fmpz_poly_cyclotomic(fmpz_struct * a, ulong n, mp_ptr factors, slong num_factors, ulong phi) void fmpz_poly_cyclotomic(fmpz_poly_t poly, ulong n) ulong _fmpz_poly_is_cyclotomic(const fmpz_struct * poly, slong len) ulong fmpz_poly_is_cyclotomic(const fmpz_poly_t poly) @@ -393,7 +393,7 @@ cdef extern from "flint/fmpz_poly.h": void fmpz_poly_hermite_he(fmpz_poly_t poly, ulong n) void _fmpz_poly_fibonacci(fmpz_struct * coeffs, ulong n) void fmpz_poly_fibonacci(fmpz_poly_t poly, ulong n) - void fmpz_eulerian_polynomial(fmpz_poly_t res, ulong n) + void arith_eulerian_polynomial(fmpz_poly_t res, ulong n) void _fmpz_poly_eta_qexp(fmpz_struct * f, slong r, slong len) void fmpz_poly_eta_qexp(fmpz_poly_t f, slong r, slong n) void _fmpz_poly_theta_qexp(fmpz_struct * f, slong r, slong len) diff --git a/src/flint/flintlib/functions/fmpz_vec.pxd b/src/flint/flintlib/functions/fmpz_vec.pxd index 9ec83eed..314f3c85 100644 --- a/src/flint/flintlib/functions/fmpz_vec.pxd +++ b/src/flint/flintlib/functions/fmpz_vec.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, nmod_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, mp_ptr, mp_size_t, mp_srcptr, nmod_t, slong, ulong # unknown type FILE @@ -11,17 +11,17 @@ cdef extern from "flint/fmpz_vec.h": slong _fmpz_vec_max_bits(const fmpz_struct * vec, slong len) slong _fmpz_vec_max_bits_ref(const fmpz_struct * vec, slong len) void _fmpz_vec_sum_max_bits(slong * sumabs, slong * maxabs, const fmpz_struct * vec, slong len) - slong _fmpz_vec_max_limbs(const fmpz_struct * vec, slong len) + mp_size_t _fmpz_vec_max_limbs(const fmpz_struct * vec, slong len) void _fmpz_vec_height(fmpz_t height, const fmpz_struct * vec, slong len) slong _fmpz_vec_height_index(const fmpz_struct * vec, slong len) # int _fmpz_vec_fread(FILE * file, fmpz_struct ** vec, slong * len) int _fmpz_vec_read(fmpz_struct ** vec, slong * len) # int _fmpz_vec_fprint(FILE * file, const fmpz_struct * vec, slong len) int _fmpz_vec_print(const fmpz_struct * vec, slong len) - void _fmpz_vec_get_nmod_vec(nn_ptr res, const fmpz_struct * poly, slong len, nmod_t mod) - void _fmpz_vec_set_nmod_vec(fmpz_struct * res, nn_srcptr poly, slong len, nmod_t mod) - void _fmpz_vec_get_fft(ulong ** coeffs_f, const fmpz_struct * coeffs_m, slong l, slong length) - void _fmpz_vec_set_fft(fmpz_struct * coeffs_m, slong length, const nn_ptr * coeffs_f, slong limbs, slong sign) + void _fmpz_vec_get_nmod_vec(mp_ptr res, const fmpz_struct * poly, slong len, nmod_t mod) + void _fmpz_vec_set_nmod_vec(fmpz_struct * res, mp_srcptr poly, slong len, nmod_t mod) + void _fmpz_vec_get_fft(mp_limb_t ** coeffs_f, const fmpz_struct * coeffs_m, slong l, slong length) + void _fmpz_vec_set_fft(fmpz_struct * coeffs_m, slong length, const mp_ptr * coeffs_f, slong limbs, slong sign) slong _fmpz_vec_get_d_vec_2exp(double * appv, const fmpz_struct * vec, slong len) void _fmpz_vec_set(fmpz_struct * vec1, const fmpz_struct * vec2, slong len2) void _fmpz_vec_swap(fmpz_struct * vec1, fmpz_struct * vec2, slong len2) diff --git a/src/flint/flintlib/functions/fq_default.pxd b/src/flint/flintlib/functions/fq_default.pxd index 25ae1a79..150ae3d0 100644 --- a/src/flint/flintlib/functions/fq_default.pxd +++ b/src/flint/flintlib/functions/fq_default.pxd @@ -8,12 +8,12 @@ from flint.flintlib.types.nmod cimport nmod_poly_t cdef extern from "flint/fq_default.h": - void fq_default_ctx_init_type(fq_default_ctx_t ctx, const fmpz_t p, slong d, const char * var, int type) void fq_default_ctx_init(fq_default_ctx_t ctx, const fmpz_t p, slong d, const char * var) - void fq_default_ctx_init_modulus_nmod_type(fq_default_ctx_t ctx, const nmod_poly_t modulus, const char * var, int type) - void fq_default_ctx_init_modulus_nmod(fq_default_ctx_t ctx, const nmod_poly_t modulus, const char * var) - void fq_default_ctx_init_modulus_type(fq_default_ctx_t ctx, const fmpz_mod_poly_t modulus, fmpz_mod_ctx_t mod_ctx, const char * var, int type) + void fq_default_ctx_init_type(fq_default_ctx_t ctx, const fmpz_t p, slong d, const char * var, int type) void fq_default_ctx_init_modulus(fq_default_ctx_t ctx, const fmpz_mod_poly_t modulus, fmpz_mod_ctx_t mod_ctx, const char * var) + void fq_default_ctx_init_modulus_type(fq_default_ctx_t ctx, const fmpz_mod_poly_t modulus, fmpz_mod_ctx_t mod_ctx, const char * var, int type) + void fq_default_ctx_init_modulus_nmod(fq_default_ctx_t ctx, const nmod_poly_t modulus, const char * var) + void fq_default_ctx_init_modulus_nmod_type(fq_default_ctx_t ctx, const nmod_poly_t modulus, const char * var, int type) void fq_default_ctx_clear(fq_default_ctx_t ctx) int fq_default_ctx_type(const fq_default_ctx_t ctx) void * fq_default_ctx_inner(const fq_default_ctx_t ctx) diff --git a/src/flint/flintlib/functions/fq_nmod.pxd b/src/flint/flintlib/functions/fq_nmod.pxd index e440eed1..b27b5ff6 100644 --- a/src/flint/flintlib/functions/fq_nmod.pxd +++ b/src/flint/flintlib/functions/fq_nmod.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, mp_ptr, mp_srcptr, slong, ulong from flint.flintlib.types.fq_nmod cimport fq_nmod_ctx_t, fq_nmod_t from flint.flintlib.types.nmod cimport nmod_mat_t, nmod_poly_t @@ -23,9 +23,9 @@ cdef extern from "flint/fq_nmod.h": void fq_nmod_init(fq_nmod_t rop, const fq_nmod_ctx_t ctx) void fq_nmod_init2(fq_nmod_t rop, const fq_nmod_ctx_t ctx) void fq_nmod_clear(fq_nmod_t rop, const fq_nmod_ctx_t ctx) - void _fq_nmod_sparse_reduce(ulong * R, slong lenR, const fq_nmod_ctx_t ctx) - void _fq_nmod_dense_reduce(ulong * R, slong lenR, const fq_nmod_ctx_t ctx) - void _fq_nmod_reduce(ulong * r, slong lenR, const fq_nmod_ctx_t ctx) + void _fq_nmod_sparse_reduce(mp_limb_t * R, slong lenR, const fq_nmod_ctx_t ctx) + void _fq_nmod_dense_reduce(mp_limb_t * R, slong lenR, const fq_nmod_ctx_t ctx) + void _fq_nmod_reduce(mp_limb_t * r, slong lenR, const fq_nmod_ctx_t ctx) void fq_nmod_reduce(fq_nmod_t rop, const fq_nmod_ctx_t ctx) void fq_nmod_add(fq_nmod_t rop, const fq_nmod_t op1, const fq_nmod_t op2, const fq_nmod_ctx_t ctx) void fq_nmod_sub(fq_nmod_t rop, const fq_nmod_t op1, const fq_nmod_t op2, const fq_nmod_ctx_t ctx) @@ -36,10 +36,10 @@ cdef extern from "flint/fq_nmod.h": void fq_nmod_mul_si(fq_nmod_t rop, const fq_nmod_t op, slong x, const fq_nmod_ctx_t ctx) void fq_nmod_mul_ui(fq_nmod_t rop, const fq_nmod_t op, ulong x, const fq_nmod_ctx_t ctx) void fq_nmod_sqr(fq_nmod_t rop, const fq_nmod_t op, const fq_nmod_ctx_t ctx) - void _fq_nmod_inv(nn_ptr * rop, nn_srcptr * op, slong len, const fq_nmod_ctx_t ctx) + void _fq_nmod_inv(mp_ptr * rop, mp_srcptr * op, slong len, const fq_nmod_ctx_t ctx) void fq_nmod_inv(fq_nmod_t rop, const fq_nmod_t op, const fq_nmod_ctx_t ctx) void fq_nmod_gcdinv(fq_nmod_t f, fq_nmod_t inv, const fq_nmod_t op, const fq_nmod_ctx_t ctx) - void _fq_nmod_pow(ulong * rop, const ulong * op, slong len, const fmpz_t e, const fq_nmod_ctx_t ctx) + void _fq_nmod_pow(mp_limb_t * rop, const mp_limb_t * op, slong len, const fmpz_t e, const fq_nmod_ctx_t ctx) void fq_nmod_pow(fq_nmod_t rop, const fq_nmod_t op, const fmpz_t e, const fq_nmod_ctx_t ctx) void fq_nmod_pow_ui(fq_nmod_t rop, const fq_nmod_t op, const ulong e, const fq_nmod_ctx_t ctx) int fq_nmod_sqrt(fq_nmod_t rop, const fq_nmod_t op1, const fq_nmod_ctx_t ctx) @@ -75,11 +75,11 @@ cdef extern from "flint/fq_nmod.h": int fq_nmod_is_invertible(const fq_nmod_t op, const fq_nmod_ctx_t ctx) int fq_nmod_is_invertible_f(fq_nmod_t f, const fq_nmod_t op, const fq_nmod_ctx_t ctx) int fq_nmod_cmp(const fq_nmod_t a, const fq_nmod_t b, const fq_nmod_ctx_t ctx) - void _fq_nmod_trace(fmpz_t rop, const ulong * op, slong len, const fq_nmod_ctx_t ctx) + void _fq_nmod_trace(fmpz_t rop, const mp_limb_t * op, slong len, const fq_nmod_ctx_t ctx) void fq_nmod_trace(fmpz_t rop, const fq_nmod_t op, const fq_nmod_ctx_t ctx) - void _fq_nmod_norm(fmpz_t rop, const ulong * op, slong len, const fq_nmod_ctx_t ctx) + void _fq_nmod_norm(fmpz_t rop, const mp_limb_t * op, slong len, const fq_nmod_ctx_t ctx) void fq_nmod_norm(fmpz_t rop, const fq_nmod_t op, const fq_nmod_ctx_t ctx) - void _fq_nmod_frobenius(ulong * rop, const ulong * op, slong len, slong e, const fq_nmod_ctx_t ctx) + void _fq_nmod_frobenius(mp_limb_t * rop, const mp_limb_t * op, slong len, slong e, const fq_nmod_ctx_t ctx) void fq_nmod_frobenius(fq_nmod_t rop, const fq_nmod_t op, slong e, const fq_nmod_ctx_t ctx) int fq_nmod_multiplicative_order(fmpz_struct * ord, const fq_nmod_t op, const fq_nmod_ctx_t ctx) int fq_nmod_is_primitive(const fq_nmod_t op, const fq_nmod_ctx_t ctx) diff --git a/src/flint/flintlib/functions/fq_nmod_poly.pxd b/src/flint/flintlib/functions/fq_nmod_poly.pxd index 6d8ab10c..fc4a7620 100644 --- a/src/flint/flintlib/functions/fq_nmod_poly.pxd +++ b/src/flint/flintlib/functions/fq_nmod_poly.pxd @@ -4,6 +4,7 @@ from flint.flintlib.types.fq_nmod cimport fq_nmod_ctx_t, fq_nmod_mat_t, fq_nmod_ from flint.flintlib.types.nmod cimport nmod_poly_t # unknown type FILE +# unknown type mp_limb_signed_t cdef extern from "flint/fq_nmod_poly.h": @@ -136,7 +137,7 @@ cdef extern from "flint/fq_nmod_poly.h": void fq_nmod_poly_inv_series_newton(fq_nmod_poly_t Qinv, const fq_nmod_poly_t Q, slong n, const fq_nmod_ctx_t ctx) void _fq_nmod_poly_inv_series(fq_nmod_struct * Qinv, const fq_nmod_struct * Q, slong n, const fq_nmod_t cinv, const fq_nmod_ctx_t ctx) void fq_nmod_poly_inv_series(fq_nmod_poly_t Qinv, const fq_nmod_poly_t Q, slong n, const fq_nmod_ctx_t ctx) - void _fq_nmod_poly_div_series(fq_nmod_struct * Q, const fq_nmod_struct * A, slong Alen, const fq_nmod_struct * B, slong Blen, slong n, const fq_nmod_ctx_t ctx) + # void _fq_nmod_poly_div_series(fq_nmod_struct * Q, const fq_nmod_struct * A, mp_limb_signed_t Alen, const fq_nmod_struct * B, mp_limb_signed_t Blen, mp_limb_signed_t n, const fq_nmod_ctx_t ctx) void fq_nmod_poly_div_series(fq_nmod_poly_t Q, const fq_nmod_poly_t A, const fq_nmod_poly_t B, slong n, fq_nmod_ctx_t ctx) void fq_nmod_poly_gcd(fq_nmod_poly_t rop, const fq_nmod_poly_t op1, const fq_nmod_poly_t op2, const fq_nmod_ctx_t ctx) slong _fq_nmod_poly_gcd(fq_nmod_struct * G, const fq_nmod_struct * A, slong lenA, const fq_nmod_struct * B, slong lenB, const fq_nmod_ctx_t ctx) diff --git a/src/flint/flintlib/functions/fq_zech.pxd b/src/flint/flintlib/functions/fq_zech.pxd index e97a702c..5f88f0d6 100644 --- a/src/flint/flintlib/functions/fq_zech.pxd +++ b/src/flint/flintlib/functions/fq_zech.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, mp_ptr, mp_srcptr, slong, ulong from flint.flintlib.types.fq_nmod cimport fq_nmod_ctx_t, fq_nmod_t from flint.flintlib.types.fq_zech cimport fq_zech_ctx_t, fq_zech_t from flint.flintlib.types.nmod cimport nmod_mat_t, nmod_poly_struct, nmod_poly_t @@ -22,15 +22,15 @@ cdef extern from "flint/fq_zech.h": slong fq_zech_ctx_degree(const fq_zech_ctx_t ctx) ulong fq_zech_ctx_prime(const fq_zech_ctx_t ctx) void fq_zech_ctx_order(fmpz_t f, const fq_zech_ctx_t ctx) - ulong fq_zech_ctx_order_ui(const fq_zech_ctx_t ctx) + mp_limb_t fq_zech_ctx_order_ui(const fq_zech_ctx_t ctx) # int fq_zech_ctx_fprint(FILE * file, const fq_zech_ctx_t ctx) void fq_zech_ctx_print(const fq_zech_ctx_t ctx) void fq_zech_init(fq_zech_t rop, const fq_zech_ctx_t ctx) void fq_zech_init2(fq_zech_t rop, const fq_zech_ctx_t ctx) void fq_zech_clear(fq_zech_t rop, const fq_zech_ctx_t ctx) - void _fq_zech_sparse_reduce(nn_ptr R, slong lenR, const fq_zech_ctx_t ctx) - void _fq_zech_dense_reduce(nn_ptr R, slong lenR, const fq_zech_ctx_t ctx) - void _fq_zech_reduce(nn_ptr r, slong lenR, const fq_zech_ctx_t ctx) + void _fq_zech_sparse_reduce(mp_ptr R, slong lenR, const fq_zech_ctx_t ctx) + void _fq_zech_dense_reduce(mp_ptr R, slong lenR, const fq_zech_ctx_t ctx) + void _fq_zech_reduce(mp_ptr r, slong lenR, const fq_zech_ctx_t ctx) void fq_zech_reduce(fq_zech_t rop, const fq_zech_ctx_t ctx) void fq_zech_add(fq_zech_t rop, const fq_zech_t op1, const fq_zech_t op2, const fq_zech_ctx_t ctx) void fq_zech_sub(fq_zech_t rop, const fq_zech_t op1, const fq_zech_t op2, const fq_zech_ctx_t ctx) @@ -42,7 +42,7 @@ cdef extern from "flint/fq_zech.h": void fq_zech_mul_ui(fq_zech_t rop, const fq_zech_t op, ulong x, const fq_zech_ctx_t ctx) void fq_zech_sqr(fq_zech_t rop, const fq_zech_t op, const fq_zech_ctx_t ctx) void fq_zech_div(fq_zech_t rop, const fq_zech_t op1, const fq_zech_t op2, const fq_zech_ctx_t ctx) - void _fq_zech_inv(nn_ptr * rop, nn_srcptr * op, slong len, const fq_zech_ctx_t ctx) + void _fq_zech_inv(mp_ptr * rop, mp_srcptr * op, slong len, const fq_zech_ctx_t ctx) void fq_zech_inv(fq_zech_t rop, const fq_zech_t op, const fq_zech_ctx_t ctx) void fq_zech_gcdinv(fq_zech_t f, fq_zech_t inv, const fq_zech_t op, const fq_zech_ctx_t ctx) void _fq_zech_pow(fmpz_struct * rop, const fmpz_struct * op, slong len, const fmpz_t e, const fmpz_struct * a, const slong * j, slong lena, const fmpz_t p) diff --git a/src/flint/flintlib/functions/nmod.pxd b/src/flint/flintlib/functions/nmod.pxd index 895507be..0807aade 100644 --- a/src/flint/flintlib/functions/nmod.pxd +++ b/src/flint/flintlib/functions/nmod.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport fmpz_t, nmod_t, ulong +from flint.flintlib.types.flint cimport fmpz_t, mp_limb_t, nmod_t, ulong # unknown type nmod_discrete_log_pohlig_hellman_t @@ -13,21 +13,21 @@ from flint.flintlib.types.flint cimport fmpz_t, nmod_t, ulong # .. macro:: NMOD_ADDMUL(r, a, b, mod) cdef extern from "flint/nmod.h": - void nmod_init(nmod_t * mod, ulong n) - ulong _nmod_add(ulong a, ulong b, nmod_t mod) - ulong nmod_add(ulong a, ulong b, nmod_t mod) - ulong _nmod_sub(ulong a, ulong b, nmod_t mod) - ulong nmod_sub(ulong a, ulong b, nmod_t mod) - ulong nmod_neg(ulong a, nmod_t mod) - ulong nmod_mul(ulong a, ulong b, nmod_t mod) - ulong _nmod_mul_fullword(ulong a, ulong b, nmod_t mod) - ulong nmod_inv(ulong a, nmod_t mod) - ulong nmod_div(ulong a, ulong b, nmod_t mod) - int nmod_divides(ulong * a, ulong b, ulong c, nmod_t mod) - ulong nmod_pow_ui(ulong a, ulong e, nmod_t mod) - ulong nmod_pow_fmpz(ulong a, const fmpz_t e, nmod_t mod) + void nmod_init(nmod_t * mod, mp_limb_t n) + mp_limb_t _nmod_add(mp_limb_t a, mp_limb_t b, nmod_t mod) + mp_limb_t nmod_add(mp_limb_t a, mp_limb_t b, nmod_t mod) + mp_limb_t _nmod_sub(mp_limb_t a, mp_limb_t b, nmod_t mod) + mp_limb_t nmod_sub(mp_limb_t a, mp_limb_t b, nmod_t mod) + mp_limb_t nmod_neg(mp_limb_t a, nmod_t mod) + mp_limb_t nmod_mul(mp_limb_t a, mp_limb_t b, nmod_t mod) + mp_limb_t _nmod_mul_fullword(mp_limb_t a, mp_limb_t b, nmod_t mod) + mp_limb_t nmod_inv(mp_limb_t a, nmod_t mod) + mp_limb_t nmod_div(mp_limb_t a, mp_limb_t b, nmod_t mod) + int nmod_divides(mp_limb_t * a, mp_limb_t b, mp_limb_t c, nmod_t mod) + mp_limb_t nmod_pow_ui(mp_limb_t a, ulong e, nmod_t mod) + mp_limb_t nmod_pow_fmpz(mp_limb_t a, const fmpz_t e, nmod_t mod) # void nmod_discrete_log_pohlig_hellman_init(nmod_discrete_log_pohlig_hellman_t L) # void nmod_discrete_log_pohlig_hellman_clear(nmod_discrete_log_pohlig_hellman_t L) - # double nmod_discrete_log_pohlig_hellman_precompute_prime(nmod_discrete_log_pohlig_hellman_t L, ulong p) - # ulong nmod_discrete_log_pohlig_hellman_primitive_root(const nmod_discrete_log_pohlig_hellman_t L) - # ulong nmod_discrete_log_pohlig_hellman_run(const nmod_discrete_log_pohlig_hellman_t L, ulong y) + # double nmod_discrete_log_pohlig_hellman_precompute_prime(nmod_discrete_log_pohlig_hellman_t L, mp_limb_t p) + # mp_limb_t nmod_discrete_log_pohlig_hellman_primitive_root(const nmod_discrete_log_pohlig_hellman_t L) + # ulong nmod_discrete_log_pohlig_hellman_run(const nmod_discrete_log_pohlig_hellman_t L, mp_limb_t y) diff --git a/src/flint/flintlib/functions/nmod_mat.pxd b/src/flint/flintlib/functions/nmod_mat.pxd index 25033c9b..0f099ab3 100644 --- a/src/flint/flintlib/functions/nmod_mat.pxd +++ b/src/flint/flintlib/functions/nmod_mat.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, mp_limb_t, mp_ptr, mp_srcptr, slong, ulong from flint.flintlib.types.nmod cimport nmod_mat_t, nmod_poly_t # unknown type FILE @@ -7,15 +7,15 @@ from flint.flintlib.types.nmod cimport nmod_mat_t, nmod_poly_t # .. macro:: nmod_mat_entry(mat, i, j) cdef extern from "flint/nmod_mat.h": - void nmod_mat_init(nmod_mat_t mat, slong rows, slong cols, ulong n) + void nmod_mat_init(nmod_mat_t mat, slong rows, slong cols, mp_limb_t n) void nmod_mat_init_set(nmod_mat_t mat, const nmod_mat_t src) void nmod_mat_clear(nmod_mat_t mat) void nmod_mat_set(nmod_mat_t mat, const nmod_mat_t src) void nmod_mat_swap(nmod_mat_t mat1, nmod_mat_t mat2) void nmod_mat_swap_entrywise(nmod_mat_t mat1, nmod_mat_t mat2) - ulong nmod_mat_get_entry(const nmod_mat_t mat, slong i, slong j) - ulong * nmod_mat_entry_ptr(const nmod_mat_t mat, slong i, slong j) - void nmod_mat_set_entry(nmod_mat_t mat, slong i, slong j, ulong x) + mp_limb_t nmod_mat_get_entry(const nmod_mat_t mat, slong i, slong j) + mp_limb_t * nmod_mat_entry_ptr(const nmod_mat_t mat, slong i, slong j) + void nmod_mat_set_entry(nmod_mat_t mat, slong i, slong j, mp_limb_t x) slong nmod_mat_nrows(const nmod_mat_t mat) slong nmod_mat_ncols(const nmod_mat_t mat) void nmod_mat_zero(nmod_mat_t mat) @@ -30,7 +30,7 @@ cdef extern from "flint/nmod_mat.h": # int nmod_mat_fprint(FILE * f, const nmod_mat_t mat) void nmod_mat_randtest(nmod_mat_t mat, flint_rand_t state) void nmod_mat_randfull(nmod_mat_t mat, flint_rand_t state) - int nmod_mat_randpermdiag(nmod_mat_t mat, flint_rand_t state, nn_srcptr diag, slong n) + int nmod_mat_randpermdiag(nmod_mat_t mat, flint_rand_t state, mp_srcptr diag, slong n) void nmod_mat_randrank(nmod_mat_t mat, flint_rand_t state, slong rank) void nmod_mat_randops(nmod_mat_t mat, flint_rand_t state, slong count) void nmod_mat_randtril(nmod_mat_t mat, flint_rand_t state, int unit) @@ -46,8 +46,8 @@ cdef extern from "flint/nmod_mat.h": void nmod_mat_add(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) void nmod_mat_sub(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) void nmod_mat_neg(nmod_mat_t A, const nmod_mat_t B) - void nmod_mat_scalar_mul(nmod_mat_t B, const nmod_mat_t A, ulong c) - void nmod_mat_scalar_addmul_ui(nmod_mat_t dest, const nmod_mat_t X, const nmod_mat_t Y, const ulong b) + void nmod_mat_scalar_mul(nmod_mat_t B, const nmod_mat_t A, mp_limb_t c) + void nmod_mat_scalar_addmul_ui(nmod_mat_t dest, const nmod_mat_t X, const nmod_mat_t Y, const mp_limb_t b) void nmod_mat_scalar_mul_fmpz(nmod_mat_t res, const nmod_mat_t M, const fmpz_t c) void nmod_mat_mul(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) void _nmod_mat_mul_classical_op(nmod_mat_t D, const nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B, int op) @@ -59,15 +59,15 @@ cdef extern from "flint/nmod_mat.h": int nmod_mat_mul_blas(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) void nmod_mat_addmul(nmod_mat_t D, const nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) void nmod_mat_submul(nmod_mat_t D, const nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) - void nmod_mat_mul_nmod_vec(ulong * c, const nmod_mat_t A, const ulong * b, slong blen) - void nmod_mat_mul_nmod_vec_ptr(ulong * const * c, const nmod_mat_t A, const ulong * const * b, slong blen) - void nmod_mat_nmod_vec_mul(ulong * c, const ulong * a, slong alen, const nmod_mat_t B) - void nmod_mat_nmod_vec_mul_ptr(ulong * const * c, const ulong * const * a, slong alen, const nmod_mat_t B) + void nmod_mat_mul_nmod_vec(mp_limb_t * c, const nmod_mat_t A, const mp_limb_t * b, slong blen) + void nmod_mat_mul_nmod_vec_ptr(mp_limb_t * const * c, const nmod_mat_t A, const mp_limb_t * const * b, slong blen) + void nmod_mat_nmod_vec_mul(mp_limb_t * c, const mp_limb_t * a, slong alen, const nmod_mat_t B) + void nmod_mat_nmod_vec_mul_ptr(mp_limb_t * const * c, const mp_limb_t * const * a, slong alen, const nmod_mat_t B) void _nmod_mat_pow(nmod_mat_t dest, const nmod_mat_t mat, ulong pow) void nmod_mat_pow(nmod_mat_t dest, const nmod_mat_t mat, ulong pow) - ulong nmod_mat_trace(const nmod_mat_t mat) - ulong nmod_mat_det_howell(const nmod_mat_t A) - ulong nmod_mat_det(const nmod_mat_t A) + mp_limb_t nmod_mat_trace(const nmod_mat_t mat) + mp_limb_t nmod_mat_det_howell(const nmod_mat_t A) + mp_limb_t nmod_mat_det(const nmod_mat_t A) slong nmod_mat_rank(const nmod_mat_t A) int nmod_mat_inv(nmod_mat_t B, const nmod_mat_t A) void nmod_mat_solve_tril(nmod_mat_t X, const nmod_mat_t L, const nmod_mat_t B, int unit) @@ -79,7 +79,7 @@ cdef extern from "flint/nmod_mat.h": int nmod_mat_solve(nmod_mat_t X, const nmod_mat_t A, const nmod_mat_t B) int nmod_mat_can_solve_inner(slong * rank, slong * perm, slong * pivots, nmod_mat_t X, const nmod_mat_t A, const nmod_mat_t B) int nmod_mat_can_solve(nmod_mat_t X, const nmod_mat_t A, const nmod_mat_t B) - int nmod_mat_solve_vec(nn_ptr x, const nmod_mat_t A, nn_srcptr b) + int nmod_mat_solve_vec(mp_ptr x, const nmod_mat_t A, mp_srcptr b) slong nmod_mat_lu(slong * P, nmod_mat_t A, int rank_check) slong nmod_mat_lu_classical(slong * P, nmod_mat_t A, int rank_check) slong nmod_mat_lu_classical_delayed(slong * P, nmod_mat_t A, int rank_check) diff --git a/src/flint/flintlib/functions/nmod_mpoly.pxd b/src/flint/flintlib/functions/nmod_mpoly.pxd index 973a1cfe..7261493e 100644 --- a/src/flint/flintlib/functions/nmod_mpoly.pxd +++ b/src/flint/flintlib/functions/nmod_mpoly.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_struct, fmpz_t, mp_limb_t, slong, ulong from flint.flintlib.types.mpoly cimport ordering_t from flint.flintlib.types.nmod cimport nmod_mpoly_ctx_t, nmod_mpoly_struct, nmod_mpoly_t, nmod_mpoly_univar_t, nmod_poly_struct, nmod_poly_t @@ -6,10 +6,10 @@ from flint.flintlib.types.nmod cimport nmod_mpoly_ctx_t, nmod_mpoly_struct, nmod cdef extern from "flint/nmod_mpoly.h": - void nmod_mpoly_ctx_init(nmod_mpoly_ctx_t ctx, slong nvars, const ordering_t ord, ulong n) + void nmod_mpoly_ctx_init(nmod_mpoly_ctx_t ctx, slong nvars, const ordering_t ord, mp_limb_t n) slong nmod_mpoly_ctx_nvars(const nmod_mpoly_ctx_t ctx) ordering_t nmod_mpoly_ctx_ord(const nmod_mpoly_ctx_t ctx) - ulong nmod_mpoly_ctx_modulus(const nmod_mpoly_ctx_t ctx) + mp_limb_t nmod_mpoly_ctx_modulus(const nmod_mpoly_ctx_t ctx) void nmod_mpoly_ctx_clear(nmod_mpoly_ctx_t ctx) void nmod_mpoly_init(nmod_mpoly_t A, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_init2(nmod_mpoly_t A, slong alloc, const nmod_mpoly_ctx_t ctx) @@ -51,7 +51,7 @@ cdef extern from "flint/nmod_mpoly.h": void nmod_mpoly_set_coeff_ui_ui(nmod_mpoly_t A, ulong c, const ulong * exp, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_get_coeff_vars_ui(nmod_mpoly_t C, const nmod_mpoly_t A, const slong * vars, const ulong * exps, slong length, const nmod_mpoly_ctx_t ctx) int nmod_mpoly_cmp(const nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_ctx_t ctx) - ulong * nmod_mpoly_term_coeff_ref(nmod_mpoly_t A, slong i, const nmod_mpoly_ctx_t ctx) + mp_limb_t * nmod_mpoly_term_coeff_ref(nmod_mpoly_t A, slong i, const nmod_mpoly_ctx_t ctx) int nmod_mpoly_is_canonical(const nmod_mpoly_t A, const nmod_mpoly_ctx_t ctx) slong nmod_mpoly_length(const nmod_mpoly_t A, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_resize(nmod_mpoly_t A, slong new_length, const nmod_mpoly_ctx_t ctx) @@ -76,7 +76,7 @@ cdef extern from "flint/nmod_mpoly.h": void nmod_mpoly_reverse(nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_randtest_bound(nmod_mpoly_t A, flint_rand_t state, slong length, ulong exp_bound, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_randtest_bounds(nmod_mpoly_t A, flint_rand_t state, slong length, ulong * exp_bounds, const nmod_mpoly_ctx_t ctx) - void nmod_mpoly_randtest_bits(nmod_mpoly_t A, flint_rand_t state, slong length, ulong exp_bits, const nmod_mpoly_ctx_t ctx) + void nmod_mpoly_randtest_bits(nmod_mpoly_t A, flint_rand_t state, slong length, mp_limb_t exp_bits, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_add_ui(nmod_mpoly_t A, const nmod_mpoly_t B, ulong c, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_sub_ui(nmod_mpoly_t A, const nmod_mpoly_t B, ulong c, const nmod_mpoly_ctx_t ctx) void nmod_mpoly_add(nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_t C, const nmod_mpoly_ctx_t ctx) diff --git a/src/flint/flintlib/functions/nmod_poly.pxd b/src/flint/flintlib/functions/nmod_poly.pxd index 67f652c7..f22efaff 100644 --- a/src/flint/flintlib/functions/nmod_poly.pxd +++ b/src/flint/flintlib/functions/nmod_poly.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_t, nmod_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, fmpz_t, mp_limb_t, mp_ptr, mp_srcptr, nmod_t, slong, ulong from flint.flintlib.types.nmod cimport nmod_mat_t, nmod_poly_struct, nmod_poly_t # unknown type FILE @@ -8,18 +8,19 @@ from flint.flintlib.types.nmod cimport nmod_mat_t, nmod_poly_struct, nmod_poly_t cdef extern from "flint/nmod_poly.h": - void nmod_poly_init(nmod_poly_t poly, ulong n) - void nmod_poly_init_preinv(nmod_poly_t poly, ulong n, ulong ninv) + int signed_mpn_sub_n(mp_ptr res, mp_srcptr op1, mp_srcptr op2, slong n) + void nmod_poly_init(nmod_poly_t poly, mp_limb_t n) + void nmod_poly_init_preinv(nmod_poly_t poly, mp_limb_t n, mp_limb_t ninv) void nmod_poly_init_mod(nmod_poly_t poly, const nmod_t mod) - void nmod_poly_init2(nmod_poly_t poly, ulong n, slong alloc) - void nmod_poly_init2_preinv(nmod_poly_t poly, ulong n, ulong ninv, slong alloc) + void nmod_poly_init2(nmod_poly_t poly, mp_limb_t n, slong alloc) + void nmod_poly_init2_preinv(nmod_poly_t poly, mp_limb_t n, mp_limb_t ninv, slong alloc) void nmod_poly_realloc(nmod_poly_t poly, slong alloc) void nmod_poly_clear(nmod_poly_t poly) void nmod_poly_fit_length(nmod_poly_t poly, slong alloc) void _nmod_poly_normalise(nmod_poly_t poly) slong nmod_poly_length(const nmod_poly_t poly) slong nmod_poly_degree(const nmod_poly_t poly) - ulong nmod_poly_modulus(const nmod_poly_t poly) + mp_limb_t nmod_poly_modulus(const nmod_poly_t poly) flint_bitcnt_t nmod_poly_max_bits(const nmod_poly_t poly) int nmod_poly_is_unit(const nmod_poly_t poly) int nmod_poly_is_monic(const nmod_poly_t poly) @@ -28,7 +29,7 @@ cdef extern from "flint/nmod_poly.h": void nmod_poly_zero(nmod_poly_t res) void nmod_poly_truncate(nmod_poly_t poly, slong len) void nmod_poly_set_trunc(nmod_poly_t res, const nmod_poly_t poly, slong len) - void _nmod_poly_reverse(nn_ptr output, nn_srcptr input, slong len, slong m) + void _nmod_poly_reverse(mp_ptr output, mp_srcptr input, slong len, slong m) void nmod_poly_reverse(nmod_poly_t output, const nmod_poly_t input, slong m) void nmod_poly_randtest(nmod_poly_t poly, flint_rand_t state, slong len) void nmod_poly_randtest_irreducible(nmod_poly_t poly, flint_rand_t state, slong len) @@ -58,259 +59,259 @@ cdef extern from "flint/nmod_poly.h": int nmod_poly_is_zero(const nmod_poly_t poly) int nmod_poly_is_one(const nmod_poly_t poly) int nmod_poly_is_gen(const nmod_poly_t poly) - void _nmod_poly_shift_left(nn_ptr res, nn_srcptr poly, slong len, slong k) + void _nmod_poly_shift_left(mp_ptr res, mp_srcptr poly, slong len, slong k) void nmod_poly_shift_left(nmod_poly_t res, const nmod_poly_t poly, slong k) - void _nmod_poly_shift_right(nn_ptr res, nn_srcptr poly, slong len, slong k) + void _nmod_poly_shift_right(mp_ptr res, mp_srcptr poly, slong len, slong k) void nmod_poly_shift_right(nmod_poly_t res, const nmod_poly_t poly, slong k) - void _nmod_poly_add(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) + void _nmod_poly_add(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) void nmod_poly_add(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) void nmod_poly_add_series(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong n) - void _nmod_poly_sub(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) + void _nmod_poly_sub(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) void nmod_poly_sub(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) void nmod_poly_sub_series(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong n) void nmod_poly_neg(nmod_poly_t res, const nmod_poly_t poly) void nmod_poly_scalar_mul_nmod(nmod_poly_t res, const nmod_poly_t poly, ulong c) void nmod_poly_scalar_addmul_nmod(nmod_poly_t res, const nmod_poly_t poly, ulong c) - void _nmod_poly_make_monic(nn_ptr output, nn_srcptr input, slong len, nmod_t mod) + void _nmod_poly_make_monic(mp_ptr output, mp_srcptr input, slong len, nmod_t mod) void nmod_poly_make_monic(nmod_poly_t output, const nmod_poly_t input) - void _nmod_poly_bit_pack(nn_ptr res, nn_srcptr poly, slong len, flint_bitcnt_t bits) - void _nmod_poly_bit_unpack(nn_ptr res, slong len, nn_srcptr mpn, ulong bits, nmod_t mod) + void _nmod_poly_bit_pack(mp_ptr res, mp_srcptr poly, slong len, flint_bitcnt_t bits) + void _nmod_poly_bit_unpack(mp_ptr res, slong len, mp_srcptr mpn, ulong bits, nmod_t mod) void nmod_poly_bit_pack(fmpz_t f, const nmod_poly_t poly, flint_bitcnt_t bit_size) void nmod_poly_bit_unpack(nmod_poly_t poly, const fmpz_t f, flint_bitcnt_t bit_size) - void _nmod_poly_KS2_pack1(nn_ptr res, nn_srcptr op, slong n, slong s, ulong b, ulong k, slong r) - void _nmod_poly_KS2_pack(nn_ptr res, nn_srcptr op, slong n, slong s, ulong b, ulong k, slong r) - void _nmod_poly_KS2_unpack1(nn_ptr res, nn_srcptr op, slong n, ulong b, ulong k) - void _nmod_poly_KS2_unpack2(nn_ptr res, nn_srcptr op, slong n, ulong b, ulong k) - void _nmod_poly_KS2_unpack3(nn_ptr res, nn_srcptr op, slong n, ulong b, ulong k) - void _nmod_poly_KS2_unpack(nn_ptr res, nn_srcptr op, slong n, ulong b, ulong k) - void _nmod_poly_KS2_reduce(nn_ptr res, slong s, nn_srcptr op, slong n, ulong w, nmod_t mod) - void _nmod_poly_KS2_recover_reduce1(nn_ptr res, slong s, nn_srcptr op1, nn_srcptr op2, slong n, ulong b, nmod_t mod) - void _nmod_poly_KS2_recover_reduce2(nn_ptr res, slong s, nn_srcptr op1, nn_srcptr op2, slong n, ulong b, nmod_t mod) - void _nmod_poly_KS2_recover_reduce2b(nn_ptr res, slong s, nn_srcptr op1, nn_srcptr op2, slong n, ulong b, nmod_t mod) - void _nmod_poly_KS2_recover_reduce3(nn_ptr res, slong s, nn_srcptr op1, nn_srcptr op2, slong n, ulong b, nmod_t mod) - void _nmod_poly_KS2_recover_reduce(nn_ptr res, slong s, nn_srcptr op1, nn_srcptr op2, slong n, ulong b, nmod_t mod) - void _nmod_poly_mul_classical(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) + void _nmod_poly_KS2_pack1(mp_ptr res, mp_srcptr op, slong n, slong s, ulong b, ulong k, slong r) + void _nmod_poly_KS2_pack(mp_ptr res, mp_srcptr op, slong n, slong s, ulong b, ulong k, slong r) + void _nmod_poly_KS2_unpack1(mp_ptr res, mp_srcptr op, slong n, ulong b, ulong k) + void _nmod_poly_KS2_unpack2(mp_ptr res, mp_srcptr op, slong n, ulong b, ulong k) + void _nmod_poly_KS2_unpack3(mp_ptr res, mp_srcptr op, slong n, ulong b, ulong k) + void _nmod_poly_KS2_unpack(mp_ptr res, mp_srcptr op, slong n, ulong b, ulong k) + void _nmod_poly_KS2_reduce(mp_ptr res, slong s, mp_srcptr op, slong n, ulong w, nmod_t mod) + void _nmod_poly_KS2_recover_reduce1(mp_ptr res, slong s, mp_srcptr op1, mp_srcptr op2, slong n, ulong b, nmod_t mod) + void _nmod_poly_KS2_recover_reduce2(mp_ptr res, slong s, mp_srcptr op1, mp_srcptr op2, slong n, ulong b, nmod_t mod) + void _nmod_poly_KS2_recover_reduce2b(mp_ptr res, slong s, mp_srcptr op1, mp_srcptr op2, slong n, ulong b, nmod_t mod) + void _nmod_poly_KS2_recover_reduce3(mp_ptr res, slong s, mp_srcptr op1, mp_srcptr op2, slong n, ulong b, nmod_t mod) + void _nmod_poly_KS2_recover_reduce(mp_ptr res, slong s, mp_srcptr op1, mp_srcptr op2, slong n, ulong b, nmod_t mod) + void _nmod_poly_mul_classical(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) void nmod_poly_mul_classical(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) - void _nmod_poly_mullow_classical(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong trunc, nmod_t mod) + void _nmod_poly_mullow_classical(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, slong trunc, nmod_t mod) void nmod_poly_mullow_classical(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong trunc) - void _nmod_poly_mulhigh_classical(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong start, nmod_t mod) + void _nmod_poly_mulhigh_classical(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, slong start, nmod_t mod) void nmod_poly_mulhigh_classical(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong start) - void _nmod_poly_mul_KS(nn_ptr out, nn_srcptr in1, slong len1, nn_srcptr in2, slong len2, flint_bitcnt_t bits, nmod_t mod) + void _nmod_poly_mul_KS(mp_ptr out, mp_srcptr in1, slong len1, mp_srcptr in2, slong len2, flint_bitcnt_t bits, nmod_t mod) void nmod_poly_mul_KS(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, flint_bitcnt_t bits) - void _nmod_poly_mul_KS2(nn_ptr res, nn_srcptr op1, slong n1, nn_srcptr op2, slong n2, nmod_t mod) + void _nmod_poly_mul_KS2(mp_ptr res, mp_srcptr op1, slong n1, mp_srcptr op2, slong n2, nmod_t mod) void nmod_poly_mul_KS2(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) - void _nmod_poly_mul_KS4(nn_ptr res, nn_srcptr op1, slong n1, nn_srcptr op2, slong n2, nmod_t mod) + void _nmod_poly_mul_KS4(mp_ptr res, mp_srcptr op1, slong n1, mp_srcptr op2, slong n2, nmod_t mod) void nmod_poly_mul_KS4(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) - void _nmod_poly_mullow_KS(nn_ptr out, nn_srcptr in1, slong len1, nn_srcptr in2, slong len2, flint_bitcnt_t bits, slong n, nmod_t mod) + void _nmod_poly_mullow_KS(mp_ptr out, mp_srcptr in1, slong len1, mp_srcptr in2, slong len2, flint_bitcnt_t bits, slong n, nmod_t mod) void nmod_poly_mullow_KS(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, flint_bitcnt_t bits, slong n) - void _nmod_poly_mul(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) + void _nmod_poly_mul(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) void nmod_poly_mul(nmod_poly_t res, const nmod_poly_t poly, const nmod_poly_t poly2) - void _nmod_poly_mullow(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong n, nmod_t mod) + void _nmod_poly_mullow(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, slong n, nmod_t mod) void nmod_poly_mullow(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong trunc) - void _nmod_poly_mulhigh(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong n, nmod_t mod) + void _nmod_poly_mulhigh(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, slong n, nmod_t mod) void nmod_poly_mulhigh(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong n) - void _nmod_poly_mulmod(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nn_srcptr f, slong lenf, nmod_t mod) + void _nmod_poly_mulmod(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, mp_srcptr f, slong lenf, nmod_t mod) void nmod_poly_mulmod(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, const nmod_poly_t f) - void _nmod_poly_mulmod_preinv(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nn_srcptr f, slong lenf, nn_srcptr finv, slong lenfinv, nmod_t mod) + void _nmod_poly_mulmod_preinv(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, mp_srcptr f, slong lenf, mp_srcptr finv, slong lenfinv, nmod_t mod) void nmod_poly_mulmod_preinv(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, const nmod_poly_t f, const nmod_poly_t finv) - void _nmod_poly_pow_binexp(nn_ptr res, nn_srcptr poly, slong len, ulong e, nmod_t mod) + void _nmod_poly_pow_binexp(mp_ptr res, mp_srcptr poly, slong len, ulong e, nmod_t mod) void nmod_poly_pow_binexp(nmod_poly_t res, const nmod_poly_t poly, ulong e) - void _nmod_poly_pow(nn_ptr res, nn_srcptr poly, slong len, ulong e, nmod_t mod) + void _nmod_poly_pow(mp_ptr res, mp_srcptr poly, slong len, ulong e, nmod_t mod) void nmod_poly_pow(nmod_poly_t res, const nmod_poly_t poly, ulong e) - void _nmod_poly_pow_trunc_binexp(nn_ptr res, nn_srcptr poly, ulong e, slong trunc, nmod_t mod) + void _nmod_poly_pow_trunc_binexp(mp_ptr res, mp_srcptr poly, ulong e, slong trunc, nmod_t mod) void nmod_poly_pow_trunc_binexp(nmod_poly_t res, const nmod_poly_t poly, ulong e, slong trunc) - void _nmod_poly_pow_trunc(nn_ptr res, nn_srcptr poly, ulong e, slong trunc, nmod_t mod) + void _nmod_poly_pow_trunc(mp_ptr res, mp_srcptr poly, ulong e, slong trunc, nmod_t mod) void nmod_poly_pow_trunc(nmod_poly_t res, const nmod_poly_t poly, ulong e, slong trunc) - void _nmod_poly_powmod_ui_binexp(nn_ptr res, nn_srcptr poly, ulong e, nn_srcptr f, slong lenf, nmod_t mod) + void _nmod_poly_powmod_ui_binexp(mp_ptr res, mp_srcptr poly, ulong e, mp_srcptr f, slong lenf, nmod_t mod) void nmod_poly_powmod_ui_binexp(nmod_poly_t res, const nmod_poly_t poly, ulong e, const nmod_poly_t f) - void _nmod_poly_powmod_fmpz_binexp(nn_ptr res, nn_srcptr poly, fmpz_t e, nn_srcptr f, slong lenf, nmod_t mod) + void _nmod_poly_powmod_fmpz_binexp(mp_ptr res, mp_srcptr poly, fmpz_t e, mp_srcptr f, slong lenf, nmod_t mod) void nmod_poly_powmod_fmpz_binexp(nmod_poly_t res, const nmod_poly_t poly, fmpz_t e, const nmod_poly_t f) - void _nmod_poly_powmod_ui_binexp_preinv (nn_ptr res, nn_srcptr poly, ulong e, nn_srcptr f, slong lenf, nn_srcptr finv, slong lenfinv, nmod_t mod) + void _nmod_poly_powmod_ui_binexp_preinv (mp_ptr res, mp_srcptr poly, ulong e, mp_srcptr f, slong lenf, mp_srcptr finv, slong lenfinv, nmod_t mod) void nmod_poly_powmod_ui_binexp_preinv(nmod_poly_t res, const nmod_poly_t poly, ulong e, const nmod_poly_t f, const nmod_poly_t finv) - void _nmod_poly_powmod_fmpz_binexp_preinv (nn_ptr res, nn_srcptr poly, fmpz_t e, nn_srcptr f, slong lenf, nn_srcptr finv, slong lenfinv, nmod_t mod) + void _nmod_poly_powmod_fmpz_binexp_preinv (mp_ptr res, mp_srcptr poly, fmpz_t e, mp_srcptr f, slong lenf, mp_srcptr finv, slong lenfinv, nmod_t mod) void nmod_poly_powmod_fmpz_binexp_preinv(nmod_poly_t res, const nmod_poly_t poly, fmpz_t e, const nmod_poly_t f, const nmod_poly_t finv) - void _nmod_poly_powmod_x_ui_preinv (nn_ptr res, ulong e, nn_srcptr f, slong lenf, nn_srcptr finv, slong lenfinv, nmod_t mod) + void _nmod_poly_powmod_x_ui_preinv (mp_ptr res, ulong e, mp_srcptr f, slong lenf, mp_srcptr finv, slong lenfinv, nmod_t mod) void nmod_poly_powmod_x_ui_preinv(nmod_poly_t res, ulong e, const nmod_poly_t f, const nmod_poly_t finv) - void _nmod_poly_powmod_x_fmpz_preinv (nn_ptr res, fmpz_t e, nn_srcptr f, slong lenf, nn_srcptr finv, slong lenfinv, nmod_t mod) + void _nmod_poly_powmod_x_fmpz_preinv (mp_ptr res, fmpz_t e, mp_srcptr f, slong lenf, mp_srcptr finv, slong lenfinv, nmod_t mod) void nmod_poly_powmod_x_fmpz_preinv(nmod_poly_t res, fmpz_t e, const nmod_poly_t f, const nmod_poly_t finv) - void _nmod_poly_powers_mod_preinv_naive(nn_ptr * res, nn_srcptr f, slong flen, slong n, nn_srcptr g, slong glen, nn_srcptr ginv, slong ginvlen, const nmod_t mod) + void _nmod_poly_powers_mod_preinv_naive(mp_ptr * res, mp_srcptr f, slong flen, slong n, mp_srcptr g, slong glen, mp_srcptr ginv, slong ginvlen, const nmod_t mod) void nmod_poly_powers_mod_naive(nmod_poly_struct * res, const nmod_poly_t f, slong n, const nmod_poly_t g) - # void _nmod_poly_powers_mod_preinv_threaded_pool(nn_ptr * res, nn_srcptr f, slong flen, slong n, nn_srcptr g, slong glen, nn_srcptr ginv, slong ginvlen, const nmod_t mod, thread_pool_handle * threads, slong num_threads) - void _nmod_poly_powers_mod_preinv_threaded(nn_ptr * res, nn_srcptr f, slong flen, slong n, nn_srcptr g, slong glen, nn_srcptr ginv, slong ginvlen, const nmod_t mod) + # void _nmod_poly_powers_mod_preinv_threaded_pool(mp_ptr * res, mp_srcptr f, slong flen, slong n, mp_srcptr g, slong glen, mp_srcptr ginv, slong ginvlen, const nmod_t mod, thread_pool_handle * threads, slong num_threads) + void _nmod_poly_powers_mod_preinv_threaded(mp_ptr * res, mp_srcptr f, slong flen, slong n, mp_srcptr g, slong glen, mp_srcptr ginv, slong ginvlen, const nmod_t mod) void nmod_poly_powers_mod_bsgs(nmod_poly_struct * res, const nmod_poly_t f, slong n, const nmod_poly_t g) - void _nmod_poly_divrem_basecase(nn_ptr Q, nn_ptr R, nn_srcptr A, slong A_len, nn_srcptr B, slong B_len, nmod_t mod) + void _nmod_poly_divrem_basecase(mp_ptr Q, mp_ptr R, mp_srcptr A, slong A_len, mp_srcptr B, slong B_len, nmod_t mod) void nmod_poly_divrem_basecase(nmod_poly_t Q, nmod_poly_t R, const nmod_poly_t A, const nmod_poly_t B) - void _nmod_poly_divrem(nn_ptr Q, nn_ptr R, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + void _nmod_poly_divrem(mp_ptr Q, mp_ptr R, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_divrem(nmod_poly_t Q, nmod_poly_t R, const nmod_poly_t A, const nmod_poly_t B) - void _nmod_poly_div(nn_ptr Q, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + void _nmod_poly_div(mp_ptr Q, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_div(nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B) - void _nmod_poly_rem_q1(nn_ptr R, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) - void _nmod_poly_rem(nn_ptr R, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + void _nmod_poly_rem_q1(mp_ptr R, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) + void _nmod_poly_rem(mp_ptr R, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_rem(nmod_poly_t R, const nmod_poly_t A, const nmod_poly_t B) - void _nmod_poly_divexact(nn_ptr Q, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + void _nmod_poly_divexact(mp_ptr Q, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_divexact(nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B) - void _nmod_poly_inv_series_basecase(nn_ptr Qinv, nn_srcptr Q, slong Qlen, slong n, nmod_t mod) + void _nmod_poly_inv_series_basecase(mp_ptr Qinv, mp_srcptr Q, slong Qlen, slong n, nmod_t mod) void nmod_poly_inv_series_basecase(nmod_poly_t Qinv, const nmod_poly_t Q, slong n) - void _nmod_poly_inv_series_newton(nn_ptr Qinv, nn_srcptr Q, slong Qlen, slong n, nmod_t mod) + void _nmod_poly_inv_series_newton(mp_ptr Qinv, mp_srcptr Q, slong Qlen, slong n, nmod_t mod) void nmod_poly_inv_series_newton(nmod_poly_t Qinv, const nmod_poly_t Q, slong n) - void _nmod_poly_inv_series(nn_ptr Qinv, nn_srcptr Q, slong Qlen, slong n, nmod_t mod) + void _nmod_poly_inv_series(mp_ptr Qinv, mp_srcptr Q, slong Qlen, slong n, nmod_t mod) void nmod_poly_inv_series(nmod_poly_t Qinv, const nmod_poly_t Q, slong n) - void _nmod_poly_div_series_basecase(nn_ptr Q, nn_srcptr A, slong Alen, nn_srcptr B, slong Blen, slong n, nmod_t mod) + void _nmod_poly_div_series_basecase(mp_ptr Q, mp_srcptr A, slong Alen, mp_srcptr B, slong Blen, slong n, nmod_t mod) void nmod_poly_div_series_basecase(nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B, slong n) - void _nmod_poly_div_series(nn_ptr Q, nn_srcptr A, slong Alen, nn_srcptr B, slong Blen, slong n, nmod_t mod) + void _nmod_poly_div_series(mp_ptr Q, mp_srcptr A, slong Alen, mp_srcptr B, slong Blen, slong n, nmod_t mod) void nmod_poly_div_series(nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B, slong n) - void _nmod_poly_div_newton_n_preinv (nn_ptr Q, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nn_srcptr Binv, slong lenBinv, nmod_t mod) + void _nmod_poly_div_newton_n_preinv (mp_ptr Q, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, mp_srcptr Binv, slong lenBinv, nmod_t mod) void nmod_poly_div_newton_n_preinv (nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B, const nmod_poly_t Binv) - void _nmod_poly_divrem_newton_n_preinv (nn_ptr Q, nn_ptr R, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nn_srcptr Binv, slong lenBinv, nmod_t mod) + void _nmod_poly_divrem_newton_n_preinv (mp_ptr Q, mp_ptr R, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, mp_srcptr Binv, slong lenBinv, nmod_t mod) void nmod_poly_divrem_newton_n_preinv(nmod_poly_t Q, nmod_poly_t R, const nmod_poly_t A, const nmod_poly_t B, const nmod_poly_t Binv) - ulong _nmod_poly_div_root(nn_ptr Q, nn_srcptr A, slong len, ulong c, nmod_t mod) - ulong nmod_poly_div_root(nmod_poly_t Q, const nmod_poly_t A, ulong c) - int _nmod_poly_divides_classical(nn_ptr Q, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + mp_limb_t _nmod_poly_div_root(mp_ptr Q, mp_srcptr A, slong len, mp_limb_t c, nmod_t mod) + mp_limb_t nmod_poly_div_root(nmod_poly_t Q, const nmod_poly_t A, mp_limb_t c) + int _nmod_poly_divides_classical(mp_ptr Q, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) int nmod_poly_divides_classical(nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B) - int _nmod_poly_divides(nn_ptr Q, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + int _nmod_poly_divides(mp_ptr Q, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) int nmod_poly_divides(nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B) ulong nmod_poly_remove(nmod_poly_t f, const nmod_poly_t p) - void _nmod_poly_derivative(nn_ptr x_prime, nn_srcptr x, slong len, nmod_t mod) + void _nmod_poly_derivative(mp_ptr x_prime, mp_srcptr x, slong len, nmod_t mod) void nmod_poly_derivative(nmod_poly_t x_prime, const nmod_poly_t x) - void _nmod_poly_integral(nn_ptr x_int, nn_srcptr x, slong len, nmod_t mod) + void _nmod_poly_integral(mp_ptr x_int, mp_srcptr x, slong len, nmod_t mod) void nmod_poly_integral(nmod_poly_t x_int, const nmod_poly_t x) - ulong _nmod_poly_evaluate_nmod(nn_srcptr poly, slong len, ulong c, nmod_t mod) - ulong nmod_poly_evaluate_nmod(const nmod_poly_t poly, ulong c) + mp_limb_t _nmod_poly_evaluate_nmod(mp_srcptr poly, slong len, mp_limb_t c, nmod_t mod) + mp_limb_t nmod_poly_evaluate_nmod(const nmod_poly_t poly, mp_limb_t c) void nmod_poly_evaluate_mat_horner(nmod_mat_t dest, const nmod_poly_t poly, const nmod_mat_t c) void nmod_poly_evaluate_mat_paterson_stockmeyer(nmod_mat_t dest, const nmod_poly_t poly, const nmod_mat_t c) void nmod_poly_evaluate_mat(nmod_mat_t dest, const nmod_poly_t poly, const nmod_mat_t c) - void _nmod_poly_evaluate_nmod_vec_iter(nn_ptr ys, nn_srcptr poly, slong len, nn_srcptr xs, slong n, nmod_t mod) - void nmod_poly_evaluate_nmod_vec_iter(nn_ptr ys, const nmod_poly_t poly, nn_srcptr xs, slong n) - void _nmod_poly_evaluate_nmod_vec_fast_precomp(nn_ptr vs, nn_srcptr poly, slong plen, const nn_ptr * tree, slong len, nmod_t mod) - void _nmod_poly_evaluate_nmod_vec_fast(nn_ptr ys, nn_srcptr poly, slong len, nn_srcptr xs, slong n, nmod_t mod) - void nmod_poly_evaluate_nmod_vec_fast(nn_ptr ys, const nmod_poly_t poly, nn_srcptr xs, slong n) - void _nmod_poly_evaluate_nmod_vec(nn_ptr ys, nn_srcptr poly, slong len, nn_srcptr xs, slong n, nmod_t mod) - void nmod_poly_evaluate_nmod_vec(nn_ptr ys, const nmod_poly_t poly, nn_srcptr xs, slong n) - void _nmod_poly_interpolate_nmod_vec(nn_ptr poly, nn_srcptr xs, nn_srcptr ys, slong n, nmod_t mod) - void nmod_poly_interpolate_nmod_vec(nmod_poly_t poly, nn_srcptr xs, nn_srcptr ys, slong n) - void _nmod_poly_interpolation_weights(nn_ptr w, const nn_ptr * tree, slong len, nmod_t mod) - void _nmod_poly_interpolate_nmod_vec_fast_precomp(nn_ptr poly, nn_srcptr ys, const nn_ptr * tree, nn_srcptr weights, slong len, nmod_t mod) - void _nmod_poly_interpolate_nmod_vec_fast(nn_ptr poly, nn_srcptr xs, nn_srcptr ys, slong n, nmod_t mod) - void nmod_poly_interpolate_nmod_vec_fast(nmod_poly_t poly, nn_srcptr xs, nn_srcptr ys, slong n) - void _nmod_poly_interpolate_nmod_vec_newton(nn_ptr poly, nn_srcptr xs, nn_srcptr ys, slong n, nmod_t mod) - void nmod_poly_interpolate_nmod_vec_newton(nmod_poly_t poly, nn_srcptr xs, nn_srcptr ys, slong n) - void _nmod_poly_interpolate_nmod_vec_barycentric(nn_ptr poly, nn_srcptr xs, nn_srcptr ys, slong n, nmod_t mod) - void nmod_poly_interpolate_nmod_vec_barycentric(nmod_poly_t poly, nn_srcptr xs, nn_srcptr ys, slong n) - void _nmod_poly_compose_horner(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) + void _nmod_poly_evaluate_nmod_vec_iter(mp_ptr ys, mp_srcptr poly, slong len, mp_srcptr xs, slong n, nmod_t mod) + void nmod_poly_evaluate_nmod_vec_iter(mp_ptr ys, const nmod_poly_t poly, mp_srcptr xs, slong n) + void _nmod_poly_evaluate_nmod_vec_fast_precomp(mp_ptr vs, mp_srcptr poly, slong plen, const mp_ptr * tree, slong len, nmod_t mod) + void _nmod_poly_evaluate_nmod_vec_fast(mp_ptr ys, mp_srcptr poly, slong len, mp_srcptr xs, slong n, nmod_t mod) + void nmod_poly_evaluate_nmod_vec_fast(mp_ptr ys, const nmod_poly_t poly, mp_srcptr xs, slong n) + void _nmod_poly_evaluate_nmod_vec(mp_ptr ys, mp_srcptr poly, slong len, mp_srcptr xs, slong n, nmod_t mod) + void nmod_poly_evaluate_nmod_vec(mp_ptr ys, const nmod_poly_t poly, mp_srcptr xs, slong n) + void _nmod_poly_interpolate_nmod_vec(mp_ptr poly, mp_srcptr xs, mp_srcptr ys, slong n, nmod_t mod) + void nmod_poly_interpolate_nmod_vec(nmod_poly_t poly, mp_srcptr xs, mp_srcptr ys, slong n) + void _nmod_poly_interpolation_weights(mp_ptr w, const mp_ptr * tree, slong len, nmod_t mod) + void _nmod_poly_interpolate_nmod_vec_fast_precomp(mp_ptr poly, mp_srcptr ys, const mp_ptr * tree, mp_srcptr weights, slong len, nmod_t mod) + void _nmod_poly_interpolate_nmod_vec_fast(mp_ptr poly, mp_srcptr xs, mp_srcptr ys, slong n, nmod_t mod) + void nmod_poly_interpolate_nmod_vec_fast(nmod_poly_t poly, mp_srcptr xs, mp_srcptr ys, slong n) + void _nmod_poly_interpolate_nmod_vec_newton(mp_ptr poly, mp_srcptr xs, mp_srcptr ys, slong n, nmod_t mod) + void nmod_poly_interpolate_nmod_vec_newton(nmod_poly_t poly, mp_srcptr xs, mp_srcptr ys, slong n) + void _nmod_poly_interpolate_nmod_vec_barycentric(mp_ptr poly, mp_srcptr xs, mp_srcptr ys, slong n, nmod_t mod) + void nmod_poly_interpolate_nmod_vec_barycentric(nmod_poly_t poly, mp_srcptr xs, mp_srcptr ys, slong n) + void _nmod_poly_compose_horner(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) void nmod_poly_compose_horner(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) - void _nmod_poly_compose_divconquer(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) + void _nmod_poly_compose_divconquer(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) void nmod_poly_compose_divconquer(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) - void _nmod_poly_compose(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) + void _nmod_poly_compose(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) void nmod_poly_compose(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2) - void _nmod_poly_taylor_shift_horner(nn_ptr poly, ulong c, slong len, nmod_t mod) - void nmod_poly_taylor_shift_horner(nmod_poly_t g, const nmod_poly_t f, ulong c) - void _nmod_poly_taylor_shift_convolution(nn_ptr poly, ulong c, slong len, nmod_t mod) - void nmod_poly_taylor_shift_convolution(nmod_poly_t g, const nmod_poly_t f, ulong c) - void _nmod_poly_taylor_shift(nn_ptr poly, ulong c, slong len, nmod_t mod) - void nmod_poly_taylor_shift(nmod_poly_t g, const nmod_poly_t f, ulong c) - void _nmod_poly_compose_mod_horner(nn_ptr res, nn_srcptr f, slong lenf, nn_srcptr g, nn_srcptr h, slong lenh, nmod_t mod) + void _nmod_poly_taylor_shift_horner(mp_ptr poly, mp_limb_t c, slong len, nmod_t mod) + void nmod_poly_taylor_shift_horner(nmod_poly_t g, const nmod_poly_t f, mp_limb_t c) + void _nmod_poly_taylor_shift_convolution(mp_ptr poly, mp_limb_t c, slong len, nmod_t mod) + void nmod_poly_taylor_shift_convolution(nmod_poly_t g, const nmod_poly_t f, mp_limb_t c) + void _nmod_poly_taylor_shift(mp_ptr poly, mp_limb_t c, slong len, nmod_t mod) + void nmod_poly_taylor_shift(nmod_poly_t g, const nmod_poly_t f, mp_limb_t c) + void _nmod_poly_compose_mod_horner(mp_ptr res, mp_srcptr f, slong lenf, mp_srcptr g, mp_srcptr h, slong lenh, nmod_t mod) void nmod_poly_compose_mod_horner(nmod_poly_t res, const nmod_poly_t f, const nmod_poly_t g, const nmod_poly_t h) - void _nmod_poly_compose_mod_brent_kung(nn_ptr res, nn_srcptr f, slong lenf, nn_srcptr g, nn_srcptr h, slong lenh, nmod_t mod) + void _nmod_poly_compose_mod_brent_kung(mp_ptr res, mp_srcptr f, slong lenf, mp_srcptr g, mp_srcptr h, slong lenh, nmod_t mod) void nmod_poly_compose_mod_brent_kung(nmod_poly_t res, const nmod_poly_t f, const nmod_poly_t g, const nmod_poly_t h) - void _nmod_poly_compose_mod_brent_kung_preinv(nn_ptr res, nn_srcptr f, slong lenf, nn_srcptr g, nn_srcptr h, slong lenh, nn_srcptr hinv, slong lenhinv, nmod_t mod) + void _nmod_poly_compose_mod_brent_kung_preinv(mp_ptr res, mp_srcptr f, slong lenf, mp_srcptr g, mp_srcptr h, slong lenh, mp_srcptr hinv, slong lenhinv, nmod_t mod) void nmod_poly_compose_mod_brent_kung_preinv(nmod_poly_t res, const nmod_poly_t f, const nmod_poly_t g, const nmod_poly_t h, const nmod_poly_t hinv) void _nmod_poly_reduce_matrix_mod_poly (nmod_mat_t A, const nmod_mat_t B, const nmod_poly_t f) void _nmod_poly_precompute_matrix_worker (void * arg_ptr) - void _nmod_poly_precompute_matrix (nmod_mat_t A, nn_srcptr f, nn_srcptr g, slong leng, nn_srcptr ginv, slong lenginv, nmod_t mod) + void _nmod_poly_precompute_matrix (nmod_mat_t A, mp_srcptr f, mp_srcptr g, slong leng, mp_srcptr ginv, slong lenginv, nmod_t mod) void nmod_poly_precompute_matrix (nmod_mat_t A, const nmod_poly_t f, const nmod_poly_t g, const nmod_poly_t ginv) void _nmod_poly_compose_mod_brent_kung_precomp_preinv_worker(void * arg_ptr) - void _nmod_poly_compose_mod_brent_kung_precomp_preinv(nn_ptr res, nn_srcptr f, slong lenf, const nmod_mat_t A, nn_srcptr h, slong lenh, nn_srcptr hinv, slong lenhinv, nmod_t mod) + void _nmod_poly_compose_mod_brent_kung_precomp_preinv(mp_ptr res, mp_srcptr f, slong lenf, const nmod_mat_t A, mp_srcptr h, slong lenh, mp_srcptr hinv, slong lenhinv, nmod_t mod) void nmod_poly_compose_mod_brent_kung_precomp_preinv(nmod_poly_t res, const nmod_poly_t f, const nmod_mat_t A, const nmod_poly_t h, const nmod_poly_t hinv) - void _nmod_poly_compose_mod_brent_kung_vec_preinv(nmod_poly_struct * res, const nmod_poly_struct * polys, slong len1, slong l, nn_srcptr g, slong leng, nn_srcptr h, slong lenh, nn_srcptr hinv, slong lenhinv, nmod_t mod) + void _nmod_poly_compose_mod_brent_kung_vec_preinv(nmod_poly_struct * res, const nmod_poly_struct * polys, slong len1, slong l, mp_srcptr g, slong leng, mp_srcptr h, slong lenh, mp_srcptr hinv, slong lenhinv, nmod_t mod) void nmod_poly_compose_mod_brent_kung_vec_preinv(nmod_poly_struct * res, const nmod_poly_struct * polys, slong len1, slong n, const nmod_poly_t g, const nmod_poly_t h, const nmod_poly_t hinv) - # void _nmod_poly_compose_mod_brent_kung_vec_preinv_threaded_pool(nmod_poly_struct * res, const nmod_poly_struct * polys, slong lenpolys, slong l, nn_srcptr g, slong glen, nn_srcptr poly, slong len, nn_srcptr polyinv, slong leninv, nmod_t mod, thread_pool_handle * threads, slong num_threads) + # void _nmod_poly_compose_mod_brent_kung_vec_preinv_threaded_pool(nmod_poly_struct * res, const nmod_poly_struct * polys, slong lenpolys, slong l, mp_srcptr g, slong glen, mp_srcptr poly, slong len, mp_srcptr polyinv, slong leninv, nmod_t mod, thread_pool_handle * threads, slong num_threads) # void nmod_poly_compose_mod_brent_kung_vec_preinv_threaded_pool(nmod_poly_struct * res, const nmod_poly_struct * polys, slong len1, slong n, const nmod_poly_t g, const nmod_poly_t poly, const nmod_poly_t polyinv, thread_pool_handle * threads, slong num_threads) void nmod_poly_compose_mod_brent_kung_vec_preinv_threaded(nmod_poly_struct * res, const nmod_poly_struct * polys, slong len1, slong n, const nmod_poly_t g, const nmod_poly_t poly, const nmod_poly_t polyinv) - void _nmod_poly_compose_mod(nn_ptr res, nn_srcptr f, slong lenf, nn_srcptr g, nn_srcptr h, slong lenh, nmod_t mod) + void _nmod_poly_compose_mod(mp_ptr res, mp_srcptr f, slong lenf, mp_srcptr g, mp_srcptr h, slong lenh, nmod_t mod) void nmod_poly_compose_mod(nmod_poly_t res, const nmod_poly_t f, const nmod_poly_t g, const nmod_poly_t h) - slong _nmod_poly_gcd_euclidean(nn_ptr G, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + slong _nmod_poly_gcd_euclidean(mp_ptr G, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_gcd_euclidean(nmod_poly_t G, const nmod_poly_t A, const nmod_poly_t B) - slong _nmod_poly_hgcd(nn_ptr * M, slong * lenM, nn_ptr A, slong * lenA, nn_ptr B, slong * lenB, nn_srcptr a, slong lena, nn_srcptr b, slong lenb, nmod_t mod) - slong _nmod_poly_gcd_hgcd(nn_ptr G, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + slong _nmod_poly_hgcd(mp_ptr * M, slong * lenM, mp_ptr A, slong * lenA, mp_ptr B, slong * lenB, mp_srcptr a, slong lena, mp_srcptr b, slong lenb, nmod_t mod) + slong _nmod_poly_gcd_hgcd(mp_ptr G, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_gcd_hgcd(nmod_poly_t G, const nmod_poly_t A, const nmod_poly_t B) - slong _nmod_poly_gcd(nn_ptr G, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + slong _nmod_poly_gcd(mp_ptr G, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_gcd(nmod_poly_t G, const nmod_poly_t A, const nmod_poly_t B) - slong _nmod_poly_xgcd_euclidean(nn_ptr G, nn_ptr S, nn_ptr T, nn_srcptr A, slong A_len, nn_srcptr B, slong B_len, nmod_t mod) + slong _nmod_poly_xgcd_euclidean(mp_ptr G, mp_ptr S, mp_ptr T, mp_srcptr A, slong A_len, mp_srcptr B, slong B_len, nmod_t mod) void nmod_poly_xgcd_euclidean(nmod_poly_t G, nmod_poly_t S, nmod_poly_t T, const nmod_poly_t A, const nmod_poly_t B) - slong _nmod_poly_xgcd_hgcd(nn_ptr G, nn_ptr S, nn_ptr T, nn_srcptr A, slong A_len, nn_srcptr B, slong B_len, nmod_t mod) + slong _nmod_poly_xgcd_hgcd(mp_ptr G, mp_ptr S, mp_ptr T, mp_srcptr A, slong A_len, mp_srcptr B, slong B_len, nmod_t mod) void nmod_poly_xgcd_hgcd(nmod_poly_t G, nmod_poly_t S, nmod_poly_t T, const nmod_poly_t A, const nmod_poly_t B) - slong _nmod_poly_xgcd(nn_ptr G, nn_ptr S, nn_ptr T, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod) + slong _nmod_poly_xgcd(mp_ptr G, mp_ptr S, mp_ptr T, mp_srcptr A, slong lenA, mp_srcptr B, slong lenB, nmod_t mod) void nmod_poly_xgcd(nmod_poly_t G, nmod_poly_t S, nmod_poly_t T, const nmod_poly_t A, const nmod_poly_t B) - ulong _nmod_poly_resultant_euclidean(nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) - ulong nmod_poly_resultant_euclidean(const nmod_poly_t f, const nmod_poly_t g) - ulong _nmod_poly_resultant_hgcd(nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) - ulong nmod_poly_resultant_hgcd(const nmod_poly_t f, const nmod_poly_t g) - ulong _nmod_poly_resultant(nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, nmod_t mod) - ulong nmod_poly_resultant(const nmod_poly_t f, const nmod_poly_t g) - slong _nmod_poly_gcdinv(ulong * G, ulong * S, const ulong * A, slong lenA, const ulong * B, slong lenB, const nmod_t mod) + mp_limb_t _nmod_poly_resultant_euclidean(mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) + mp_limb_t nmod_poly_resultant_euclidean(const nmod_poly_t f, const nmod_poly_t g) + mp_limb_t _nmod_poly_resultant_hgcd(mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) + mp_limb_t nmod_poly_resultant_hgcd(const nmod_poly_t f, const nmod_poly_t g) + mp_limb_t _nmod_poly_resultant(mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, nmod_t mod) + mp_limb_t nmod_poly_resultant(const nmod_poly_t f, const nmod_poly_t g) + slong _nmod_poly_gcdinv(mp_limb_t * G, mp_limb_t * S, const mp_limb_t * A, slong lenA, const mp_limb_t * B, slong lenB, const nmod_t mod) void nmod_poly_gcdinv(nmod_poly_t G, nmod_poly_t S, const nmod_poly_t A, const nmod_poly_t B) - int _nmod_poly_invmod(ulong * A, const ulong * B, slong lenB, const ulong * P, slong lenP, const nmod_t mod) + int _nmod_poly_invmod(mp_limb_t * A, const mp_limb_t * B, slong lenB, const mp_limb_t * P, slong lenP, const nmod_t mod) int nmod_poly_invmod(nmod_poly_t A, const nmod_poly_t B, const nmod_poly_t P) - ulong _nmod_poly_discriminant(nn_srcptr poly, slong len, nmod_t mod) - ulong nmod_poly_discriminant(const nmod_poly_t f) - void _nmod_poly_compose_series(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong n, nmod_t mod) + mp_limb_t _nmod_poly_discriminant(mp_srcptr poly, slong len, nmod_t mod) + mp_limb_t nmod_poly_discriminant(const nmod_poly_t f) + void _nmod_poly_compose_series(mp_ptr res, mp_srcptr poly1, slong len1, mp_srcptr poly2, slong len2, slong n, nmod_t mod) void nmod_poly_compose_series(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong n) - void _nmod_poly_revert_series(nn_ptr Qinv, nn_srcptr Q, slong Qlen, slong n, nmod_t mod) + void _nmod_poly_revert_series(mp_ptr Qinv, mp_srcptr Q, slong Qlen, slong n, nmod_t mod) void nmod_poly_revert_series(nmod_poly_t Qinv, const nmod_poly_t Q, slong n) - void _nmod_poly_invsqrt_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_invsqrt_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_invsqrt_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_sqrt_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_sqrt_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_sqrt_series(nmod_poly_t g, const nmod_poly_t h, slong n) - int _nmod_poly_sqrt(nn_ptr s, nn_srcptr p, slong n, nmod_t mod) + int _nmod_poly_sqrt(mp_ptr s, mp_srcptr p, slong n, nmod_t mod) int nmod_poly_sqrt(nmod_poly_t s, const nmod_poly_t p) - void _nmod_poly_power_sums_naive(nn_ptr res, nn_srcptr poly, slong len, slong n, nmod_t mod) + void _nmod_poly_power_sums_naive(mp_ptr res, mp_srcptr poly, slong len, slong n, nmod_t mod) void nmod_poly_power_sums_naive(nmod_poly_t res, const nmod_poly_t poly, slong n) - void _nmod_poly_power_sums_schoenhage(nn_ptr res, nn_srcptr poly, slong len, slong n, nmod_t mod) + void _nmod_poly_power_sums_schoenhage(mp_ptr res, mp_srcptr poly, slong len, slong n, nmod_t mod) void nmod_poly_power_sums_schoenhage(nmod_poly_t res, const nmod_poly_t poly, slong n) - void _nmod_poly_power_sums(nn_ptr res, nn_srcptr poly, slong len, slong n, nmod_t mod) + void _nmod_poly_power_sums(mp_ptr res, mp_srcptr poly, slong len, slong n, nmod_t mod) void nmod_poly_power_sums(nmod_poly_t res, const nmod_poly_t poly, slong n) - void _nmod_poly_power_sums_to_poly_naive(nn_ptr res, nn_srcptr poly, slong len, nmod_t mod) + void _nmod_poly_power_sums_to_poly_naive(mp_ptr res, mp_srcptr poly, slong len, nmod_t mod) void nmod_poly_power_sums_to_poly_naive(nmod_poly_t res, const nmod_poly_t Q) - void _nmod_poly_power_sums_to_poly_schoenhage(nn_ptr res, nn_srcptr poly, slong len, nmod_t mod) + void _nmod_poly_power_sums_to_poly_schoenhage(mp_ptr res, mp_srcptr poly, slong len, nmod_t mod) void nmod_poly_power_sums_to_poly_schoenhage(nmod_poly_t res, const nmod_poly_t Q) - void _nmod_poly_power_sums_to_poly(nn_ptr res, nn_srcptr poly, slong len, nmod_t mod) + void _nmod_poly_power_sums_to_poly(mp_ptr res, mp_srcptr poly, slong len, nmod_t mod) void nmod_poly_power_sums_to_poly(nmod_poly_t res, const nmod_poly_t Q) - void _nmod_poly_log_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_log_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_log_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_exp_series(nn_ptr f, nn_srcptr h, slong hlen, slong n, nmod_t mod) - void _nmod_poly_exp_expinv_series(nn_ptr f, nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_exp_series(mp_ptr f, mp_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_exp_expinv_series(mp_ptr f, mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_exp_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_atan_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_atan_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_atan_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_atanh_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_atanh_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_atanh_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_asin_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_asin_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_asin_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_asinh_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_asinh_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_asinh_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_sin_series(nn_ptr g, nn_srcptr h, slong n, nmod_t mod) + void _nmod_poly_sin_series(mp_ptr g, mp_srcptr h, slong n, nmod_t mod) void nmod_poly_sin_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_cos_series(nn_ptr g, nn_srcptr h, slong n, nmod_t mod) + void _nmod_poly_cos_series(mp_ptr g, mp_srcptr h, slong n, nmod_t mod) void nmod_poly_cos_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_tan_series(nn_ptr g, nn_srcptr h, slong hlen, slong n, nmod_t mod) + void _nmod_poly_tan_series(mp_ptr g, mp_srcptr h, slong hlen, slong n, nmod_t mod) void nmod_poly_tan_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_sinh_series(nn_ptr g, nn_srcptr h, slong n, nmod_t mod) + void _nmod_poly_sinh_series(mp_ptr g, mp_srcptr h, slong n, nmod_t mod) void nmod_poly_sinh_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_cosh_series(nn_ptr g, nn_srcptr h, slong n, nmod_t mod) + void _nmod_poly_cosh_series(mp_ptr g, mp_srcptr h, slong n, nmod_t mod) void nmod_poly_cosh_series(nmod_poly_t g, const nmod_poly_t h, slong n) - void _nmod_poly_tanh_series(nn_ptr g, nn_srcptr h, slong n, nmod_t mod) + void _nmod_poly_tanh_series(mp_ptr g, mp_srcptr h, slong n, nmod_t mod) void nmod_poly_tanh_series(nmod_poly_t g, const nmod_poly_t h, slong n) - int _nmod_poly_conway(nn_ptr op, ulong prime, slong deg) + int _nmod_poly_conway(mp_ptr op, ulong prime, slong deg) ulong _nmod_poly_conway_rand(slong * degree, flint_rand_t state, int type) - void _nmod_poly_product_roots_nmod_vec(nn_ptr poly, nn_srcptr xs, slong n, nmod_t mod) - void nmod_poly_product_roots_nmod_vec(nmod_poly_t poly, nn_srcptr xs, slong n) - int nmod_poly_find_distinct_nonzero_roots(ulong * roots, const nmod_poly_t A) - nn_ptr * _nmod_poly_tree_alloc(slong len) - void _nmod_poly_tree_free(nn_ptr * tree, slong len) - void _nmod_poly_tree_build(nn_ptr * tree, nn_srcptr roots, slong len, nmod_t mod) - void nmod_poly_inflate(nmod_poly_t result, const nmod_poly_t input, slong inflation) - void nmod_poly_deflate(nmod_poly_t result, const nmod_poly_t input, slong deflation) - slong nmod_poly_deflation(const nmod_poly_t input) + void _nmod_poly_product_roots_nmod_vec(mp_ptr poly, mp_srcptr xs, slong n, nmod_t mod) + void nmod_poly_product_roots_nmod_vec(nmod_poly_t poly, mp_srcptr xs, slong n) + int nmod_poly_find_distinct_nonzero_roots(mp_limb_t * roots, const nmod_poly_t A) + mp_ptr * _nmod_poly_tree_alloc(slong len) + void _nmod_poly_tree_free(mp_ptr * tree, slong len) + void _nmod_poly_tree_build(mp_ptr * tree, mp_srcptr roots, slong len, nmod_t mod) + void nmod_poly_inflate(nmod_poly_t result, const nmod_poly_t input, ulong inflation) + void nmod_poly_deflate(nmod_poly_t result, const nmod_poly_t input, ulong deflation) + ulong nmod_poly_deflation(const nmod_poly_t input) # void nmod_poly_multi_crt_init(nmod_poly_multi_crt_t CRT) # int nmod_poly_multi_crt_precompute(nmod_poly_multi_crt_t CRT, const nmod_poly_struct * moduli, slong len) # int nmod_poly_multi_crt_precompute_p(nmod_poly_multi_crt_t CRT, const nmod_poly_struct * const * moduli, slong len) @@ -321,15 +322,15 @@ cdef extern from "flint/nmod_poly.h": # slong _nmod_poly_multi_crt_local_size(const nmod_poly_multi_crt_t CRT) # void _nmod_poly_multi_crt_run(nmod_poly_struct * outputs, const nmod_poly_multi_crt_t CRT, const nmod_poly_struct * inputs) # void _nmod_poly_multi_crt_run_p(nmod_poly_struct * outputs, const nmod_poly_multi_crt_t CRT, const nmod_poly_struct * const * inputs) - # void nmod_berlekamp_massey_init(nmod_berlekamp_massey_t B, ulong p) + # void nmod_berlekamp_massey_init(nmod_berlekamp_massey_t B, mp_limb_t p) # void nmod_berlekamp_massey_clear(nmod_berlekamp_massey_t B) # void nmod_berlekamp_massey_start_over(nmod_berlekamp_massey_t B) - # void nmod_berlekamp_massey_set_prime(nmod_berlekamp_massey_t B, ulong p) - # void nmod_berlekamp_massey_add_points(nmod_berlekamp_massey_t B, const ulong * a, slong count) + # void nmod_berlekamp_massey_set_prime(nmod_berlekamp_massey_t B, mp_limb_t p) + # void nmod_berlekamp_massey_add_points(nmod_berlekamp_massey_t B, const mp_limb_t * a, slong count) # void nmod_berlekamp_massey_add_zeros(nmod_berlekamp_massey_t B, slong count) - # void nmod_berlekamp_massey_add_point(nmod_berlekamp_massey_t B, ulong a) + # void nmod_berlekamp_massey_add_point(nmod_berlekamp_massey_t B, mp_limb_t a) # int nmod_berlekamp_massey_reduce(nmod_berlekamp_massey_t B) # slong nmod_berlekamp_massey_point_count(const nmod_berlekamp_massey_t B) - # const ulong * nmod_berlekamp_massey_points(const nmod_berlekamp_massey_t B) + # const mp_limb_t * nmod_berlekamp_massey_points(const nmod_berlekamp_massey_t B) # const nmod_poly_struct * nmod_berlekamp_massey_V_poly(const nmod_berlekamp_massey_t B) # const nmod_poly_struct * nmod_berlekamp_massey_R_poly(const nmod_berlekamp_massey_t B) diff --git a/src/flint/flintlib/functions/nmod_poly_factor.pxd b/src/flint/flintlib/functions/nmod_poly_factor.pxd index 4413eee1..e74324fc 100644 --- a/src/flint/flintlib/functions/nmod_poly_factor.pxd +++ b/src/flint/flintlib/functions/nmod_poly_factor.pxd @@ -1,4 +1,4 @@ -from flint.flintlib.types.flint cimport flint_rand_t, nmod_t, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_rand_t, mp_limb_t, mp_srcptr, nmod_t, slong from flint.flintlib.types.nmod cimport nmod_poly_factor_t, nmod_poly_t @@ -16,7 +16,7 @@ cdef extern from "flint/nmod_poly_factor.h": int nmod_poly_is_irreducible(const nmod_poly_t f) int nmod_poly_is_irreducible_ddf(const nmod_poly_t f) int nmod_poly_is_irreducible_rabin(const nmod_poly_t f) - int _nmod_poly_is_squarefree(nn_srcptr f, slong len, nmod_t mod) + int _nmod_poly_is_squarefree(mp_srcptr f, slong len, nmod_t mod) int nmod_poly_is_squarefree(const nmod_poly_t f) void nmod_poly_factor_squarefree(nmod_poly_factor_t res, const nmod_poly_t f) int nmod_poly_factor_equal_deg_prob(nmod_poly_t factor, flint_rand_t state, const nmod_poly_t pol, slong d) @@ -26,8 +26,8 @@ cdef extern from "flint/nmod_poly_factor.h": void nmod_poly_factor_cantor_zassenhaus(nmod_poly_factor_t res, const nmod_poly_t f) void nmod_poly_factor_berlekamp(nmod_poly_factor_t res, const nmod_poly_t f) void nmod_poly_factor_kaltofen_shoup(nmod_poly_factor_t res, const nmod_poly_t poly) - ulong nmod_poly_factor_with_berlekamp(nmod_poly_factor_t res, const nmod_poly_t f) - ulong nmod_poly_factor_with_cantor_zassenhaus(nmod_poly_factor_t res, const nmod_poly_t f) - ulong nmod_poly_factor_with_kaltofen_shoup(nmod_poly_factor_t res, const nmod_poly_t f) - ulong nmod_poly_factor(nmod_poly_factor_t res, const nmod_poly_t f) + mp_limb_t nmod_poly_factor_with_berlekamp(nmod_poly_factor_t res, const nmod_poly_t f) + mp_limb_t nmod_poly_factor_with_cantor_zassenhaus(nmod_poly_factor_t res, const nmod_poly_t f) + mp_limb_t nmod_poly_factor_with_kaltofen_shoup(nmod_poly_factor_t res, const nmod_poly_t f) + mp_limb_t nmod_poly_factor(nmod_poly_factor_t res, const nmod_poly_t f) void _nmod_poly_interval_poly_worker(void * arg_ptr) diff --git a/src/flint/flintlib/functions/nmod_vec.pxd b/src/flint/flintlib/functions/nmod_vec.pxd index e4eaa7fc..e5a5f242 100644 --- a/src/flint/flintlib/functions/nmod_vec.pxd +++ b/src/flint/flintlib/functions/nmod_vec.pxd @@ -1,33 +1,30 @@ -from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, nmod_t, nn_ptr, nn_srcptr, slong, ulong +from flint.flintlib.types.flint cimport flint_bitcnt_t, flint_rand_t, mp_limb_t, mp_ptr, mp_srcptr, nmod_t, slong # unknown type FILE -# unknown type dot_params_t -# .. macro:: NMOD_VEC_DOT(res, i, len, expr1, expr2, mod, params) +# .. macro:: NMOD_VEC_DOT(res, i, len, expr1, expr2, mod, nlimbs) cdef extern from "flint/nmod_vec.h": - nn_ptr _nmod_vec_init(slong len) - void _nmod_vec_clear(nn_ptr vec) - void _nmod_vec_randtest(nn_ptr vec, flint_rand_t state, slong len, nmod_t mod) - void _nmod_vec_set(nn_ptr res, nn_srcptr vec, slong len) - void _nmod_vec_zero(nn_ptr vec, slong len) - void _nmod_vec_swap(nn_ptr a, nn_ptr b, slong length) - void _nmod_vec_reduce(nn_ptr res, nn_srcptr vec, slong len, nmod_t mod) - flint_bitcnt_t _nmod_vec_max_bits(nn_srcptr vec, slong len) - int _nmod_vec_equal(nn_srcptr vec, nn_srcptr vec2, slong len) - void _nmod_vec_print_pretty(nn_srcptr vec, slong len, nmod_t mod) - # int _nmod_vec_fprint_pretty(FILE * file, nn_srcptr vec, slong len, nmod_t mod) - int _nmod_vec_print(nn_srcptr vec, slong len, nmod_t mod) - # int _nmod_vec_fprint(FILE * f, nn_srcptr vec, slong len, nmod_t mod) - void _nmod_vec_add(nn_ptr res, nn_srcptr vec1, nn_srcptr vec2, slong len, nmod_t mod) - void _nmod_vec_sub(nn_ptr res, nn_srcptr vec1, nn_srcptr vec2, slong len, nmod_t mod) - void _nmod_vec_neg(nn_ptr res, nn_srcptr vec, slong len, nmod_t mod) - void _nmod_vec_scalar_mul_nmod(nn_ptr res, nn_srcptr vec, slong len, ulong c, nmod_t mod) - void _nmod_vec_scalar_mul_nmod_shoup(nn_ptr res, nn_srcptr vec, slong len, ulong c, nmod_t mod) - void _nmod_vec_scalar_addmul_nmod(nn_ptr res, nn_srcptr vec, slong len, ulong c, nmod_t mod) - # dot_params_t _nmod_vec_dot_params(slong len, nmod_t mod) - # ulong _nmod_vec_dot(nn_srcptr vec1, nn_srcptr vec2, slong len, nmod_t mod, dot_params_t params) - # ulong _nmod_vec_dot_rev(nn_srcptr vec1, nn_srcptr vec2, slong len, nmod_t mod, dot_params_t params) - # ulong _nmod_vec_dot_ptr(nn_srcptr vec1, const nn_ptr * vec2, slong offset, slong len, nmod_t mod, dot_params_t params) + mp_ptr _nmod_vec_init(slong len) + void _nmod_vec_clear(mp_ptr vec) + void _nmod_vec_randtest(mp_ptr vec, flint_rand_t state, slong len, nmod_t mod) + void _nmod_vec_set(mp_ptr res, mp_srcptr vec, slong len) + void _nmod_vec_zero(mp_ptr vec, slong len) + void _nmod_vec_swap(mp_ptr a, mp_ptr b, slong length) + void _nmod_vec_reduce(mp_ptr res, mp_srcptr vec, slong len, nmod_t mod) + flint_bitcnt_t _nmod_vec_max_bits(mp_srcptr vec, slong len) + int _nmod_vec_equal(mp_srcptr vec, mp_srcptr vec2, slong len) + void _nmod_vec_print_pretty(mp_srcptr vec, slong len, nmod_t mod) + # int _nmod_vec_fprint_pretty(FILE * file, mp_srcptr vec, slong len, nmod_t mod) + int _nmod_vec_print(mp_srcptr vec, slong len, nmod_t mod) + # int _nmod_vec_fprint(FILE * f, mp_srcptr vec, slong len, nmod_t mod) + void _nmod_vec_add(mp_ptr res, mp_srcptr vec1, mp_srcptr vec2, slong len, nmod_t mod) + void _nmod_vec_sub(mp_ptr res, mp_srcptr vec1, mp_srcptr vec2, slong len, nmod_t mod) + void _nmod_vec_neg(mp_ptr res, mp_srcptr vec, slong len, nmod_t mod) + void _nmod_vec_scalar_mul_nmod(mp_ptr res, mp_srcptr vec, slong len, mp_limb_t c, nmod_t mod) + void _nmod_vec_scalar_mul_nmod_shoup(mp_ptr res, mp_srcptr vec, slong len, mp_limb_t c, nmod_t mod) + void _nmod_vec_scalar_addmul_nmod(mp_ptr res, mp_srcptr vec, slong len, mp_limb_t c, nmod_t mod) int _nmod_vec_dot_bound_limbs(slong len, nmod_t mod) - # int _nmod_vec_dot_bound_limbs_from_params(slong len, nmod_t mod, dot_params_t params) + mp_limb_t _nmod_vec_dot(mp_srcptr vec1, mp_srcptr vec2, slong len, nmod_t mod, int nlimbs) + mp_limb_t _nmod_vec_dot_rev(mp_srcptr vec1, mp_srcptr vec2, slong len, nmod_t mod, int nlimbs) + mp_limb_t _nmod_vec_dot_ptr(mp_srcptr vec1, const mp_ptr * vec2, slong offset, slong len, nmod_t mod, int nlimbs) diff --git a/src/flint/flintlib/functions/ulong_extras.pxd b/src/flint/flintlib/functions/ulong_extras.pxd index 28c8b4a9..b115c511 100644 --- a/src/flint/flintlib/functions/ulong_extras.pxd +++ b/src/flint/flintlib/functions/ulong_extras.pxd @@ -1,5 +1,6 @@ -from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, slong, ulong +from flint.flintlib.types.flint cimport flint_rand_t, fmpz_t, mp_limb_t, slong, ulong +# unknown type mp_limb_signed_t # unknown type n_ecm_t # unknown type n_factor_t # unknown type n_primes_t @@ -39,25 +40,25 @@ cdef extern from "flint/ulong_extras.h": ulong n_gcd(ulong x, ulong y) ulong n_gcdinv(ulong * a, ulong x, ulong y) ulong n_xgcd(ulong * a, ulong * b, ulong x, ulong y) - int n_jacobi(slong x, ulong y) + # int n_jacobi(mp_limb_signed_t x, ulong y) int n_jacobi_unsigned(ulong x, ulong y) ulong n_addmod(ulong a, ulong b, ulong n) ulong n_submod(ulong a, ulong b, ulong n) ulong n_invmod(ulong x, ulong y) - ulong n_powmod_precomp(ulong a, slong exp, ulong n, double npre) + # ulong n_powmod_precomp(ulong a, mp_limb_signed_t exp, ulong n, double npre) ulong n_powmod_ui_precomp(ulong a, ulong exp, ulong n, double npre) - ulong n_powmod(ulong a, slong exp, ulong n) - ulong n_powmod2_preinv(ulong a, slong exp, ulong n, ulong ninv) - ulong n_powmod2(ulong a, slong exp, ulong n) + # ulong n_powmod(ulong a, mp_limb_signed_t exp, ulong n) + # ulong n_powmod2_preinv(ulong a, mp_limb_signed_t exp, ulong n, ulong ninv) + # ulong n_powmod2(ulong a, mp_limb_signed_t exp, ulong n) ulong n_powmod2_ui_preinv(ulong a, ulong exp, ulong n, ulong ninv) ulong n_powmod2_fmpz_preinv(ulong a, const fmpz_t exp, ulong n, ulong ninv) ulong n_sqrtmod(ulong a, ulong p) slong n_sqrtmod_2pow(ulong ** sqrt, ulong a, slong exp) slong n_sqrtmod_primepow(ulong ** sqrt, ulong a, ulong p, slong exp) # slong n_sqrtmodn(ulong ** sqrt, ulong a, n_factor_t * fac) - ulong n_mulmod_shoup(ulong w, ulong t, ulong w_precomp, ulong p) - ulong n_mulmod_precomp_shoup(ulong w, ulong p) - int n_divides(ulong * q, ulong n, ulong p) + mp_limb_t n_mulmod_shoup(mp_limb_t w, mp_limb_t t, mp_limb_t w_precomp, mp_limb_t p) + mp_limb_t n_mulmod_precomp_shoup(mp_limb_t w, mp_limb_t p) + int n_divides(mp_limb_t * q, mp_limb_t n, mp_limb_t p) # void n_primes_init(n_primes_t iter) # void n_primes_clear(n_primes_t iter) # ulong n_primes_next(n_primes_t iter) @@ -93,11 +94,11 @@ cdef extern from "flint/ulong_extras.h": int n_is_perfect_power(ulong * root, ulong n) ulong n_rootrem(ulong * remainder, ulong n, ulong root) ulong n_cbrt(ulong n) + ulong n_cbrt_newton_iteration(ulong n) ulong n_cbrt_binary_search(ulong n) ulong n_cbrt_chebyshev_approx(ulong n) ulong n_cbrtrem(ulong * remainder, ulong n) # void n_factor_init(n_factor_t * factors) - # ulong n_factor_evaluate(const n_factor_t * factors) int n_remove(ulong * n, ulong p) int n_remove2_precomp(ulong * n, ulong p, double ppre) # void n_factor_insert(n_factor_t * factors, ulong p, ulong exp) @@ -112,8 +113,8 @@ cdef extern from "flint/ulong_extras.h": # ulong n_factor_partial(n_factor_t * factors, ulong n, ulong limit, int proved) ulong n_factor_pp1(ulong n, ulong B1, ulong c) ulong n_factor_pp1_wrapper(ulong n) - int n_factor_pollard_brent_single(ulong * factor, ulong n, ulong ninv, ulong ai, ulong xi, ulong normbits, ulong max_iters) - int n_factor_pollard_brent(ulong * factor, flint_rand_t state, ulong n_in, ulong max_tries, ulong max_iters) + int n_factor_pollard_brent_single(mp_limb_t * factor, mp_limb_t n, mp_limb_t ninv, mp_limb_t ai, mp_limb_t xi, mp_limb_t normbits, mp_limb_t max_iters) + int n_factor_pollard_brent(mp_limb_t * factor, flint_rand_t state, mp_limb_t n_in, mp_limb_t max_tries, mp_limb_t max_iters) int n_moebius_mu(ulong n) void n_moebius_mu_vec(int * mu, ulong len) int n_is_squarefree(ulong n) @@ -123,10 +124,10 @@ cdef extern from "flint/ulong_extras.h": # ulong n_primitive_root_prime_prefactor(ulong p, n_factor_t * factors) ulong n_primitive_root_prime(ulong p) ulong n_discrete_log_bsgs(ulong b, ulong a, ulong n) - # void n_factor_ecm_double(ulong * x, ulong * z, ulong x0, ulong z0, ulong n, n_ecm_t n_ecm_inf) - # void n_factor_ecm_add(ulong * x, ulong * z, ulong x1, ulong z1, ulong x2, ulong z2, ulong x0, ulong z0, ulong n, n_ecm_t n_ecm_inf) - # void n_factor_ecm_mul_montgomery_ladder(ulong * x, ulong * z, ulong x0, ulong z0, ulong k, ulong n, n_ecm_t n_ecm_inf) - # int n_factor_ecm_select_curve(ulong * f, ulong sigma, ulong n, n_ecm_t n_ecm_inf) - # int n_factor_ecm_stage_I(ulong * f, const ulong * prime_array, ulong num, ulong B1, ulong n, n_ecm_t n_ecm_inf) - # int n_factor_ecm_stage_II(ulong * f, ulong B1, ulong B2, ulong P, ulong n, n_ecm_t n_ecm_inf) - int n_factor_ecm(ulong * f, ulong curves, ulong B1, ulong B2, flint_rand_t state, ulong n) + # void n_factor_ecm_double(mp_limb_t * x, mp_limb_t * z, mp_limb_t x0, mp_limb_t z0, mp_limb_t n, n_ecm_t n_ecm_inf) + # void n_factor_ecm_add(mp_limb_t * x, mp_limb_t * z, mp_limb_t x1, mp_limb_t z1, mp_limb_t x2, mp_limb_t z2, mp_limb_t x0, mp_limb_t z0, mp_limb_t n, n_ecm_t n_ecm_inf) + # void n_factor_ecm_mul_montgomery_ladder(mp_limb_t * x, mp_limb_t * z, mp_limb_t x0, mp_limb_t z0, mp_limb_t k, mp_limb_t n, n_ecm_t n_ecm_inf) + # int n_factor_ecm_select_curve(mp_limb_t * f, mp_limb_t sigma, mp_limb_t n, n_ecm_t n_ecm_inf) + # int n_factor_ecm_stage_I(mp_limb_t * f, const mp_limb_t * prime_array, mp_limb_t num, mp_limb_t B1, mp_limb_t n, n_ecm_t n_ecm_inf) + # int n_factor_ecm_stage_II(mp_limb_t * f, mp_limb_t B1, mp_limb_t B2, mp_limb_t P, mp_limb_t n, n_ecm_t n_ecm_inf) + int n_factor_ecm(mp_limb_t * f, mp_limb_t curves, mp_limb_t B1, mp_limb_t B2, flint_rand_t state, mp_limb_t n) From 14241cdd5c580b74eab2b9e010f8c0a0ae7e222c Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Sun, 8 Sep 2024 21:58:43 +0100 Subject: [PATCH 2/2] Add README to flintlib about auto-generated files --- src/flint/flintlib/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/flint/flintlib/README.md diff --git a/src/flint/flintlib/README.md b/src/flint/flintlib/README.md new file mode 100644 index 00000000..2c0308e1 --- /dev/null +++ b/src/flint/flintlib/README.md @@ -0,0 +1,35 @@ +Cython declarations for functions exported by libflint +====================================================== + +This directory contains Cython declarations for functions exported by libflint. +The declarations under the `types` directory are for the types defined in +libflint and are hand-written. The declarations under the `functions` directory +are for the functions defined in libflint and are generated by running: +```console +$ bin/all_rst_to_pxd.sh /path/to/flint/doc/source +``` +where `/path/to/flint/doc/source` is the path to the source directory of the +flint documentation. This command should always be run on the FLINT docs of the +version of FLINT that is used by default in python-flint's wheels which is the +version shown in the `bin/build_variables.sh` script. Typically this just means +the latest released version of FLINT. + +It is important not to edit any of the files in `functions` manually because a +subsequent run of `bin/all_rst_to_pxd.sh` will overwrite them. There are +several reasons why manual editing may be needed but usually it is because +either: + +1. The function is not documented in the FLINT docs. +2. The function is a macro and not a function. + +In either case, we need to manually write the declaration for the function but +it cannot be done in the `functions` directory. Instead, it should be added +somewhere in the `types` directory. + +Generally undocumented functions should be reported/fixed upstream in FLINT. + +It might be better to list macros (and undocumented functions) in the +`bin/rst_to_pxd.py` script so that it can add them to the generated files +automatically. Then we can keep them out of the hand-written code but also keep +track of them with a goal of eventually getting all of them added to the FLINT +docs.