|
| 1 | +from flint.flintlib.flint cimport flint_bitcnt_t, fmpz_struct, slong, flint_rand_t, ulong |
| 2 | +from flint.flintlib.fmpz cimport fmpz_t, fmpz_struct |
| 3 | +from flint.flintlib.fmpz_mod cimport fmpz_mod_ctx_t |
| 4 | +from flint.flintlib.fmpz_mod_mat cimport fmpz_mod_mat_t |
| 5 | +from flint.flintlib.fmpz_poly cimport fmpz_poly_t, fmpz_poly_struct |
| 6 | +from flint.flintlib.fmpz_mod_poly cimport fmpz_mod_poly_t, fmpz_mod_poly_struct |
| 7 | + |
| 8 | +cdef extern from "flint/fq.h": |
| 9 | + |
| 10 | + ctypedef fmpz_poly_t fq_t |
| 11 | + ctypedef fmpz_poly_struct fq_struct |
| 12 | + |
| 13 | + ctypedef struct fq_ctx_struct: |
| 14 | + fmpz_mod_ctx_t ctxp |
| 15 | + |
| 16 | + int sparse_modulus |
| 17 | + int is_conway # whether field was initialized with the Flint Conway tables (assures primitivity) |
| 18 | + |
| 19 | + fmpz_struct * a |
| 20 | + slong * j |
| 21 | + slong len |
| 22 | + |
| 23 | + fmpz_mod_poly_t modulus |
| 24 | + fmpz_mod_poly_t inv |
| 25 | + |
| 26 | + char * var |
| 27 | + |
| 28 | + ctypedef fq_ctx_struct fq_ctx_t[1] |
| 29 | + |
| 30 | + void fq_ctx_init(fq_ctx_t ctx, const fmpz_t p, slong d, const char *var) |
| 31 | + int _fq_ctx_init_conway(fq_ctx_t ctx, const fmpz_t p, slong d, const char *var) |
| 32 | + void fq_ctx_init_conway(fq_ctx_t ctx, const fmpz_t p, slong d, const char *var) |
| 33 | + void fq_ctx_init_modulus(fq_ctx_t ctx, const fmpz_mod_poly_t modulus, const fmpz_mod_ctx_t ctxp, const char *var) |
| 34 | + void fq_ctx_clear(fq_ctx_t ctx) |
| 35 | + const fmpz_mod_poly_struct* fq_ctx_modulus(const fq_ctx_t ctx) |
| 36 | + long fq_ctx_degree(const fq_ctx_t ctx) |
| 37 | + fmpz_struct * fq_ctx_prime(const fq_ctx_t ctx) |
| 38 | + void fq_ctx_order(fmpz_t f, const fq_ctx_t ctx) |
| 39 | + # int fq_ctx_fprint(FILE * file, const fq_ctx_t ctx) |
| 40 | + void fq_ctx_print(const fq_ctx_t ctx) |
| 41 | + void fq_ctx_randtest(fq_ctx_t ctx) |
| 42 | + void fq_ctx_randtest_reducible(fq_ctx_t ctx) |
| 43 | + void fq_init(fq_t rop, const fq_ctx_t ctx) |
| 44 | + void fq_init2(fq_t rop, const fq_ctx_t ctx) |
| 45 | + void fq_clear(fq_t rop, const fq_ctx_t ctx) |
| 46 | + void _fq_sparse_reduce(fmpz_struct *R, slong lenR, const fq_ctx_t ctx) |
| 47 | + void _fq_dense_reduce(fmpz_struct *R, slong lenR, const fq_ctx_t ctx) |
| 48 | + void _fq_reduce(fmpz_struct *r, slong lenR, const fq_ctx_t ctx) |
| 49 | + void fq_reduce(fq_t rop, const fq_ctx_t ctx) |
| 50 | + void fq_add(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) |
| 51 | + void fq_sub(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) |
| 52 | + void fq_sub_one(fq_t rop, const fq_t op1, const fq_ctx_t ctx) |
| 53 | + void fq_neg(fq_t rop, const fq_t op, const fq_ctx_t ctx) |
| 54 | + void fq_mul(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) |
| 55 | + void fq_mul_fmpz(fq_t rop, const fq_t op, const fmpz_t x, const fq_ctx_t ctx) |
| 56 | + void fq_mul_si(fq_t rop, const fq_t op, slong x, const fq_ctx_t ctx) |
| 57 | + void fq_mul_ui(fq_t rop, const fq_t op, ulong x, const fq_ctx_t ctx) |
| 58 | + void fq_sqr(fq_t rop, const fq_t op, const fq_ctx_t ctx) |
| 59 | + void fq_div(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) |
| 60 | + void _fq_inv(fmpz_struct *rop, const fmpz_struct *op, slong len, const fq_ctx_t ctx) |
| 61 | + void fq_inv(fq_t rop, const fq_t op, const fq_ctx_t ctx) |
| 62 | + void fq_gcdinv(fq_t f, fq_t inv, const fq_t op, const fq_ctx_t ctx) |
| 63 | + void _fq_pow(fmpz_struct *rop, const fmpz_struct *op, slong len, const fmpz_t e, const fq_ctx_t ctx) |
| 64 | + void fq_pow(fq_t rop, const fq_t op, const fmpz_t e, const fq_ctx_t ctx) |
| 65 | + void fq_pow_ui(fq_t rop, const fq_t op, const ulong e, const fq_ctx_t ctx) |
| 66 | + int fq_sqrt(fq_t rop, const fq_t op1, const fq_ctx_t ctx) |
| 67 | + void fq_pth_root(fq_t rop, const fq_t op1, const fq_ctx_t ctx) |
| 68 | + int fq_is_square(const fq_t op, const fq_ctx_t ctx) |
| 69 | + # int fq_fprint_pretty(FILE *file, const fq_t op, const fq_ctx_t ctx) |
| 70 | + int fq_print_pretty(const fq_t op, const fq_ctx_t ctx) |
| 71 | + # void fq_fprint(FILE * file, const fq_t op, const fq_ctx_t ctx) |
| 72 | + void fq_print(const fq_t op, const fq_ctx_t ctx) |
| 73 | + char * fq_get_str(const fq_t op, const fq_ctx_t ctx) |
| 74 | + char * fq_get_str_pretty(const fq_t op, const fq_ctx_t ctx) |
| 75 | + void fq_randtest(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) |
| 76 | + void fq_randtest_not_zero(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) |
| 77 | + void fq_randtest_dense(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) |
| 78 | + void fq_rand(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) |
| 79 | + void fq_rand_not_zero(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) |
| 80 | + void fq_set(fq_t rop, const fq_t op, const fq_ctx_t ctx) |
| 81 | + void fq_set_si(fq_t rop, const slong x, const fq_ctx_t ctx) |
| 82 | + void fq_set_ui(fq_t rop, const ulong x, const fq_ctx_t ctx) |
| 83 | + void fq_set_fmpz(fq_t rop, const fmpz_t x, const fq_ctx_t ctx) |
| 84 | + void fq_swap(fq_t op1, fq_t op2, const fq_ctx_t ctx) |
| 85 | + void fq_zero(fq_t rop, const fq_ctx_t ctx) |
| 86 | + void fq_one(fq_t rop, const fq_ctx_t ctx) |
| 87 | + void fq_gen(fq_t rop, const fq_ctx_t ctx) |
| 88 | + int fq_get_fmpz(fmpz_t rop, const fq_t op, const fq_ctx_t ctx) |
| 89 | + void fq_get_fmpz_poly(fmpz_poly_t a, const fq_t b, const fq_ctx_t ctx) |
| 90 | + void fq_get_fmpz_mod_poly(fmpz_mod_poly_t a, const fq_t b, const fq_ctx_t ctx) |
| 91 | + void fq_set_fmpz_poly(fq_t a, const fmpz_poly_t b, const fq_ctx_t ctx) |
| 92 | + void fq_set_fmpz_mod_poly(fq_t a, const fmpz_mod_poly_t b, const fq_ctx_t ctx) |
| 93 | + void fq_get_fmpz_mod_mat(fmpz_mod_mat_t col, const fq_t a, const fq_ctx_t ctx) |
| 94 | + void fq_set_fmpz_mod_mat(fq_t a, const fmpz_mod_mat_t col, const fq_ctx_t ctx) |
| 95 | + int fq_is_zero(const fq_t op, const fq_ctx_t ctx) |
| 96 | + int fq_is_one(const fq_t op, const fq_ctx_t ctx) |
| 97 | + int fq_equal(const fq_t op1, const fq_t op2, const fq_ctx_t ctx) |
| 98 | + int fq_is_invertible(const fq_t op, const fq_ctx_t ctx) |
| 99 | + int fq_is_invertible_f(fq_t f, const fq_t op, const fq_ctx_t ctx) |
| 100 | + void _fq_trace(fmpz_t rop, const fmpz_struct *op, slong len, const fq_ctx_t ctx) |
| 101 | + void fq_trace(fmpz_t rop, const fq_t op, const fq_ctx_t ctx) |
| 102 | + void _fq_norm(fmpz_t rop, const fmpz_struct *op, slong len, const fq_ctx_t ctx) |
| 103 | + void fq_norm(fmpz_t rop, const fq_t op, const fq_ctx_t ctx) |
| 104 | + void _fq_frobenius(fmpz_struct *rop, const fmpz_struct *op, slong len, slong e, const fq_ctx_t ctx) |
| 105 | + void fq_frobenius(fq_t rop, const fq_t op, slong e, const fq_ctx_t ctx) |
| 106 | + int fq_multiplicative_order(fmpz_t ord, const fq_t op, const fq_ctx_t ctx) |
| 107 | + int fq_is_primitive(const fq_t op, const fq_ctx_t ctx) |
| 108 | + void fq_bit_pack(fmpz_t f, const fq_t op, flint_bitcnt_t bit_size, const fq_ctx_t ctx) |
| 109 | + void fq_bit_unpack(fq_t rop, const fmpz_t f, flint_bitcnt_t bit_size, const fq_ctx_t ctx) |
0 commit comments