flint-sys 0.9.0

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

use crate::deps::*;
use crate::dlog::*;
use crate::flint::*;


pub const MAX_FACTORS: u32 = 15;
#[repr(C)]
pub struct dirichlet_prime_group_struct {
    pub p: ulong,
    pub e: libc::c_int,
    pub pe: nmod_t,
    pub phi: nmod_t,
    pub g: ulong,
    pub dlog: *mut dlog_precomp_struct,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of dirichlet_prime_group_struct"]
        [::std::mem::size_of::<dirichlet_prime_group_struct>() - 80usize];
    ["Alignment of dirichlet_prime_group_struct"]
        [::std::mem::align_of::<dirichlet_prime_group_struct>() - 8usize];
    ["Offset of field: dirichlet_prime_group_struct::p"]
        [::std::mem::offset_of!(dirichlet_prime_group_struct, p) - 0usize];
    ["Offset of field: dirichlet_prime_group_struct::e"]
        [::std::mem::offset_of!(dirichlet_prime_group_struct, e) - 8usize];
    ["Offset of field: dirichlet_prime_group_struct::pe"]
        [::std::mem::offset_of!(dirichlet_prime_group_struct, pe) - 16usize];
    ["Offset of field: dirichlet_prime_group_struct::phi"]
        [::std::mem::offset_of!(dirichlet_prime_group_struct, phi) - 40usize];
    ["Offset of field: dirichlet_prime_group_struct::g"]
        [::std::mem::offset_of!(dirichlet_prime_group_struct, g) - 64usize];
    ["Offset of field: dirichlet_prime_group_struct::dlog"]
        [::std::mem::offset_of!(dirichlet_prime_group_struct, dlog) - 72usize];
};
impl Default for dirichlet_prime_group_struct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
pub struct dirichlet_group_struct {
    pub q: ulong,
    pub q_even: ulong,
    pub mod_: nmod_t,
    pub rad_q: ulong,
    pub phi_q: ulong,
    pub neven: slong,
    pub num: slong,
    pub expo: ulong,
    pub P: *mut dirichlet_prime_group_struct,
    pub generators: *mut ulong,
    pub PHI: *mut ulong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of dirichlet_group_struct"][::std::mem::size_of::<dirichlet_group_struct>() - 104usize];
    ["Alignment of dirichlet_group_struct"]
        [::std::mem::align_of::<dirichlet_group_struct>() - 8usize];
    ["Offset of field: dirichlet_group_struct::q"]
        [::std::mem::offset_of!(dirichlet_group_struct, q) - 0usize];
    ["Offset of field: dirichlet_group_struct::q_even"]
        [::std::mem::offset_of!(dirichlet_group_struct, q_even) - 8usize];
    ["Offset of field: dirichlet_group_struct::mod_"]
        [::std::mem::offset_of!(dirichlet_group_struct, mod_) - 16usize];
    ["Offset of field: dirichlet_group_struct::rad_q"]
        [::std::mem::offset_of!(dirichlet_group_struct, rad_q) - 40usize];
    ["Offset of field: dirichlet_group_struct::phi_q"]
        [::std::mem::offset_of!(dirichlet_group_struct, phi_q) - 48usize];
    ["Offset of field: dirichlet_group_struct::neven"]
        [::std::mem::offset_of!(dirichlet_group_struct, neven) - 56usize];
    ["Offset of field: dirichlet_group_struct::num"]
        [::std::mem::offset_of!(dirichlet_group_struct, num) - 64usize];
    ["Offset of field: dirichlet_group_struct::expo"]
        [::std::mem::offset_of!(dirichlet_group_struct, expo) - 72usize];
    ["Offset of field: dirichlet_group_struct::P"]
        [::std::mem::offset_of!(dirichlet_group_struct, P) - 80usize];
    ["Offset of field: dirichlet_group_struct::generators"]
        [::std::mem::offset_of!(dirichlet_group_struct, generators) - 88usize];
    ["Offset of field: dirichlet_group_struct::PHI"]
        [::std::mem::offset_of!(dirichlet_group_struct, PHI) - 96usize];
};
impl Default for dirichlet_group_struct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type dirichlet_group_t = [dirichlet_group_struct; 1usize];
#[repr(C)]
pub struct dirichlet_char_struct {
    pub n: ulong,
    pub log: *mut ulong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of dirichlet_char_struct"][::std::mem::size_of::<dirichlet_char_struct>() - 16usize];
    ["Alignment of dirichlet_char_struct"]
        [::std::mem::align_of::<dirichlet_char_struct>() - 8usize];
    ["Offset of field: dirichlet_char_struct::n"]
        [::std::mem::offset_of!(dirichlet_char_struct, n) - 0usize];
    ["Offset of field: dirichlet_char_struct::log"]
        [::std::mem::offset_of!(dirichlet_char_struct, log) - 8usize];
};
impl Default for dirichlet_char_struct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type dirichlet_char_t = [dirichlet_char_struct; 1usize];
extern "C" {
    #[link_name = "dirichlet_group_size__extern"]
    pub fn dirichlet_group_size(G: *const dirichlet_group_struct) -> ulong;
    pub fn dirichlet_group_num_primitive(G: *const dirichlet_group_struct) -> ulong;
    pub fn dirichlet_group_init(G: *mut dirichlet_group_struct, q: ulong) -> libc::c_int;
    pub fn dirichlet_subgroup_init(
        H: *mut dirichlet_group_struct,
        G: *const dirichlet_group_struct,
        h: ulong,
    );
    pub fn dirichlet_group_clear(G: *mut dirichlet_group_struct);
    pub fn dirichlet_group_dlog_precompute(G: *mut dirichlet_group_struct, num: ulong);
    pub fn dirichlet_group_dlog_clear(G: *mut dirichlet_group_struct);
    pub fn dirichlet_conductor_ui(G: *const dirichlet_group_struct, a: ulong) -> ulong;
    pub fn dirichlet_parity_ui(G: *const dirichlet_group_struct, a: ulong) -> libc::c_int;
    pub fn dirichlet_order_ui(G: *const dirichlet_group_struct, a: ulong) -> ulong;
    pub fn dirichlet_char_init(x: *mut dirichlet_char_struct, G: *const dirichlet_group_struct);
    pub fn dirichlet_char_clear(x: *mut dirichlet_char_struct);
    pub fn dirichlet_char_print(G: *const dirichlet_group_struct, x: *const dirichlet_char_struct);
    #[link_name = "dirichlet_char_set__extern"]
    pub fn dirichlet_char_set(
        x: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
        y: *const dirichlet_char_struct,
    );
    #[link_name = "dirichlet_char_eq__extern"]
    pub fn dirichlet_char_eq(
        x: *const dirichlet_char_struct,
        y: *const dirichlet_char_struct,
    ) -> libc::c_int;
    pub fn dirichlet_char_eq_deep(
        G: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
        y: *const dirichlet_char_struct,
    ) -> libc::c_int;
    pub fn dirichlet_parity_char(
        G: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
    ) -> libc::c_int;
    pub fn dirichlet_conductor_char(
        G: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
    ) -> ulong;
    pub fn dirichlet_order_char(
        G: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
    ) -> ulong;
    pub fn dirichlet_char_log(
        x: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
        m: ulong,
    );
    #[link_name = "dirichlet_char_exp__extern"]
    pub fn dirichlet_char_exp(
        G: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
    ) -> ulong;
    pub fn _dirichlet_char_exp(
        x: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
    ) -> ulong;
    pub fn dirichlet_char_index(
        x: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
        j: ulong,
    );
    pub fn dirichlet_index_char(
        G: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
    ) -> ulong;
    pub fn dirichlet_char_one(x: *mut dirichlet_char_struct, G: *const dirichlet_group_struct);
    pub fn dirichlet_char_first_primitive(
        x: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
    );
    pub fn dirichlet_char_next(
        x: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
    ) -> libc::c_int;
    pub fn dirichlet_char_next_primitive(
        x: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
    ) -> libc::c_int;
    pub fn dirichlet_char_mul(
        c: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
        a: *const dirichlet_char_struct,
        b: *const dirichlet_char_struct,
    );
    pub fn dirichlet_char_pow(
        c: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
        a: *const dirichlet_char_struct,
        n: ulong,
    );
    pub fn dirichlet_char_lower(
        y: *mut dirichlet_char_struct,
        H: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
        G: *const dirichlet_group_struct,
    );
    pub fn dirichlet_char_lift(
        y: *mut dirichlet_char_struct,
        G: *const dirichlet_group_struct,
        x: *const dirichlet_char_struct,
        H: *const dirichlet_group_struct,
    );
    pub fn dirichlet_pairing(G: *const dirichlet_group_struct, m: ulong, n: ulong) -> ulong;
    pub fn dirichlet_pairing_char(
        G: *const dirichlet_group_struct,
        a: *const dirichlet_char_struct,
        b: *const dirichlet_char_struct,
    ) -> ulong;
    #[link_name = "dirichlet_char_is_principal__extern"]
    pub fn dirichlet_char_is_principal(
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
    ) -> libc::c_int;
    #[link_name = "dirichlet_char_is_real__extern"]
    pub fn dirichlet_char_is_real(
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
    ) -> libc::c_int;
    #[link_name = "dirichlet_char_is_primitive__extern"]
    pub fn dirichlet_char_is_primitive(
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
    ) -> libc::c_int;
    pub fn dirichlet_chi(
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
        n: ulong,
    ) -> ulong;
    pub fn dirichlet_vec_set_null(v: *mut ulong, G: *const dirichlet_group_struct, nv: slong);
    pub fn dirichlet_chi_vec_loop(
        v: *mut ulong,
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
        nv: slong,
    );
    pub fn dirichlet_chi_vec_primeloop(
        v: *mut ulong,
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
        nv: slong,
    );
    pub fn dirichlet_chi_vec(
        v: *mut ulong,
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
        nv: slong,
    );
    pub fn dirichlet_chi_vec_loop_order(
        v: *mut ulong,
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
        order: ulong,
        nv: slong,
    );
    pub fn dirichlet_chi_vec_primeloop_order(
        v: *mut ulong,
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
        order: ulong,
        nv: slong,
    );
    pub fn dirichlet_chi_vec_order(
        v: *mut ulong,
        G: *const dirichlet_group_struct,
        chi: *const dirichlet_char_struct,
        order: ulong,
        nv: slong,
    );
}