flint-sys 0.9.0

Bindings to the FLINT C library
Documentation
/* automatically generated by rust-bindgen 0.70.1 */

use libc::*;
use crate::deps::*;
use crate::flint::*;
use crate::nmod_types::*;


pub const NMOD_MAT_MUL_TRANSPOSE_CUTOFF: u32 = 20;
pub const NMOD_MAT_SOLVE_TRI_ROWS_CUTOFF: u32 = 64;
pub const NMOD_MAT_SOLVE_TRI_COLS_CUTOFF: u32 = 64;
pub const NMOD_MAT_OPTIMAL_MODULUS_BITS: u32 = 59;
extern "C" {
    #[link_name = "nmod_mat_get_entry__extern"]
    pub fn nmod_mat_get_entry(mat: *const nmod_mat_struct, i: slong, j: slong) -> ulong;
    #[link_name = "nmod_mat_entry_ptr__extern"]
    pub fn nmod_mat_entry_ptr(mat: *const nmod_mat_struct, i: slong, j: slong) -> *mut ulong;
    #[link_name = "nmod_mat_row_ptr__extern"]
    pub fn nmod_mat_row_ptr(mat: *const nmod_mat_struct, i: slong) -> *mut ulong;
    #[link_name = "nmod_mat_nrows__extern"]
    pub fn nmod_mat_nrows(mat: *const nmod_mat_struct) -> slong;
    #[link_name = "nmod_mat_ncols__extern"]
    pub fn nmod_mat_ncols(mat: *const nmod_mat_struct) -> slong;
    pub fn nmod_mat_set_mod(mat: *mut nmod_mat_struct, n: ulong);
    #[link_name = "nmod_mat_mod__extern"]
    pub fn nmod_mat_mod(mat: *const nmod_mat_struct) -> nmod_t;
    pub fn nmod_mat_init(mat: *mut nmod_mat_struct, rows: slong, cols: slong, n: ulong);
    pub fn nmod_mat_init_set(mat: *mut nmod_mat_struct, src: *const nmod_mat_struct);
    pub fn nmod_mat_clear(mat: *mut nmod_mat_struct);
    pub fn nmod_mat_one(mat: *mut nmod_mat_struct);
    pub fn nmod_mat_swap(mat1: *mut nmod_mat_struct, mat2: *mut nmod_mat_struct);
    #[link_name = "nmod_mat_swap_entrywise__extern"]
    pub fn nmod_mat_swap_entrywise(mat1: *mut nmod_mat_struct, mat2: *mut nmod_mat_struct);
    #[link_name = "nmod_mat_window_init__extern"]
    pub fn nmod_mat_window_init(
        window: *mut nmod_mat_struct,
        mat: *const nmod_mat_struct,
        r1: slong,
        c1: slong,
        r2: slong,
        c2: slong,
    );
    #[link_name = "nmod_mat_window_clear__extern"]
    pub fn nmod_mat_window_clear(UNUSED_window: *mut nmod_mat_struct);
    pub fn nmod_mat_concat_horizontal(
        res: *mut nmod_mat_struct,
        mat1: *const nmod_mat_struct,
        mat2: *const nmod_mat_struct,
    );
    pub fn nmod_mat_concat_vertical(
        res: *mut nmod_mat_struct,
        mat1: *const nmod_mat_struct,
        mat2: *const nmod_mat_struct,
    );
    pub fn nmod_mat_randtest(mat: *mut nmod_mat_struct, state: *mut flint_rand_struct);
    pub fn nmod_mat_randfull(mat: *mut nmod_mat_struct, state: *mut flint_rand_struct);
    pub fn nmod_mat_rand(mat: *mut nmod_mat_struct, state: *mut flint_rand_struct);
    pub fn nmod_mat_randpermdiag(
        mat: *mut nmod_mat_struct,
        state: *mut flint_rand_struct,
        diag: nn_srcptr,
        n: slong,
    ) -> libc::c_int;
    pub fn nmod_mat_randrank(mat: *mut nmod_mat_struct, state: *mut flint_rand_struct, rank: slong);
    pub fn nmod_mat_randops(mat: *mut nmod_mat_struct, state: *mut flint_rand_struct, count: slong);
    pub fn nmod_mat_randtril(
        mat: *mut nmod_mat_struct,
        state: *mut flint_rand_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_randtriu(
        mat: *mut nmod_mat_struct,
        state: *mut flint_rand_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_fprint_pretty(file: *mut FILE, mat: *const nmod_mat_struct) -> libc::c_int;
    pub fn nmod_mat_fprint(f: *mut FILE, mat: *const nmod_mat_struct) -> libc::c_int;
    pub fn nmod_mat_print_pretty(mat: *const nmod_mat_struct);
    pub fn nmod_mat_print(mat: *const nmod_mat_struct) -> libc::c_int;
    pub fn nmod_mat_equal(
        mat1: *const nmod_mat_struct,
        mat2: *const nmod_mat_struct,
    ) -> libc::c_int;
    pub fn nmod_mat_zero(mat: *mut nmod_mat_struct);
    pub fn nmod_mat_is_zero(mat: *const nmod_mat_struct) -> libc::c_int;
    pub fn nmod_mat_is_one(mat: *const nmod_mat_struct) -> libc::c_int;
    pub fn nmod_mat_is_zero_row(mat: *const nmod_mat_struct, i: slong) -> libc::c_int;
    #[link_name = "nmod_mat_is_empty__extern"]
    pub fn nmod_mat_is_empty(mat: *const nmod_mat_struct) -> libc::c_int;
    #[link_name = "nmod_mat_is_square__extern"]
    pub fn nmod_mat_is_square(mat: *const nmod_mat_struct) -> libc::c_int;
    pub fn nmod_mat_set(B: *mut nmod_mat_struct, A: *const nmod_mat_struct);
    pub fn nmod_mat_transpose(B: *mut nmod_mat_struct, A: *const nmod_mat_struct);
    pub fn nmod_mat_add(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn nmod_mat_sub(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn nmod_mat_neg(B: *mut nmod_mat_struct, A: *const nmod_mat_struct);
    pub fn _nmod_mat_scalar_mul_generic(
        B: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        c: ulong,
    );
    pub fn _nmod_mat_scalar_mul_precomp(
        B: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        c: ulong,
        c_pr: ulong,
    );
    pub fn nmod_mat_scalar_mul(B: *mut nmod_mat_struct, A: *const nmod_mat_struct, c: ulong);
    pub fn nmod_mat_scalar_mul_fmpz(
        B: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        c: *const fmpz,
    );
    pub fn _nmod_mat_scalar_addmul_ui_generic(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        c: ulong,
    );
    pub fn _nmod_mat_scalar_addmul_ui_precomp(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        c: ulong,
        c_pr: ulong,
    );
    pub fn nmod_mat_scalar_addmul_ui(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        c: ulong,
    );
    pub fn nmod_mat_mul(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn nmod_mat_mul_blas(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    ) -> libc::c_int;
    pub fn nmod_mat_mul_classical(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn _nmod_mat_mul_classical_threaded_pool_op(
        D: *mut nmod_mat_struct,
        C: *const nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        op: libc::c_int,
        threads: *mut thread_pool_handle,
        num_threads: slong,
    );
    pub fn nmod_mat_mul_classical_threaded(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn nmod_mat_mul_strassen(
        C: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn _nmod_mat_mul_classical_op(
        D: *mut nmod_mat_struct,
        C: *const nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        op: libc::c_int,
    );
    pub fn nmod_mat_addmul(
        D: *mut nmod_mat_struct,
        C: *const nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn nmod_mat_submul(
        D: *mut nmod_mat_struct,
        C: *const nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    );
    pub fn nmod_mat_mul_nmod_vec(
        c: *mut ulong,
        A: *const nmod_mat_struct,
        b: *const ulong,
        blen: slong,
    );
    pub fn nmod_mat_mul_nmod_vec_ptr(
        c: *const *mut ulong,
        A: *const nmod_mat_struct,
        b: *const *const ulong,
        blen: slong,
    );
    pub fn nmod_mat_nmod_vec_mul(
        c: *mut ulong,
        a: *const ulong,
        alen: slong,
        B: *const nmod_mat_struct,
    );
    pub fn nmod_mat_nmod_vec_mul_ptr(
        c: *const *mut ulong,
        a: *const *const ulong,
        alen: slong,
        B: *const nmod_mat_struct,
    );
    pub fn _nmod_mat_pow(dest: *mut nmod_mat_struct, mat: *const nmod_mat_struct, pow: ulong);
    pub fn nmod_mat_pow(dest: *mut nmod_mat_struct, mat: *const nmod_mat_struct, pow: ulong);
    pub fn nmod_mat_trace(mat: *const nmod_mat_struct) -> ulong;
    pub fn _nmod_mat_det(A: *mut nmod_mat_struct) -> ulong;
    pub fn nmod_mat_det(A: *const nmod_mat_struct) -> ulong;
    pub fn _nmod_mat_det_howell(A: *mut nmod_mat_struct) -> ulong;
    pub fn nmod_mat_det_howell(A: *const nmod_mat_struct) -> ulong;
    pub fn nmod_mat_rank(A: *const nmod_mat_struct) -> slong;
    pub fn nmod_mat_inv(B: *mut nmod_mat_struct, A: *const nmod_mat_struct) -> libc::c_int;
    #[link_name = "nmod_mat_swap_rows__extern"]
    pub fn nmod_mat_swap_rows(mat: *mut nmod_mat_struct, perm: *mut slong, r: slong, s: slong);
    #[link_name = "nmod_mat_invert_rows__extern"]
    pub fn nmod_mat_invert_rows(mat: *mut nmod_mat_struct, perm: *mut slong);
    #[link_name = "nmod_mat_swap_cols__extern"]
    pub fn nmod_mat_swap_cols(mat: *mut nmod_mat_struct, perm: *mut slong, r: slong, s: slong);
    #[link_name = "nmod_mat_invert_cols__extern"]
    pub fn nmod_mat_invert_cols(mat: *mut nmod_mat_struct, perm: *mut slong);
    pub fn nmod_mat_permute_rows(
        mat: *mut nmod_mat_struct,
        perm_act: *const slong,
        perm_store: *mut slong,
    );
    pub fn nmod_mat_solve_tril(
        X: *mut nmod_mat_struct,
        L: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_solve_tril_recursive(
        X: *mut nmod_mat_struct,
        L: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_solve_tril_classical(
        X: *mut nmod_mat_struct,
        L: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_solve_triu(
        X: *mut nmod_mat_struct,
        U: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_solve_triu_recursive(
        X: *mut nmod_mat_struct,
        U: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_solve_triu_classical(
        X: *mut nmod_mat_struct,
        U: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
        unit: libc::c_int,
    );
    pub fn nmod_mat_lu(P: *mut slong, A: *mut nmod_mat_struct, rank_check: libc::c_int) -> slong;
    pub fn nmod_mat_lu_classical(
        P: *mut slong,
        A: *mut nmod_mat_struct,
        rank_check: libc::c_int,
    ) -> slong;
    pub fn nmod_mat_lu_classical_delayed(
        P: *mut slong,
        A: *mut nmod_mat_struct,
        rank_check: libc::c_int,
    ) -> slong;
    pub fn nmod_mat_lu_recursive(
        P: *mut slong,
        A: *mut nmod_mat_struct,
        rank_check: libc::c_int,
    ) -> slong;
    pub fn nmod_mat_solve(
        X: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    ) -> libc::c_int;
    pub fn nmod_mat_solve_vec(x: nn_ptr, A: *const nmod_mat_struct, b: nn_srcptr) -> libc::c_int;
    pub fn nmod_mat_can_solve_inner(
        rank: *mut slong,
        prm: *mut slong,
        piv: *mut slong,
        X: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    ) -> libc::c_int;
    pub fn nmod_mat_can_solve(
        X: *mut nmod_mat_struct,
        A: *const nmod_mat_struct,
        B: *const nmod_mat_struct,
    ) -> libc::c_int;
    pub fn nmod_mat_rref(A: *mut nmod_mat_struct) -> slong;
    pub fn _nmod_mat_rref(
        A: *mut nmod_mat_struct,
        pivots_nonpivots: *mut slong,
        P: *mut slong,
    ) -> slong;
    pub fn nmod_mat_rref_classical(A: *mut nmod_mat_struct) -> slong;
    pub fn _nmod_mat_rref_classical(A: *mut nmod_mat_struct, pivots_nonpivots: *mut slong)
        -> slong;
    pub fn nmod_mat_rref_storjohann(A: *mut nmod_mat_struct) -> slong;
    pub fn _nmod_mat_rref_storjohann(
        A: *mut nmod_mat_struct,
        pivots_nonpivots: *mut slong,
    ) -> slong;
    pub fn nmod_mat_reduce_row(
        M: *mut nmod_mat_struct,
        P: *mut slong,
        L: *mut slong,
        m: slong,
    ) -> slong;
    pub fn nmod_mat_nullspace(X: *mut nmod_mat_struct, A: *const nmod_mat_struct) -> slong;
    pub fn nmod_mat_left_nullspace(X: *mut nmod_mat_struct, A: *const nmod_mat_struct) -> slong;
    pub fn nmod_mat_strong_echelon_form(A: *mut nmod_mat_struct);
    pub fn nmod_mat_howell_form(A: *mut nmod_mat_struct) -> slong;
    pub fn nmod_mat_similarity(M: *mut nmod_mat_struct, r: slong, d: ulong);
    pub fn nmod_mat_set_entry(mat: *mut nmod_mat_struct, i: slong, j: slong, x: ulong);
}