# distutils: libraries = flint
# distutils: depends = flint/fq.h

################################################################################
# This file is auto-generated by the script
#   SAGE_ROOT/tools/flint-autogen/flint_autogen.py.
# From the commit 3e2c3a3e091106a25ca9c6fba28e02f2cbcd654a
# Do not modify by hand! Fix and rerun the script instead.
################################################################################

from libc.stdio cimport FILE
from sage.libs.gmp.types cimport *
from sage.libs.mpfr.types cimport *
from sage.libs.flint.types cimport *

cdef extern from "flint_wrap.h":
    void fq_ctx_init(fq_ctx_t ctx, const fmpz_t p, slong d, const char * var) noexcept
    int _fq_ctx_init_conway(fq_ctx_t ctx, const fmpz_t p, slong d, const char * var) noexcept
    void fq_ctx_init_conway(fq_ctx_t ctx, const fmpz_t p, slong d, const char * var) noexcept
    void fq_ctx_init_modulus(fq_ctx_t ctx, const fmpz_mod_poly_t modulus, const fmpz_mod_ctx_t ctxp, const char * var) noexcept
    void fq_ctx_clear(fq_ctx_t ctx) noexcept
    const fmpz_mod_poly_struct* fq_ctx_modulus(const fq_ctx_t ctx) noexcept
    slong fq_ctx_degree(const fq_ctx_t ctx) noexcept
    const fmpz * fq_ctx_prime(const fq_ctx_t ctx) noexcept
    void fq_ctx_order(fmpz_t f, const fq_ctx_t ctx) noexcept
    int fq_ctx_fprint(FILE * file, const fq_ctx_t ctx) noexcept
    void fq_ctx_print(const fq_ctx_t ctx) noexcept
    void fq_ctx_randtest(fq_ctx_t ctx, flint_rand_t state) noexcept
    void fq_ctx_randtest_reducible(fq_ctx_t ctx, flint_rand_t state) noexcept
    void fq_init(fq_t rop, const fq_ctx_t ctx) noexcept
    void fq_init2(fq_t rop, const fq_ctx_t ctx) noexcept
    void fq_clear(fq_t rop, const fq_ctx_t ctx) noexcept
    void _fq_sparse_reduce(fmpz * R, slong lenR, const fq_ctx_t ctx) noexcept
    void _fq_dense_reduce(fmpz * R, slong lenR, const fq_ctx_t ctx) noexcept
    void _fq_reduce(fmpz * r, slong lenR, const fq_ctx_t ctx) noexcept
    void fq_reduce(fq_t rop, const fq_ctx_t ctx) noexcept
    void fq_add(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) noexcept
    void fq_sub(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) noexcept
    void fq_sub_one(fq_t rop, const fq_t op1, const fq_ctx_t ctx) noexcept
    void fq_neg(fq_t rop, const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_mul(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) noexcept
    void fq_mul_fmpz(fq_t rop, const fq_t op, const fmpz_t x, const fq_ctx_t ctx) noexcept
    void fq_mul_si(fq_t rop, const fq_t op, slong x, const fq_ctx_t ctx) noexcept
    void fq_mul_ui(fq_t rop, const fq_t op, ulong x, const fq_ctx_t ctx) noexcept
    void fq_sqr(fq_t rop, const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_div(fq_t rop, const fq_t op1, const fq_t op2, const fq_ctx_t ctx) noexcept
    void _fq_inv(fmpz * rop, const fmpz * op, slong len, const fq_ctx_t ctx) noexcept
    void fq_inv(fq_t rop, const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_gcdinv(fq_t f, fq_t inv, const fq_t op, const fq_ctx_t ctx) noexcept
    void _fq_pow(fmpz * rop, const fmpz * op, slong len, const fmpz_t e, const fq_ctx_t ctx) noexcept
    void fq_pow(fq_t rop, const fq_t op, const fmpz_t e, const fq_ctx_t ctx) noexcept
    void fq_pow_ui(fq_t rop, const fq_t op, const ulong e, const fq_ctx_t ctx) noexcept
    int fq_sqrt(fq_t rop, const fq_t op1, const fq_ctx_t ctx) noexcept
    void fq_pth_root(fq_t rop, const fq_t op1, const fq_ctx_t ctx) noexcept
    bint fq_is_square(const fq_t op, const fq_ctx_t ctx) noexcept
    int fq_fprint_pretty(FILE * file, const fq_t op, const fq_ctx_t ctx) noexcept
    int fq_print_pretty(const fq_t op, const fq_ctx_t ctx) noexcept
    int fq_fprint(FILE * file, const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_print(const fq_t op, const fq_ctx_t ctx) noexcept
    char * fq_get_str(const fq_t op, const fq_ctx_t ctx) noexcept
    char * fq_get_str_pretty(const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_randtest(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) noexcept
    void fq_randtest_not_zero(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) noexcept
    void fq_randtest_dense(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) noexcept
    void fq_rand(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) noexcept
    void fq_rand_not_zero(fq_t rop, flint_rand_t state, const fq_ctx_t ctx) noexcept
    void fq_set(fq_t rop, const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_set_si(fq_t rop, const slong x, const fq_ctx_t ctx) noexcept
    void fq_set_ui(fq_t rop, const ulong x, const fq_ctx_t ctx) noexcept
    void fq_set_fmpz(fq_t rop, const fmpz_t x, const fq_ctx_t ctx) noexcept
    void fq_swap(fq_t op1, fq_t op2, const fq_ctx_t ctx) noexcept
    void fq_zero(fq_t rop, const fq_ctx_t ctx) noexcept
    void fq_one(fq_t rop, const fq_ctx_t ctx) noexcept
    void fq_gen(fq_t rop, const fq_ctx_t ctx) noexcept
    int fq_get_fmpz(fmpz_t rop, const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_get_fmpz_poly(fmpz_poly_t a, const fq_t b, const fq_ctx_t ctx) noexcept
    void fq_get_fmpz_mod_poly(fmpz_mod_poly_t a, const fq_t b, const fq_ctx_t ctx) noexcept
    void fq_set_fmpz_poly(fq_t a, const fmpz_poly_t b, const fq_ctx_t ctx) noexcept
    void fq_set_fmpz_mod_poly(fq_t a, const fmpz_mod_poly_t b, const fq_ctx_t ctx) noexcept
    void fq_get_fmpz_mod_mat(fmpz_mod_mat_t col, const fq_t a, const fq_ctx_t ctx) noexcept
    void fq_set_fmpz_mod_mat(fq_t a, const fmpz_mod_mat_t col, const fq_ctx_t ctx) noexcept
    bint fq_is_zero(const fq_t op, const fq_ctx_t ctx) noexcept
    bint fq_is_one(const fq_t op, const fq_ctx_t ctx) noexcept
    bint fq_equal(const fq_t op1, const fq_t op2, const fq_ctx_t ctx) noexcept
    bint fq_is_invertible(const fq_t op, const fq_ctx_t ctx) noexcept
    bint fq_is_invertible_f(fq_t f, const fq_t op, const fq_ctx_t ctx) noexcept
    void _fq_trace(fmpz_t rop, const fmpz * op, slong len, const fq_ctx_t ctx) noexcept
    void fq_trace(fmpz_t rop, const fq_t op, const fq_ctx_t ctx) noexcept
    void _fq_norm(fmpz_t rop, const fmpz * op, slong len, const fq_ctx_t ctx) noexcept
    void fq_norm(fmpz_t rop, const fq_t op, const fq_ctx_t ctx) noexcept
    void _fq_frobenius(fmpz * rop, const fmpz * op, slong len, slong e, const fq_ctx_t ctx) noexcept
    void fq_frobenius(fq_t rop, const fq_t op, slong e, const fq_ctx_t ctx) noexcept
    int fq_multiplicative_order(fmpz * ord, const fq_t op, const fq_ctx_t ctx) noexcept
    bint fq_is_primitive(const fq_t op, const fq_ctx_t ctx) noexcept
    void fq_bit_pack(fmpz_t f, const fq_t op, flint_bitcnt_t bit_size, const fq_ctx_t ctx) noexcept
    void fq_bit_unpack(fq_t rop, const fmpz_t f, flint_bitcnt_t bit_size, const fq_ctx_t ctx) noexcept
