1use libc::*;
4use crate::deps::*;
5use crate::flint::*;
6use crate::fmpz_mod_types::*;
7use crate::fmpz_types::*;
8use crate::fq_nmod_types::*;
9use crate::fq_types::*;
10use crate::fq_zech_types::*;
11use crate::gr_types::*;
12use crate::nmod_types::*;
13
14
15#[repr(C)]
16pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
17impl<T> __BindgenUnionField<T> {
18 #[inline]
19 pub const fn new() -> Self {
20 __BindgenUnionField(::std::marker::PhantomData)
21 }
22 #[inline]
23 pub unsafe fn as_ref(&self) -> &T {
24 ::std::mem::transmute(self)
25 }
26 #[inline]
27 pub unsafe fn as_mut(&mut self) -> &mut T {
28 ::std::mem::transmute(self)
29 }
30}
31impl<T> ::std::default::Default for __BindgenUnionField<T> {
32 #[inline]
33 fn default() -> Self {
34 Self::new()
35 }
36}
37impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
38 #[inline]
39 fn clone(&self) -> Self {
40 *self
41 }
42}
43impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
44impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
45 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
46 fmt.write_str("__BindgenUnionField")
47 }
48}
49impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
50 fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
51}
52impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
53 fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
54 true
55 }
56}
57impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
58pub const FQ_DEFAULT_FQ_ZECH: u32 = 1;
59pub const FQ_DEFAULT_FQ_NMOD: u32 = 2;
60pub const FQ_DEFAULT_FQ: u32 = 3;
61pub const FQ_DEFAULT_NMOD: u32 = 4;
62pub const FQ_DEFAULT_FMPZ_MOD: u32 = 5;
63#[repr(C)]
64pub struct fq_default_struct {
65 pub fq: __BindgenUnionField<fq_t>,
66 pub fq_nmod: __BindgenUnionField<fq_nmod_t>,
67 pub fq_zech: __BindgenUnionField<fq_zech_t>,
68 pub nmod: __BindgenUnionField<ulong>,
69 pub fmpz_mod: __BindgenUnionField<fmpz_t>,
70 pub bindgen_union_field: [u64; 6usize],
71}
72#[allow(clippy::unnecessary_operation, clippy::identity_op)]
73const _: () = {
74 ["Size of fq_default_struct"][::std::mem::size_of::<fq_default_struct>() - 48usize];
75 ["Alignment of fq_default_struct"][::std::mem::align_of::<fq_default_struct>() - 8usize];
76 ["Offset of field: fq_default_struct::fq"]
77 [::std::mem::offset_of!(fq_default_struct, fq) - 0usize];
78 ["Offset of field: fq_default_struct::fq_nmod"]
79 [::std::mem::offset_of!(fq_default_struct, fq_nmod) - 0usize];
80 ["Offset of field: fq_default_struct::fq_zech"]
81 [::std::mem::offset_of!(fq_default_struct, fq_zech) - 0usize];
82 ["Offset of field: fq_default_struct::nmod"]
83 [::std::mem::offset_of!(fq_default_struct, nmod) - 0usize];
84 ["Offset of field: fq_default_struct::fmpz_mod"]
85 [::std::mem::offset_of!(fq_default_struct, fmpz_mod) - 0usize];
86};
87impl Default for fq_default_struct {
88 fn default() -> Self {
89 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
90 unsafe {
91 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
92 s.assume_init()
93 }
94 }
95}
96pub type fq_default_t = [fq_default_struct; 1usize];
97pub type fq_default_ctx_struct = gr_ctx_struct;
98pub type fq_default_ctx_t = [fq_default_ctx_struct; 1usize];
99#[repr(C)]
100pub struct _gr_fmpz_mod_ctx_struct {
101 pub ctx: *mut fmpz_mod_ctx_struct,
102 pub is_prime: truth_t,
103 pub a: fmpz,
104}
105#[allow(clippy::unnecessary_operation, clippy::identity_op)]
106const _: () = {
107 ["Size of _gr_fmpz_mod_ctx_struct"][::std::mem::size_of::<_gr_fmpz_mod_ctx_struct>() - 24usize];
108 ["Alignment of _gr_fmpz_mod_ctx_struct"]
109 [::std::mem::align_of::<_gr_fmpz_mod_ctx_struct>() - 8usize];
110 ["Offset of field: _gr_fmpz_mod_ctx_struct::ctx"]
111 [::std::mem::offset_of!(_gr_fmpz_mod_ctx_struct, ctx) - 0usize];
112 ["Offset of field: _gr_fmpz_mod_ctx_struct::is_prime"]
113 [::std::mem::offset_of!(_gr_fmpz_mod_ctx_struct, is_prime) - 8usize];
114 ["Offset of field: _gr_fmpz_mod_ctx_struct::a"]
115 [::std::mem::offset_of!(_gr_fmpz_mod_ctx_struct, a) - 16usize];
116};
117impl Default for _gr_fmpz_mod_ctx_struct {
118 fn default() -> Self {
119 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
120 unsafe {
121 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
122 s.assume_init()
123 }
124 }
125}
126extern "C" {
127 pub fn fq_default_ctx_init_type(
128 ctx: *mut fq_default_ctx_struct,
129 p: *const fmpz,
130 d: slong,
131 var: *const libc::c_char,
132 type_: libc::c_int,
133 );
134 #[link_name = "fq_default_ctx_init__extern"]
135 pub fn fq_default_ctx_init(
136 ctx: *mut fq_default_ctx_struct,
137 p: *const fmpz,
138 d: slong,
139 var: *const libc::c_char,
140 );
141 #[link_name = "fq_default_ctx_inner__extern"]
142 pub fn fq_default_ctx_inner(ctx: *const fq_default_ctx_struct) -> *mut libc::c_void;
143 pub fn fq_default_ctx_init_modulus_type(
144 ctx: *mut fq_default_ctx_struct,
145 modulus: *const fmpz_mod_poly_struct,
146 mod_ctx: *mut fmpz_mod_ctx_struct,
147 var: *const libc::c_char,
148 type_: libc::c_int,
149 );
150 pub fn fq_default_ctx_init_modulus(
151 ctx: *mut fq_default_ctx_struct,
152 modulus: *const fmpz_mod_poly_struct,
153 mod_ctx: *mut fmpz_mod_ctx_struct,
154 var: *const libc::c_char,
155 );
156 pub fn fq_default_ctx_init_modulus_nmod_type(
157 ctx: *mut fq_default_ctx_struct,
158 modulus: *const nmod_poly_struct,
159 var: *const libc::c_char,
160 type_: libc::c_int,
161 );
162 pub fn fq_default_ctx_init_modulus_nmod(
163 ctx: *mut fq_default_ctx_struct,
164 modulus: *const nmod_poly_struct,
165 var: *const libc::c_char,
166 );
167 #[link_name = "fq_default_ctx_clear__extern"]
168 pub fn fq_default_ctx_clear(ctx: *mut fq_default_ctx_struct);
169 #[link_name = "fq_default_ctx_type__extern"]
170 pub fn fq_default_ctx_type(ctx: *const fq_default_ctx_struct) -> libc::c_int;
171 #[link_name = "fq_default_ctx_degree__extern"]
172 pub fn fq_default_ctx_degree(ctx: *const fq_default_ctx_struct) -> slong;
173 #[link_name = "fq_default_ctx_prime__extern"]
174 pub fn fq_default_ctx_prime(prime: *mut fmpz, ctx: *const fq_default_ctx_struct);
175 pub fn fq_default_ctx_modulus(p: *mut fmpz_mod_poly_struct, ctx: *const fq_default_ctx_struct);
176 #[link_name = "fq_default_ctx_order__extern"]
177 pub fn fq_default_ctx_order(f: *mut fmpz, ctx: *const fq_default_ctx_struct);
178 pub fn fq_default_ctx_fprint(file: *mut FILE, ctx: *const fq_default_ctx_struct)
179 -> libc::c_int;
180 pub fn fq_default_ctx_print(ctx: *const fq_default_ctx_struct);
181 pub fn fq_default_ctx_init_randtest(
182 ctx: *mut fq_default_ctx_struct,
183 state: *mut flint_rand_struct,
184 );
185 #[link_name = "fq_default_init__extern"]
186 pub fn fq_default_init(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
187 #[link_name = "fq_default_init2__extern"]
188 pub fn fq_default_init2(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
189 #[link_name = "fq_default_clear__extern"]
190 pub fn fq_default_clear(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
191 #[link_name = "fq_default_add__extern"]
192 pub fn fq_default_add(
193 rop: *mut fq_default_struct,
194 op1: *const fq_default_struct,
195 op2: *const fq_default_struct,
196 ctx: *const fq_default_ctx_struct,
197 );
198 #[link_name = "fq_default_sub__extern"]
199 pub fn fq_default_sub(
200 rop: *mut fq_default_struct,
201 op1: *const fq_default_struct,
202 op2: *const fq_default_struct,
203 ctx: *const fq_default_ctx_struct,
204 );
205 #[link_name = "fq_default_sub_one__extern"]
206 pub fn fq_default_sub_one(
207 rop: *mut fq_default_struct,
208 op1: *const fq_default_struct,
209 ctx: *const fq_default_ctx_struct,
210 );
211 #[link_name = "fq_default_neg__extern"]
212 pub fn fq_default_neg(
213 rop: *mut fq_default_struct,
214 op1: *const fq_default_struct,
215 ctx: *const fq_default_ctx_struct,
216 );
217 #[link_name = "fq_default_mul__extern"]
218 pub fn fq_default_mul(
219 rop: *mut fq_default_struct,
220 op1: *const fq_default_struct,
221 op2: *const fq_default_struct,
222 ctx: *const fq_default_ctx_struct,
223 );
224 #[link_name = "fq_default_mul_fmpz__extern"]
225 pub fn fq_default_mul_fmpz(
226 rop: *mut fq_default_struct,
227 op: *const fq_default_struct,
228 x: *const fmpz,
229 ctx: *const fq_default_ctx_struct,
230 );
231 #[link_name = "fq_default_mul_si__extern"]
232 pub fn fq_default_mul_si(
233 rop: *mut fq_default_struct,
234 op: *const fq_default_struct,
235 x: slong,
236 ctx: *const fq_default_ctx_struct,
237 );
238 #[link_name = "fq_default_mul_ui__extern"]
239 pub fn fq_default_mul_ui(
240 rop: *mut fq_default_struct,
241 op: *const fq_default_struct,
242 x: ulong,
243 ctx: *const fq_default_ctx_struct,
244 );
245 #[link_name = "fq_default_sqr__extern"]
246 pub fn fq_default_sqr(
247 rop: *mut fq_default_struct,
248 op: *const fq_default_struct,
249 ctx: *const fq_default_ctx_struct,
250 );
251 #[link_name = "fq_default_is_invertible__extern"]
252 pub fn fq_default_is_invertible(
253 op: *const fq_default_struct,
254 ctx: *const fq_default_ctx_struct,
255 ) -> libc::c_int;
256 #[link_name = "fq_default_inv__extern"]
257 pub fn fq_default_inv(
258 rop: *mut fq_default_struct,
259 op1: *const fq_default_struct,
260 ctx: *const fq_default_ctx_struct,
261 );
262 #[link_name = "fq_default_div__extern"]
263 pub fn fq_default_div(
264 rop: *mut fq_default_struct,
265 op1: *mut fq_default_struct,
266 op2: *mut fq_default_struct,
267 ctx: *const fq_default_ctx_struct,
268 );
269 #[link_name = "fq_default_pow__extern"]
270 pub fn fq_default_pow(
271 rop: *mut fq_default_struct,
272 op1: *const fq_default_struct,
273 e: *const fmpz,
274 ctx: *const fq_default_ctx_struct,
275 );
276 #[link_name = "fq_default_pow_ui__extern"]
277 pub fn fq_default_pow_ui(
278 rop: *mut fq_default_struct,
279 op: *const fq_default_struct,
280 e: ulong,
281 ctx: *const fq_default_ctx_struct,
282 );
283 #[link_name = "fq_default_is_square__extern"]
284 pub fn fq_default_is_square(
285 op: *const fq_default_struct,
286 ctx: *const fq_default_ctx_struct,
287 ) -> libc::c_int;
288 #[link_name = "fq_default_sqrt__extern"]
289 pub fn fq_default_sqrt(
290 rop: *mut fq_default_struct,
291 op: *const fq_default_struct,
292 ctx: *const fq_default_ctx_struct,
293 ) -> libc::c_int;
294 #[link_name = "fq_default_pth_root__extern"]
295 pub fn fq_default_pth_root(
296 rop: *mut fq_default_struct,
297 op1: *const fq_default_struct,
298 ctx: *const fq_default_ctx_struct,
299 );
300 #[link_name = "fq_default_randtest__extern"]
301 pub fn fq_default_randtest(
302 rop: *mut fq_default_struct,
303 state: *mut flint_rand_struct,
304 ctx: *const fq_default_ctx_struct,
305 );
306 #[link_name = "fq_default_randtest_not_zero__extern"]
307 pub fn fq_default_randtest_not_zero(
308 rop: *mut fq_default_struct,
309 state: *mut flint_rand_struct,
310 ctx: *const fq_default_ctx_struct,
311 );
312 #[link_name = "fq_default_rand__extern"]
313 pub fn fq_default_rand(
314 rop: *mut fq_default_struct,
315 state: *mut flint_rand_struct,
316 ctx: *const fq_default_ctx_struct,
317 );
318 #[link_name = "fq_default_rand_not_zero__extern"]
319 pub fn fq_default_rand_not_zero(
320 rop: *mut fq_default_struct,
321 state: *mut flint_rand_struct,
322 ctx: *const fq_default_ctx_struct,
323 );
324 #[link_name = "fq_default_equal__extern"]
325 pub fn fq_default_equal(
326 op1: *const fq_default_struct,
327 op2: *const fq_default_struct,
328 ctx: *const fq_default_ctx_struct,
329 ) -> libc::c_int;
330 #[link_name = "fq_default_is_zero__extern"]
331 pub fn fq_default_is_zero(
332 op: *const fq_default_struct,
333 ctx: *const fq_default_ctx_struct,
334 ) -> libc::c_int;
335 #[link_name = "fq_default_is_one__extern"]
336 pub fn fq_default_is_one(
337 op: *const fq_default_struct,
338 ctx: *const fq_default_ctx_struct,
339 ) -> libc::c_int;
340 #[link_name = "fq_default_set__extern"]
341 pub fn fq_default_set(
342 rop: *mut fq_default_struct,
343 op: *const fq_default_struct,
344 ctx: *const fq_default_ctx_struct,
345 );
346 #[link_name = "fq_default_set_fmpz__extern"]
347 pub fn fq_default_set_fmpz(
348 rop: *mut fq_default_struct,
349 x: *const fmpz,
350 ctx: *const fq_default_ctx_struct,
351 );
352 #[link_name = "fq_default_set_ui__extern"]
353 pub fn fq_default_set_ui(
354 rop: *mut fq_default_struct,
355 x: ulong,
356 ctx: *const fq_default_ctx_struct,
357 );
358 #[link_name = "fq_default_set_si__extern"]
359 pub fn fq_default_set_si(
360 rop: *mut fq_default_struct,
361 x: slong,
362 ctx: *const fq_default_ctx_struct,
363 );
364 #[link_name = "fq_default_zero__extern"]
365 pub fn fq_default_zero(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
366 #[link_name = "fq_default_one__extern"]
367 pub fn fq_default_one(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
368 #[link_name = "fq_default_swap__extern"]
369 pub fn fq_default_swap(
370 op1: *mut fq_default_struct,
371 op2: *mut fq_default_struct,
372 ctx: *const fq_default_ctx_struct,
373 );
374 #[link_name = "fq_default_gen__extern"]
375 pub fn fq_default_gen(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
376 #[link_name = "fq_default_get_nmod_poly__extern"]
377 pub fn fq_default_get_nmod_poly(
378 poly: *mut nmod_poly_struct,
379 op: *const fq_default_struct,
380 ctx: *const fq_default_ctx_struct,
381 );
382 #[link_name = "fq_default_set_nmod_poly__extern"]
383 pub fn fq_default_set_nmod_poly(
384 op: *mut fq_default_struct,
385 poly: *const nmod_poly_struct,
386 ctx: *const fq_default_ctx_struct,
387 );
388 #[link_name = "fq_default_get_fmpz__extern"]
389 pub fn fq_default_get_fmpz(
390 z: *mut fmpz,
391 op: *const fq_default_struct,
392 ctx: *const fq_default_ctx_struct,
393 ) -> libc::c_int;
394 pub fn fq_default_get_fmpz_mod_poly(
395 poly: *mut fmpz_mod_poly_struct,
396 op: *const fq_default_struct,
397 ctx: *const fq_default_ctx_struct,
398 );
399 pub fn fq_default_set_fmpz_mod_poly(
400 op: *mut fq_default_struct,
401 poly: *const fmpz_mod_poly_struct,
402 ctx: *const fq_default_ctx_struct,
403 );
404 pub fn fq_default_get_fmpz_poly(
405 poly: *mut fmpz_poly_struct,
406 op: *const fq_default_struct,
407 ctx: *const fq_default_ctx_struct,
408 );
409 pub fn fq_default_set_fmpz_poly(
410 op: *mut fq_default_struct,
411 poly: *const fmpz_poly_struct,
412 ctx: *const fq_default_ctx_struct,
413 );
414 #[link_name = "fq_default_get_coeff_fmpz__extern"]
415 pub fn fq_default_get_coeff_fmpz(
416 c: *mut fmpz,
417 op: *mut fq_default_struct,
418 n: slong,
419 ctx: *const fq_default_ctx_struct,
420 );
421 pub fn fq_default_fprint(
422 file: *mut FILE,
423 op: *const fq_default_struct,
424 ctx: *const fq_default_ctx_struct,
425 ) -> libc::c_int;
426 pub fn fq_default_fprint_pretty(
427 file: *mut FILE,
428 op: *const fq_default_struct,
429 ctx: *const fq_default_ctx_struct,
430 ) -> libc::c_int;
431 pub fn fq_default_print(op: *const fq_default_struct, ctx: *const fq_default_ctx_struct);
432 pub fn fq_default_print_pretty(op: *const fq_default_struct, ctx: *const fq_default_ctx_struct);
433 #[link_name = "fq_default_get_str__extern"]
434 pub fn fq_default_get_str(
435 op: *const fq_default_struct,
436 ctx: *const fq_default_ctx_struct,
437 ) -> *mut libc::c_char;
438 #[link_name = "fq_default_get_str_pretty__extern"]
439 pub fn fq_default_get_str_pretty(
440 op: *const fq_default_struct,
441 ctx: *const fq_default_ctx_struct,
442 ) -> *mut libc::c_char;
443 #[link_name = "fq_default_trace__extern"]
444 pub fn fq_default_trace(
445 rop: *mut fmpz,
446 op: *const fq_default_struct,
447 ctx: *const fq_default_ctx_struct,
448 );
449 #[link_name = "fq_default_frobenius__extern"]
450 pub fn fq_default_frobenius(
451 rop: *mut fq_default_struct,
452 op: *const fq_default_struct,
453 e: slong,
454 ctx: *const fq_default_ctx_struct,
455 );
456 #[link_name = "fq_default_norm__extern"]
457 pub fn fq_default_norm(
458 rop: *mut fmpz,
459 op: *const fq_default_struct,
460 ctx: *const fq_default_ctx_struct,
461 );
462}