# distutils: libraries = flint
# distutils: depends = flint/nmod_poly_mat.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 nmod_poly_mat_init(nmod_poly_mat_t mat, slong rows, slong cols, mp_limb_t n) noexcept
    void nmod_poly_mat_init_set(nmod_poly_mat_t mat, const nmod_poly_mat_t src) noexcept
    void nmod_poly_mat_clear(nmod_poly_mat_t mat) noexcept
    void nmod_poly_mat_set_trunc(nmod_poly_mat_t res, const nmod_poly_mat_t pmat, long len) noexcept
    void nmod_poly_mat_truncate(nmod_poly_mat_t pmat, long len) noexcept
    void nmod_poly_mat_shift_left(nmod_poly_mat_t res, const nmod_poly_mat_t pmat, slong k) noexcept
    void nmod_poly_mat_shift_right(nmod_poly_mat_t res, const nmod_poly_mat_t pmat, slong k) noexcept
    slong nmod_poly_mat_nrows(const nmod_poly_mat_t mat) noexcept
    slong nmod_poly_mat_ncols(const nmod_poly_mat_t mat) noexcept
    mp_limb_t nmod_poly_mat_modulus(const nmod_poly_mat_t mat) noexcept
    nmod_poly_struct * nmod_poly_mat_entry(const nmod_poly_mat_t mat, slong i, slong j) noexcept
    void nmod_poly_mat_set(nmod_poly_mat_t mat1, const nmod_poly_mat_t mat2) noexcept
    void nmod_poly_mat_set_nmod_mat(nmod_poly_mat_t pmat, const nmod_mat_t cmat) noexcept
    void nmod_poly_mat_swap(nmod_poly_mat_t mat1, nmod_poly_mat_t mat2) noexcept
    void nmod_poly_mat_swap_entrywise(nmod_poly_mat_t mat1, nmod_poly_mat_t mat2) noexcept
    void nmod_poly_mat_print(const nmod_poly_mat_t mat, const char * x) noexcept
    void nmod_poly_mat_randtest(nmod_poly_mat_t mat, flint_rand_t state, slong len) noexcept
    void nmod_poly_mat_randtest_sparse(nmod_poly_mat_t A, flint_rand_t state, slong len, float density) noexcept
    void nmod_poly_mat_zero(nmod_poly_mat_t mat) noexcept
    void nmod_poly_mat_one(nmod_poly_mat_t mat) noexcept
    bint nmod_poly_mat_equal(const nmod_poly_mat_t mat1, const nmod_poly_mat_t mat2) noexcept
    bint nmod_poly_mat_equal_nmod_mat(const nmod_poly_mat_t pmat, const nmod_mat_t cmat) noexcept
    bint nmod_poly_mat_is_zero(const nmod_poly_mat_t mat) noexcept
    bint nmod_poly_mat_is_one(const nmod_poly_mat_t mat) noexcept
    bint nmod_poly_mat_is_empty(const nmod_poly_mat_t mat) noexcept
    bint nmod_poly_mat_is_square(const nmod_poly_mat_t mat) noexcept
    void nmod_poly_mat_get_coeff_mat(nmod_mat_t coeff, const nmod_poly_mat_t pmat, slong deg) noexcept
    void nmod_poly_mat_set_coeff_mat(nmod_poly_mat_t pmat, const nmod_mat_t coeff, slong deg) noexcept
    slong nmod_poly_mat_max_length(const nmod_poly_mat_t A) noexcept
    slong nmod_poly_mat_degree(const nmod_poly_mat_t pmat) noexcept
    void nmod_poly_mat_evaluate_nmod(nmod_mat_t B, const nmod_poly_mat_t A, mp_limb_t x) noexcept
    void nmod_poly_mat_scalar_mul_nmod_poly(nmod_poly_mat_t B, const nmod_poly_mat_t A, const nmod_poly_t c) noexcept
    void nmod_poly_mat_scalar_mul_nmod(nmod_poly_mat_t B, const nmod_poly_mat_t A, mp_limb_t c) noexcept
    void nmod_poly_mat_add(nmod_poly_mat_t C, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    void nmod_poly_mat_sub(nmod_poly_mat_t C, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    void nmod_poly_mat_neg(nmod_poly_mat_t B, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_mul(nmod_poly_mat_t C, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    void nmod_poly_mat_mul_classical(nmod_poly_mat_t C, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    void nmod_poly_mat_mul_KS(nmod_poly_mat_t C, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    void nmod_poly_mat_mul_interpolate(nmod_poly_mat_t C, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    void nmod_poly_mat_sqr(nmod_poly_mat_t B, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_sqr_classical(nmod_poly_mat_t B, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_sqr_KS(nmod_poly_mat_t B, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_sqr_interpolate(nmod_poly_mat_t B, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_pow(nmod_poly_mat_t B, const nmod_poly_mat_t A, ulong exp) noexcept
    slong nmod_poly_mat_find_pivot_any(const nmod_poly_mat_t mat, slong start_row, slong end_row, slong c) noexcept
    slong nmod_poly_mat_find_pivot_partial(const nmod_poly_mat_t mat, slong start_row, slong end_row, slong c) noexcept
    slong nmod_poly_mat_fflu(nmod_poly_mat_t B, nmod_poly_t den, slong * perm, const nmod_poly_mat_t A, int rank_check) noexcept
    slong nmod_poly_mat_rref(nmod_poly_mat_t B, nmod_poly_t den, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_trace(nmod_poly_t trace, const nmod_poly_mat_t mat) noexcept
    void nmod_poly_mat_det(nmod_poly_t det, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_det_fflu(nmod_poly_t det, const nmod_poly_mat_t A) noexcept
    void nmod_poly_mat_det_interpolate(nmod_poly_t det, const nmod_poly_mat_t A) noexcept
    slong nmod_poly_mat_rank(const nmod_poly_mat_t A) noexcept
    int nmod_poly_mat_inv(nmod_poly_mat_t Ainv, nmod_poly_t den, const nmod_poly_mat_t A) noexcept
    slong nmod_poly_mat_nullspace(nmod_poly_mat_t res, const nmod_poly_mat_t mat) noexcept
    int nmod_poly_mat_solve(nmod_poly_mat_t X, nmod_poly_t den, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    int nmod_poly_mat_solve_fflu(nmod_poly_mat_t X, nmod_poly_t den, const nmod_poly_mat_t A, const nmod_poly_mat_t B) noexcept
    void nmod_poly_mat_solve_fflu_precomp(nmod_poly_mat_t X, const slong * perm, const nmod_poly_mat_t FFLU, const nmod_poly_mat_t B) noexcept
