# sage_setup: distribution = sagemath-flint
# distutils: libraries = flint
# distutils: depends = flint/nmod_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 nmod_mat_init(nmod_mat_t mat, slong rows, slong cols, mp_limb_t n) noexcept
    void nmod_mat_init_set(nmod_mat_t mat, const nmod_mat_t src) noexcept
    void nmod_mat_clear(nmod_mat_t mat) noexcept
    void nmod_mat_set(nmod_mat_t mat, const nmod_mat_t src) noexcept
    void nmod_mat_swap(nmod_mat_t mat1, nmod_mat_t mat2) noexcept
    void nmod_mat_swap_entrywise(nmod_mat_t mat1, nmod_mat_t mat2) noexcept
    mp_limb_t nmod_mat_get_entry(const nmod_mat_t mat, slong i, slong j) noexcept
    mp_limb_t * nmod_mat_entry_ptr(const nmod_mat_t mat, slong i, slong j) noexcept
    void nmod_mat_set_entry(nmod_mat_t mat, slong i, slong j, mp_limb_t x) noexcept
    slong nmod_mat_nrows(const nmod_mat_t mat) noexcept
    slong nmod_mat_ncols(const nmod_mat_t mat) noexcept
    void nmod_mat_zero(nmod_mat_t mat) noexcept
    bint nmod_mat_is_zero(const nmod_mat_t mat) noexcept
    void nmod_mat_window_init(nmod_mat_t window, const nmod_mat_t mat, slong r1, slong c1, slong r2, slong c2) noexcept
    void nmod_mat_window_clear(nmod_mat_t window) noexcept
    void nmod_mat_concat_vertical(nmod_mat_t res, const nmod_mat_t mat1, const nmod_mat_t mat2) noexcept
    void nmod_mat_concat_horizontal(nmod_mat_t res, const nmod_mat_t mat1, const nmod_mat_t mat2) noexcept
    void nmod_mat_print_pretty(const nmod_mat_t mat) noexcept
    int nmod_mat_fprint_pretty(FILE * file, const nmod_mat_t mat) noexcept
    int nmod_mat_print(const nmod_mat_t mat) noexcept
    int nmod_mat_fprint(FILE * f, const nmod_mat_t mat) noexcept
    void nmod_mat_randtest(nmod_mat_t mat, flint_rand_t state) noexcept
    void nmod_mat_randfull(nmod_mat_t mat, flint_rand_t state) noexcept
    int nmod_mat_randpermdiag(nmod_mat_t mat, flint_rand_t state, mp_srcptr diag, slong n) noexcept
    void nmod_mat_randrank(nmod_mat_t mat, flint_rand_t state, slong rank) noexcept
    void nmod_mat_randops(nmod_mat_t mat, slong count, flint_rand_t state) noexcept
    void nmod_mat_randtril(nmod_mat_t mat, flint_rand_t state, int unit) noexcept
    void nmod_mat_randtriu(nmod_mat_t mat, flint_rand_t state, int unit) noexcept
    bint nmod_mat_equal(const nmod_mat_t mat1, const nmod_mat_t mat2) noexcept
    bint nmod_mat_is_zero_row(const nmod_mat_t mat, slong i) noexcept
    void nmod_mat_transpose(nmod_mat_t B, const nmod_mat_t A) noexcept
    void nmod_mat_swap_rows(nmod_mat_t mat, slong * perm, slong r, slong s) noexcept
    void nmod_mat_swap_cols(nmod_mat_t mat, slong * perm, slong r, slong s) noexcept
    void nmod_mat_invert_rows(nmod_mat_t mat, slong * perm) noexcept
    void nmod_mat_invert_cols(nmod_mat_t mat, slong * perm) noexcept
    void nmod_mat_permute_rows(nmod_mat_t mat, const slong * perm_act, slong * perm_store) noexcept
    void nmod_mat_add(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    void nmod_mat_sub(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    void nmod_mat_neg(nmod_mat_t A, const nmod_mat_t B) noexcept
    void nmod_mat_scalar_mul(nmod_mat_t B, const nmod_mat_t A, mp_limb_t c) noexcept
    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) noexcept
    void nmod_mat_scalar_mul_fmpz(nmod_mat_t res, const nmod_mat_t M, const fmpz_t c) noexcept
    void nmod_mat_mul(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    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) noexcept
    void nmod_mat_mul_classical(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    void _nmod_mat_mul_classical_threaded_pool_op(nmod_mat_t D, const nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B, int op, thread_pool_handle * threads, slong num_threads) noexcept
    void _nmod_mat_mul_classical_threaded_op(nmod_mat_t D, const nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B, int op) noexcept
    void nmod_mat_mul_classical_threaded(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    void nmod_mat_mul_strassen(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    int nmod_mat_mul_blas(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    void nmod_mat_addmul(nmod_mat_t D, const nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    void nmod_mat_submul(nmod_mat_t D, const nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B) noexcept
    void nmod_mat_mul_nmod_vec(mp_limb_t * c, const nmod_mat_t A, const mp_limb_t * b, slong blen) noexcept
    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) noexcept
    void nmod_mat_nmod_vec_mul(mp_limb_t * c, const mp_limb_t * a, slong alen, const nmod_mat_t B) noexcept
    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) noexcept
    void _nmod_mat_pow(nmod_mat_t dest, const nmod_mat_t mat, ulong pow) noexcept
    void nmod_mat_pow(nmod_mat_t dest, const nmod_mat_t mat, ulong pow) noexcept
    mp_limb_t nmod_mat_trace(const nmod_mat_t mat) noexcept
    mp_limb_t nmod_mat_det_howell(const nmod_mat_t A) noexcept
    mp_limb_t nmod_mat_det(const nmod_mat_t A) noexcept
    slong nmod_mat_rank(const nmod_mat_t A) noexcept
    int nmod_mat_inv(nmod_mat_t B, const nmod_mat_t A) noexcept
    void nmod_mat_solve_tril(nmod_mat_t X, const nmod_mat_t L, const nmod_mat_t B, int unit) noexcept
    void nmod_mat_solve_tril_classical(nmod_mat_t X, const nmod_mat_t L, const nmod_mat_t B, int unit) noexcept
    void nmod_mat_solve_tril_recursive(nmod_mat_t X, const nmod_mat_t L, const nmod_mat_t B, int unit) noexcept
    void nmod_mat_solve_triu(nmod_mat_t X, const nmod_mat_t U, const nmod_mat_t B, int unit) noexcept
    void nmod_mat_solve_triu_classical(nmod_mat_t X, const nmod_mat_t U, const nmod_mat_t B, int unit) noexcept
    void nmod_mat_solve_triu_recursive(nmod_mat_t X, const nmod_mat_t U, const nmod_mat_t B, int unit) noexcept
    int nmod_mat_solve(nmod_mat_t X, const nmod_mat_t A, const nmod_mat_t B) noexcept
    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) noexcept
    int nmod_mat_can_solve(nmod_mat_t X, const nmod_mat_t A, const nmod_mat_t B) noexcept
    int nmod_mat_solve_vec(mp_ptr x, const nmod_mat_t A, mp_srcptr b) noexcept
    slong nmod_mat_lu(slong * P, nmod_mat_t A, int rank_check) noexcept
    slong nmod_mat_lu_classical(slong * P, nmod_mat_t A, int rank_check) noexcept
    slong nmod_mat_lu_classical_delayed(slong * P, nmod_mat_t A, int rank_check) noexcept
    slong nmod_mat_lu_recursive(slong * P, nmod_mat_t A, int rank_check) noexcept
    slong nmod_mat_rref(nmod_mat_t A) noexcept
    slong nmod_mat_reduce_row(nmod_mat_t A, slong * P, slong * L, slong n) noexcept
    slong nmod_mat_nullspace(nmod_mat_t X, const nmod_mat_t A) noexcept
    void nmod_mat_similarity(nmod_mat_t M, slong r, ulong d) noexcept
    void nmod_mat_charpoly_berkowitz(nmod_poly_t p, const nmod_mat_t M) noexcept
    void nmod_mat_charpoly_danilevsky(nmod_poly_t p, const nmod_mat_t M) noexcept
    void nmod_mat_charpoly(nmod_poly_t p, const nmod_mat_t M) noexcept
    void nmod_mat_minpoly(nmod_poly_t p, const nmod_mat_t M) noexcept
    void nmod_mat_strong_echelon_form(nmod_mat_t A) noexcept
    slong nmod_mat_howell_form(nmod_mat_t A) noexcept
