1use libc::*;
4use crate::deps::*;
5use crate::flint::*;
6use crate::fmpz_mod_types::*;
7use crate::fmpz_types::*;
8use crate::nmod_types::*;
9use crate::padic_types::*;
10
11
12pub type qadic_t = padic_poly_t;
13pub type qadic_struct = padic_poly_struct;
14#[repr(C)]
15pub struct qadic_ctx_struct {
16 pub pctx: padic_ctx_struct,
17 pub a: *mut fmpz,
18 pub j: *mut slong,
19 pub len: slong,
20 pub var: *mut libc::c_char,
21}
22#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23const _: () = {
24 ["Size of qadic_ctx_struct"][::std::mem::size_of::<qadic_ctx_struct>() - 80usize];
25 ["Alignment of qadic_ctx_struct"][::std::mem::align_of::<qadic_ctx_struct>() - 8usize];
26 ["Offset of field: qadic_ctx_struct::pctx"]
27 [::std::mem::offset_of!(qadic_ctx_struct, pctx) - 0usize];
28 ["Offset of field: qadic_ctx_struct::a"][::std::mem::offset_of!(qadic_ctx_struct, a) - 48usize];
29 ["Offset of field: qadic_ctx_struct::j"][::std::mem::offset_of!(qadic_ctx_struct, j) - 56usize];
30 ["Offset of field: qadic_ctx_struct::len"]
31 [::std::mem::offset_of!(qadic_ctx_struct, len) - 64usize];
32 ["Offset of field: qadic_ctx_struct::var"]
33 [::std::mem::offset_of!(qadic_ctx_struct, var) - 72usize];
34};
35impl Default for qadic_ctx_struct {
36 fn default() -> Self {
37 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
38 unsafe {
39 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
40 s.assume_init()
41 }
42 }
43}
44pub type qadic_ctx_t = [qadic_ctx_struct; 1usize];
45#[repr(C)]
46#[derive(Debug, Copy, Clone)]
47pub struct qadic2_sqrt_precomp {
48 _unused: [u8; 0],
49}
50extern "C" {
51 #[link_name = "qadic_val__extern"]
52 pub fn qadic_val(op: *const padic_poly_struct) -> slong;
53 #[link_name = "qadic_prec__extern"]
54 pub fn qadic_prec(op: *const padic_poly_struct) -> slong;
55 pub fn _qadic_ctx_init_conway_ui(
56 ctx: *mut qadic_ctx_struct,
57 p: ulong,
58 d: slong,
59 min: slong,
60 max: slong,
61 var: *const libc::c_char,
62 mode: padic_print_mode,
63 ) -> libc::c_int;
64 pub fn qadic_ctx_init_conway(
65 ctx: *mut qadic_ctx_struct,
66 p: *const fmpz,
67 d: slong,
68 min: slong,
69 max: slong,
70 var: *const libc::c_char,
71 mode: padic_print_mode,
72 );
73 pub fn qadic_ctx_init_modulus(
74 ctx: *mut qadic_ctx_struct,
75 p: *const fmpz,
76 modulus: *const fmpz_mod_poly_struct,
77 min: slong,
78 max: slong,
79 var: *const libc::c_char,
80 mode: padic_print_mode,
81 );
82 pub fn qadic_ctx_init_modulus_nmod(
83 ctx: *mut qadic_ctx_struct,
84 p: ulong,
85 modulus: *const nmod_poly_struct,
86 min: slong,
87 max: slong,
88 var: *const libc::c_char,
89 mode: padic_print_mode,
90 );
91 pub fn qadic_ctx_init(
92 ctx: *mut qadic_ctx_struct,
93 p: *const fmpz,
94 d: slong,
95 min: slong,
96 max: slong,
97 var: *const libc::c_char,
98 mode: padic_print_mode,
99 );
100 pub fn qadic_ctx_clear(ctx: *mut qadic_ctx_struct);
101 #[link_name = "qadic_ctx_degree__extern"]
102 pub fn qadic_ctx_degree(ctx: *const qadic_ctx_struct) -> slong;
103 #[link_name = "qadic_ctx_print__extern"]
104 pub fn qadic_ctx_print(ctx: *const qadic_ctx_struct);
105 #[link_name = "qadic_init__extern"]
106 pub fn qadic_init(x: *mut padic_poly_struct);
107 #[link_name = "qadic_init2__extern"]
108 pub fn qadic_init2(rop: *mut padic_poly_struct, prec: slong);
109 #[link_name = "qadic_clear__extern"]
110 pub fn qadic_clear(x: *mut padic_poly_struct);
111 #[link_name = "_fmpz_poly_reduce__extern"]
112 pub fn _fmpz_poly_reduce(
113 R: *mut fmpz,
114 lenR: slong,
115 a: *const fmpz,
116 j: *const slong,
117 len: slong,
118 );
119 #[link_name = "_fmpz_mod_poly_reduce__extern"]
120 pub fn _fmpz_mod_poly_reduce(
121 R: *mut fmpz,
122 lenR: slong,
123 a: *const fmpz,
124 j: *const slong,
125 len: slong,
126 p: *const fmpz,
127 );
128 #[link_name = "qadic_reduce__extern"]
129 pub fn qadic_reduce(x: *mut padic_poly_struct, ctx: *const qadic_ctx_struct);
130 #[link_name = "qadic_randtest__extern"]
131 pub fn qadic_randtest(
132 x: *mut padic_poly_struct,
133 state: *mut flint_rand_struct,
134 ctx: *const qadic_ctx_struct,
135 );
136 #[link_name = "qadic_randtest_not_zero__extern"]
137 pub fn qadic_randtest_not_zero(
138 x: *mut padic_poly_struct,
139 state: *mut flint_rand_struct,
140 ctx: *const qadic_ctx_struct,
141 );
142 #[link_name = "qadic_randtest_val__extern"]
143 pub fn qadic_randtest_val(
144 x: *mut padic_poly_struct,
145 state: *mut flint_rand_struct,
146 val: slong,
147 ctx: *const qadic_ctx_struct,
148 );
149 #[link_name = "qadic_randtest_int__extern"]
150 pub fn qadic_randtest_int(
151 x: *mut padic_poly_struct,
152 state: *mut flint_rand_struct,
153 ctx: *const qadic_ctx_struct,
154 );
155 #[link_name = "qadic_zero__extern"]
156 pub fn qadic_zero(op: *mut padic_poly_struct);
157 #[link_name = "qadic_one__extern"]
158 pub fn qadic_one(op: *mut padic_poly_struct);
159 #[link_name = "qadic_gen__extern"]
160 pub fn qadic_gen(x: *mut padic_poly_struct, ctx: *const qadic_ctx_struct);
161 #[link_name = "qadic_set_ui__extern"]
162 pub fn qadic_set_ui(rop: *mut padic_poly_struct, op: ulong, ctx: *const qadic_ctx_struct);
163 #[link_name = "qadic_get_padic__extern"]
164 pub fn qadic_get_padic(
165 rop: *mut padic_struct,
166 op: *const padic_poly_struct,
167 ctx: *const qadic_ctx_struct,
168 ) -> libc::c_int;
169 #[link_name = "qadic_set__extern"]
170 pub fn qadic_set(
171 rop: *mut padic_poly_struct,
172 op: *const padic_poly_struct,
173 ctx: *const qadic_ctx_struct,
174 );
175 pub fn qadic_set_fmpz_poly(
176 rop: *mut padic_poly_struct,
177 op: *const fmpz_poly_struct,
178 ctx: *const qadic_ctx_struct,
179 );
180 #[link_name = "qadic_is_zero__extern"]
181 pub fn qadic_is_zero(op: *const padic_poly_struct) -> libc::c_int;
182 #[link_name = "qadic_is_one__extern"]
183 pub fn qadic_is_one(op: *const padic_poly_struct) -> libc::c_int;
184 #[link_name = "qadic_equal__extern"]
185 pub fn qadic_equal(op1: *const padic_poly_struct, op2: *const padic_poly_struct)
186 -> libc::c_int;
187 #[link_name = "qadic_add__extern"]
188 pub fn qadic_add(
189 x: *mut padic_poly_struct,
190 y: *const padic_poly_struct,
191 z: *const padic_poly_struct,
192 ctx: *const qadic_ctx_struct,
193 );
194 #[link_name = "qadic_sub__extern"]
195 pub fn qadic_sub(
196 x: *mut padic_poly_struct,
197 y: *const padic_poly_struct,
198 z: *const padic_poly_struct,
199 ctx: *const qadic_ctx_struct,
200 );
201 #[link_name = "qadic_neg__extern"]
202 pub fn qadic_neg(
203 x: *mut padic_poly_struct,
204 y: *const padic_poly_struct,
205 ctx: *const qadic_ctx_struct,
206 );
207 pub fn qadic_mul(
208 x: *mut padic_poly_struct,
209 y: *const padic_poly_struct,
210 z: *const padic_poly_struct,
211 ctx: *const qadic_ctx_struct,
212 );
213 pub fn _qadic_inv(
214 rop: *mut fmpz,
215 op: *const fmpz,
216 len: slong,
217 a: *const fmpz,
218 j: *const slong,
219 lena: slong,
220 p: *const fmpz,
221 N: slong,
222 );
223 pub fn qadic_inv(
224 x: *mut padic_poly_struct,
225 y: *const padic_poly_struct,
226 ctx: *const qadic_ctx_struct,
227 );
228 pub fn _qadic_pow(
229 rop: *mut fmpz,
230 op: *const fmpz,
231 len: slong,
232 e: *const fmpz,
233 a: *const fmpz,
234 j: *const slong,
235 lena: slong,
236 p: *const fmpz,
237 );
238 pub fn qadic_pow(
239 x: *mut padic_poly_struct,
240 y: *const padic_poly_struct,
241 e: *const fmpz,
242 ctx: *const qadic_ctx_struct,
243 );
244 pub fn _qadic_exp_rectangular(
245 rop: *mut fmpz,
246 op: *const fmpz,
247 v: slong,
248 len: slong,
249 a: *const fmpz,
250 j: *const slong,
251 lena: slong,
252 p: *const fmpz,
253 N: slong,
254 pN: *const fmpz,
255 );
256 pub fn qadic_exp_rectangular(
257 rop: *mut padic_poly_struct,
258 op: *const padic_poly_struct,
259 ctx: *const qadic_ctx_struct,
260 ) -> libc::c_int;
261 pub fn _qadic_exp_balanced(
262 rop: *mut fmpz,
263 op: *const fmpz,
264 v: slong,
265 len: slong,
266 a: *const fmpz,
267 j: *const slong,
268 lena: slong,
269 p: *const fmpz,
270 N: slong,
271 pN: *const fmpz,
272 );
273 pub fn qadic_exp_balanced(
274 rop: *mut padic_poly_struct,
275 op: *const padic_poly_struct,
276 ctx: *const qadic_ctx_struct,
277 ) -> libc::c_int;
278 pub fn _qadic_exp(
279 rop: *mut fmpz,
280 op: *const fmpz,
281 v: slong,
282 len: slong,
283 a: *const fmpz,
284 j: *const slong,
285 lena: slong,
286 p: *const fmpz,
287 N: slong,
288 pN: *const fmpz,
289 );
290 pub fn qadic_exp(
291 rop: *mut padic_poly_struct,
292 op: *const padic_poly_struct,
293 ctx: *const qadic_ctx_struct,
294 ) -> libc::c_int;
295 pub fn _qadic_log_rectangular(
296 z: *mut fmpz,
297 y: *const fmpz,
298 v: slong,
299 len: slong,
300 a: *const fmpz,
301 j: *const slong,
302 lena: slong,
303 p: *const fmpz,
304 N: slong,
305 pN: *const fmpz,
306 );
307 pub fn qadic_log_rectangular(
308 rop: *mut padic_poly_struct,
309 op: *const padic_poly_struct,
310 ctx: *const qadic_ctx_struct,
311 ) -> libc::c_int;
312 pub fn _qadic_log_balanced(
313 z: *mut fmpz,
314 y: *const fmpz,
315 len: slong,
316 a: *const fmpz,
317 j: *const slong,
318 lena: slong,
319 p: *const fmpz,
320 N: slong,
321 pN: *const fmpz,
322 );
323 pub fn qadic_log_balanced(
324 rop: *mut padic_poly_struct,
325 op: *const padic_poly_struct,
326 ctx: *const qadic_ctx_struct,
327 ) -> libc::c_int;
328 pub fn _qadic_log(
329 z: *mut fmpz,
330 y: *const fmpz,
331 v: slong,
332 len: slong,
333 a: *const fmpz,
334 j: *const slong,
335 lena: slong,
336 p: *const fmpz,
337 N: slong,
338 pN: *const fmpz,
339 );
340 pub fn qadic_log(
341 rop: *mut padic_poly_struct,
342 op: *const padic_poly_struct,
343 ctx: *const qadic_ctx_struct,
344 ) -> libc::c_int;
345 pub fn _qadic_frobenius_a(
346 rop: *mut fmpz,
347 exp: slong,
348 a: *const fmpz,
349 j: *const slong,
350 lena: slong,
351 p: *const fmpz,
352 N: slong,
353 );
354 pub fn _qadic_frobenius(
355 rop: *mut fmpz,
356 op: *const fmpz,
357 len: slong,
358 e: slong,
359 a: *const fmpz,
360 j: *const slong,
361 lena: slong,
362 p: *const fmpz,
363 N: slong,
364 );
365 pub fn qadic_frobenius(
366 rop: *mut padic_poly_struct,
367 op: *const padic_poly_struct,
368 e: slong,
369 ctx: *const qadic_ctx_struct,
370 );
371 pub fn _qadic_teichmuller(
372 rop: *mut fmpz,
373 op: *const fmpz,
374 len: slong,
375 a: *const fmpz,
376 j: *const slong,
377 lena: slong,
378 p: *const fmpz,
379 N: slong,
380 );
381 pub fn qadic_teichmuller(
382 rop: *mut padic_poly_struct,
383 op: *const padic_poly_struct,
384 ctx: *const qadic_ctx_struct,
385 );
386 pub fn _qadic_trace(
387 rop: *mut fmpz,
388 op: *const fmpz,
389 len: slong,
390 a: *const fmpz,
391 j: *const slong,
392 lena: slong,
393 pN: *const fmpz,
394 );
395 pub fn qadic_trace(
396 rop: *mut padic_struct,
397 op: *const padic_poly_struct,
398 ctx: *const qadic_ctx_struct,
399 );
400 pub fn _qadic_norm_resultant(
401 rop: *mut fmpz,
402 op: *const fmpz,
403 len: slong,
404 a: *const fmpz,
405 j: *const slong,
406 lena: slong,
407 p: *const fmpz,
408 N: slong,
409 );
410 pub fn _qadic_norm_analytic(
411 rop: *mut fmpz,
412 y: *const fmpz,
413 v: slong,
414 len: slong,
415 a: *const fmpz,
416 j: *const slong,
417 lena: slong,
418 p: *const fmpz,
419 N: slong,
420 );
421 pub fn _qadic_norm(
422 rop: *mut fmpz,
423 op: *const fmpz,
424 len: slong,
425 a: *const fmpz,
426 j: *const slong,
427 lena: slong,
428 p: *const fmpz,
429 N: slong,
430 );
431 pub fn qadic_norm(
432 rop: *mut padic_struct,
433 op: *const padic_poly_struct,
434 ctx: *const qadic_ctx_struct,
435 );
436 pub fn qadic_norm_analytic(
437 rop: *mut padic_struct,
438 op: *const padic_poly_struct,
439 ctx: *const qadic_ctx_struct,
440 );
441 pub fn qadic_norm_resultant(
442 rop: *mut padic_struct,
443 op: *const padic_poly_struct,
444 ctx: *const qadic_ctx_struct,
445 );
446 pub fn qadic_sqrt(
447 rop: *mut padic_poly_struct,
448 op: *const padic_poly_struct,
449 ctx: *const qadic_ctx_struct,
450 ) -> libc::c_int;
451 pub fn _qadic_char2_sqrt_precomp_init(ctx: *const qadic_ctx_struct)
452 -> *mut qadic2_sqrt_precomp;
453 pub fn _qadic_char2_sqrt_with_precomp(
454 rop: *mut padic_poly_struct,
455 op: *const padic_poly_struct,
456 ctx: *const qadic_ctx_struct,
457 data: *const qadic2_sqrt_precomp,
458 ) -> libc::c_int;
459 pub fn _qadic_char2_sqrt_precomp_clear(data: *mut qadic2_sqrt_precomp);
460 pub fn qadic_fprint_pretty(
461 file: *mut FILE,
462 op: *const padic_poly_struct,
463 ctx: *const qadic_ctx_struct,
464 ) -> libc::c_int;
465 pub fn qadic_print_pretty(
466 op: *const padic_poly_struct,
467 ctx: *const qadic_ctx_struct,
468 ) -> libc::c_int;
469 pub fn qadic_debug(op: *const padic_poly_struct) -> libc::c_int;
470}