Skip to main content

flint_sys/
nf.rs

1/* automatically generated by rust-bindgen 0.70.1 */
2
3use crate::deps::*;
4use crate::flint::*;
5use crate::fmpq_poly::*;
6use crate::fmpq_types::*;
7use crate::fmpz_poly::*;
8use crate::fmpz_types::*;
9
10
11#[repr(C)]
12pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
13impl<T> __BindgenUnionField<T> {
14    #[inline]
15    pub const fn new() -> Self {
16        __BindgenUnionField(::std::marker::PhantomData)
17    }
18    #[inline]
19    pub unsafe fn as_ref(&self) -> &T {
20        ::std::mem::transmute(self)
21    }
22    #[inline]
23    pub unsafe fn as_mut(&mut self) -> &mut T {
24        ::std::mem::transmute(self)
25    }
26}
27impl<T> ::std::default::Default for __BindgenUnionField<T> {
28    #[inline]
29    fn default() -> Self {
30        Self::new()
31    }
32}
33impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
34    #[inline]
35    fn clone(&self) -> Self {
36        *self
37    }
38}
39impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
40impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
41    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
42        fmt.write_str("__BindgenUnionField")
43    }
44}
45impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
46    fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
47}
48impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
49    fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
50        true
51    }
52}
53impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
54pub const NF_POWERS_CUTOFF: u32 = 30;
55pub const NF_GENERIC: u32 = 0;
56pub const NF_MONIC: u32 = 1;
57pub const NF_LINEAR: u32 = 2;
58pub const NF_QUADRATIC: u32 = 4;
59pub const NF_GAUSSIAN: u32 = 8;
60#[repr(C)]
61pub struct nf_struct {
62    pub pol: fmpq_poly_t,
63    pub pinv: nf_struct__bindgen_ty_1,
64    pub powers: nf_struct__bindgen_ty_2,
65    pub traces: fmpq_poly_t,
66    pub flag: ulong,
67}
68#[repr(C)]
69pub struct nf_struct__bindgen_ty_1 {
70    pub qq: __BindgenUnionField<fmpz_preinvn_t>,
71    pub bindgen_union_field: [u64; 3usize],
72}
73#[allow(clippy::unnecessary_operation, clippy::identity_op)]
74const _: () = {
75    ["Size of nf_struct__bindgen_ty_1"][::std::mem::size_of::<nf_struct__bindgen_ty_1>() - 24usize];
76    ["Alignment of nf_struct__bindgen_ty_1"]
77        [::std::mem::align_of::<nf_struct__bindgen_ty_1>() - 8usize];
78    ["Offset of field: nf_struct__bindgen_ty_1::qq"]
79        [::std::mem::offset_of!(nf_struct__bindgen_ty_1, qq) - 0usize];
80};
81impl Default for nf_struct__bindgen_ty_1 {
82    fn default() -> Self {
83        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
84        unsafe {
85            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
86            s.assume_init()
87        }
88    }
89}
90#[repr(C)]
91pub struct nf_struct__bindgen_ty_2 {
92    pub qq: __BindgenUnionField<fmpq_poly_powers_precomp_t>,
93    pub zz: __BindgenUnionField<fmpz_poly_powers_precomp_t>,
94    pub bindgen_union_field: [u64; 2usize],
95}
96#[allow(clippy::unnecessary_operation, clippy::identity_op)]
97const _: () = {
98    ["Size of nf_struct__bindgen_ty_2"][::std::mem::size_of::<nf_struct__bindgen_ty_2>() - 16usize];
99    ["Alignment of nf_struct__bindgen_ty_2"]
100        [::std::mem::align_of::<nf_struct__bindgen_ty_2>() - 8usize];
101    ["Offset of field: nf_struct__bindgen_ty_2::qq"]
102        [::std::mem::offset_of!(nf_struct__bindgen_ty_2, qq) - 0usize];
103    ["Offset of field: nf_struct__bindgen_ty_2::zz"]
104        [::std::mem::offset_of!(nf_struct__bindgen_ty_2, zz) - 0usize];
105};
106impl Default for nf_struct__bindgen_ty_2 {
107    fn default() -> Self {
108        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
109        unsafe {
110            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
111            s.assume_init()
112        }
113    }
114}
115#[allow(clippy::unnecessary_operation, clippy::identity_op)]
116const _: () = {
117    ["Size of nf_struct"][::std::mem::size_of::<nf_struct>() - 112usize];
118    ["Alignment of nf_struct"][::std::mem::align_of::<nf_struct>() - 8usize];
119    ["Offset of field: nf_struct::pol"][::std::mem::offset_of!(nf_struct, pol) - 0usize];
120    ["Offset of field: nf_struct::pinv"][::std::mem::offset_of!(nf_struct, pinv) - 32usize];
121    ["Offset of field: nf_struct::powers"][::std::mem::offset_of!(nf_struct, powers) - 56usize];
122    ["Offset of field: nf_struct::traces"][::std::mem::offset_of!(nf_struct, traces) - 72usize];
123    ["Offset of field: nf_struct::flag"][::std::mem::offset_of!(nf_struct, flag) - 104usize];
124};
125impl Default for nf_struct {
126    fn default() -> Self {
127        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
128        unsafe {
129            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
130            s.assume_init()
131        }
132    }
133}
134pub type nf_t = [nf_struct; 1usize];
135extern "C" {
136    #[doc = "Initialisation"]
137    pub fn nf_init(nf: *mut nf_struct, pol: *const fmpq_poly_struct);
138    pub fn nf_init_randtest(
139        nf: *mut nf_struct,
140        state: *mut flint_rand_struct,
141        len: slong,
142        bits_in: flint_bitcnt_t,
143    );
144    pub fn nf_clear(nf: *mut nf_struct);
145    pub fn nf_print(nf: *const nf_struct);
146}