# sage_setup: distribution = sagemath-flint
# distutils: libraries = flint
# distutils: depends = flint/fmpz_poly_mat.h

################################################################################
# This file is auto-generated by the script
#   SAGE_ROOT/src/sage_setup/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 fmpz_poly_mat_init(fmpz_poly_mat_t mat, slong rows, slong cols) noexcept
    void fmpz_poly_mat_init_set(fmpz_poly_mat_t mat, const fmpz_poly_mat_t src) noexcept
    void fmpz_poly_mat_clear(fmpz_poly_mat_t mat) noexcept
    slong fmpz_poly_mat_nrows(const fmpz_poly_mat_t mat) noexcept
    slong fmpz_poly_mat_ncols(const fmpz_poly_mat_t mat) noexcept
    fmpz_poly_struct * fmpz_poly_mat_entry(const fmpz_poly_mat_t mat, slong i, slong j) noexcept
    void fmpz_poly_mat_set(fmpz_poly_mat_t mat1, const fmpz_poly_mat_t mat2) noexcept
    void fmpz_poly_mat_swap(fmpz_poly_mat_t mat1, fmpz_poly_mat_t mat2) noexcept
    void fmpz_poly_mat_swap_entrywise(fmpz_poly_mat_t mat1, fmpz_poly_mat_t mat2) noexcept
    void fmpz_poly_mat_print(const fmpz_poly_mat_t mat, const char * x) noexcept
    void fmpz_poly_mat_randtest(fmpz_poly_mat_t mat, flint_rand_t state, slong len, flint_bitcnt_t bits) noexcept
    void fmpz_poly_mat_randtest_unsigned(fmpz_poly_mat_t mat, flint_rand_t state, slong len, flint_bitcnt_t bits) noexcept
    void fmpz_poly_mat_randtest_sparse(fmpz_poly_mat_t A, flint_rand_t state, slong len, flint_bitcnt_t bits, float density) noexcept
    void fmpz_poly_mat_zero(fmpz_poly_mat_t mat) noexcept
    void fmpz_poly_mat_one(fmpz_poly_mat_t mat) noexcept
    bint fmpz_poly_mat_equal(const fmpz_poly_mat_t mat1, const fmpz_poly_mat_t mat2) noexcept
    bint fmpz_poly_mat_is_zero(const fmpz_poly_mat_t mat) noexcept
    bint fmpz_poly_mat_is_one(const fmpz_poly_mat_t mat) noexcept
    bint fmpz_poly_mat_is_empty(const fmpz_poly_mat_t mat) noexcept
    bint fmpz_poly_mat_is_square(const fmpz_poly_mat_t mat) noexcept
    slong fmpz_poly_mat_max_bits(const fmpz_poly_mat_t A) noexcept
    slong fmpz_poly_mat_max_length(const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_transpose(fmpz_poly_mat_t B, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_evaluate_fmpz(fmpz_mat_t B, const fmpz_poly_mat_t A, const fmpz_t x) noexcept
    void fmpz_poly_mat_scalar_mul_fmpz_poly(fmpz_poly_mat_t B, const fmpz_poly_mat_t A, const fmpz_poly_t c) noexcept
    void fmpz_poly_mat_scalar_mul_fmpz(fmpz_poly_mat_t B, const fmpz_poly_mat_t A, const fmpz_t c) noexcept
    void fmpz_poly_mat_add(fmpz_poly_mat_t C, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B) noexcept
    void fmpz_poly_mat_sub(fmpz_poly_mat_t C, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B) noexcept
    void fmpz_poly_mat_neg(fmpz_poly_mat_t B, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_mul(fmpz_poly_mat_t C, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B) noexcept
    void fmpz_poly_mat_mul_classical(fmpz_poly_mat_t C, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B) noexcept
    void fmpz_poly_mat_mul_KS(fmpz_poly_mat_t C, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B) noexcept
    void fmpz_poly_mat_mullow(fmpz_poly_mat_t C, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B, slong len) noexcept
    void fmpz_poly_mat_sqr(fmpz_poly_mat_t B, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_sqr_classical(fmpz_poly_mat_t B, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_sqr_KS(fmpz_poly_mat_t B, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_sqrlow(fmpz_poly_mat_t B, const fmpz_poly_mat_t A, slong len) noexcept
    void fmpz_poly_mat_pow(fmpz_poly_mat_t B, const fmpz_poly_mat_t A, ulong exp) noexcept
    void fmpz_poly_mat_pow_trunc(fmpz_poly_mat_t B, const fmpz_poly_mat_t A, ulong exp, slong len) noexcept
    void fmpz_poly_mat_prod(fmpz_poly_mat_t res, fmpz_poly_mat_t * const factors, slong n) noexcept
    slong fmpz_poly_mat_find_pivot_any(const fmpz_poly_mat_t mat, slong start_row, slong end_row, slong c) noexcept
    slong fmpz_poly_mat_find_pivot_partial(const fmpz_poly_mat_t mat, slong start_row, slong end_row, slong c) noexcept
    slong fmpz_poly_mat_fflu(fmpz_poly_mat_t B, fmpz_poly_t den, slong * perm, const fmpz_poly_mat_t A, int rank_check) noexcept
    slong fmpz_poly_mat_rref(fmpz_poly_mat_t B, fmpz_poly_t den, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_trace(fmpz_poly_t trace, const fmpz_poly_mat_t mat) noexcept
    void fmpz_poly_mat_det(fmpz_poly_t det, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_det_fflu(fmpz_poly_t det, const fmpz_poly_mat_t A) noexcept
    void fmpz_poly_mat_det_interpolate(fmpz_poly_t det, const fmpz_poly_mat_t A) noexcept
    slong fmpz_poly_mat_rank(const fmpz_poly_mat_t A) noexcept
    int fmpz_poly_mat_inv(fmpz_poly_mat_t Ainv, fmpz_poly_t den, const fmpz_poly_mat_t A) noexcept
    slong fmpz_poly_mat_nullspace(fmpz_poly_mat_t res, const fmpz_poly_mat_t mat) noexcept
    int fmpz_poly_mat_solve(fmpz_poly_mat_t X, fmpz_poly_t den, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B) noexcept
    int fmpz_poly_mat_solve_fflu(fmpz_poly_mat_t X, fmpz_poly_t den, const fmpz_poly_mat_t A, const fmpz_poly_mat_t B) noexcept
    void fmpz_poly_mat_solve_fflu_precomp(fmpz_poly_mat_t X, const slong * perm, const fmpz_poly_mat_t FFLU, const fmpz_poly_mat_t B) noexcept
