1use crate::deps::*;
4use crate::ca_types::*;
5use crate::fexpr::*;
6use crate::flint::*;
7use crate::fmpq_types::*;
8use crate::fmpz_types::*;
9use crate::gr_types::*;
10
11
12#[repr(C)]
13pub struct ca_poly_vec_struct {
14 pub entries: *mut ca_poly_struct,
15 pub length: slong,
16 pub alloc: slong,
17}
18#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19const _: () = {
20 ["Size of ca_poly_vec_struct"][::std::mem::size_of::<ca_poly_vec_struct>() - 24usize];
21 ["Alignment of ca_poly_vec_struct"][::std::mem::align_of::<ca_poly_vec_struct>() - 8usize];
22 ["Offset of field: ca_poly_vec_struct::entries"]
23 [::std::mem::offset_of!(ca_poly_vec_struct, entries) - 0usize];
24 ["Offset of field: ca_poly_vec_struct::length"]
25 [::std::mem::offset_of!(ca_poly_vec_struct, length) - 8usize];
26 ["Offset of field: ca_poly_vec_struct::alloc"]
27 [::std::mem::offset_of!(ca_poly_vec_struct, alloc) - 16usize];
28};
29impl Default for ca_poly_vec_struct {
30 fn default() -> Self {
31 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
32 unsafe {
33 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
34 s.assume_init()
35 }
36 }
37}
38pub type ca_poly_vec_t = [ca_poly_vec_struct; 1usize];
39extern "C" {
40 #[link_name = "ca_poly_coeff_ptr__extern"]
41 pub fn ca_poly_coeff_ptr(poly: *mut ca_poly_struct, i: slong) -> ca_ptr;
42 pub fn ca_poly_init(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
43 pub fn ca_poly_init2(poly: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
44 pub fn ca_poly_clear(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
45 pub fn ca_poly_fit_length(poly: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
46 pub fn _ca_poly_set_length(poly: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
47 pub fn _ca_poly_normalise(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
48 #[link_name = "ca_poly_swap__extern"]
49 pub fn ca_poly_swap(
50 poly1: *mut ca_poly_struct,
51 poly2: *mut ca_poly_struct,
52 ctx: *mut ca_ctx_struct,
53 );
54 pub fn ca_poly_set_ca(poly: *mut ca_poly_struct, x: *const ca_struct, ctx: *mut ca_ctx_struct);
55 pub fn ca_poly_set_si(poly: *mut ca_poly_struct, x: slong, ctx: *mut ca_ctx_struct);
56 #[link_name = "ca_poly_zero__extern"]
57 pub fn ca_poly_zero(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
58 #[link_name = "ca_poly_x__extern"]
59 pub fn ca_poly_x(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
60 #[link_name = "ca_poly_one__extern"]
61 pub fn ca_poly_one(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
62 pub fn ca_poly_set(
63 res: *mut ca_poly_struct,
64 src: *const ca_poly_struct,
65 ctx: *mut ca_ctx_struct,
66 );
67 pub fn ca_poly_set_fmpz_poly(
68 res: *mut ca_poly_struct,
69 src: *const fmpz_poly_struct,
70 ctx: *mut ca_ctx_struct,
71 );
72 pub fn ca_poly_set_fmpq_poly(
73 res: *mut ca_poly_struct,
74 src: *const fmpq_poly_struct,
75 ctx: *mut ca_ctx_struct,
76 );
77 pub fn ca_poly_transfer(
78 res: *mut ca_poly_struct,
79 res_ctx: *mut ca_ctx_struct,
80 src: *const ca_poly_struct,
81 src_ctx: *mut ca_ctx_struct,
82 );
83 pub fn ca_poly_set_coeff_ca(
84 poly: *mut ca_poly_struct,
85 n: slong,
86 x: *const ca_struct,
87 ctx: *mut ca_ctx_struct,
88 );
89 pub fn ca_poly_get_fexpr(
90 res: *mut fexpr_struct,
91 A: *const ca_poly_struct,
92 flags: ulong,
93 ctx: *mut ca_ctx_struct,
94 );
95 pub fn ca_poly_randtest(
96 poly: *mut ca_poly_struct,
97 state: *mut flint_rand_struct,
98 len: slong,
99 depth: slong,
100 bits: slong,
101 ctx: *mut ca_ctx_struct,
102 );
103 pub fn ca_poly_randtest_rational(
104 poly: *mut ca_poly_struct,
105 state: *mut flint_rand_struct,
106 len: slong,
107 bits: slong,
108 ctx: *mut ca_ctx_struct,
109 );
110 pub fn ca_poly_print(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct);
111 pub fn ca_poly_printn(poly: *const ca_poly_struct, digits: slong, ctx: *mut ca_ctx_struct);
112 pub fn ca_poly_is_proper(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct) -> libc::c_int;
113 pub fn ca_poly_make_monic(
114 res: *mut ca_poly_struct,
115 poly: *const ca_poly_struct,
116 ctx: *mut ca_ctx_struct,
117 ) -> libc::c_int;
118 pub fn _ca_poly_reverse(
119 res: ca_ptr,
120 poly: ca_srcptr,
121 len: slong,
122 n: slong,
123 ctx: *mut ca_ctx_struct,
124 );
125 pub fn ca_poly_reverse(
126 res: *mut ca_poly_struct,
127 poly: *const ca_poly_struct,
128 n: slong,
129 ctx: *mut ca_ctx_struct,
130 );
131 pub fn _ca_poly_check_equal(
132 poly1: ca_srcptr,
133 len1: slong,
134 poly2: ca_srcptr,
135 len2: slong,
136 ctx: *mut ca_ctx_struct,
137 ) -> truth_t;
138 pub fn ca_poly_check_equal(
139 poly1: *const ca_poly_struct,
140 poly2: *const ca_poly_struct,
141 ctx: *mut ca_ctx_struct,
142 ) -> truth_t;
143 pub fn ca_poly_check_is_zero(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct) -> truth_t;
144 pub fn ca_poly_check_is_one(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct) -> truth_t;
145 pub fn _ca_poly_shift_left(
146 res: ca_ptr,
147 poly: ca_srcptr,
148 len: slong,
149 n: slong,
150 ctx: *mut ca_ctx_struct,
151 );
152 pub fn ca_poly_shift_left(
153 res: *mut ca_poly_struct,
154 poly: *const ca_poly_struct,
155 n: slong,
156 ctx: *mut ca_ctx_struct,
157 );
158 pub fn _ca_poly_shift_right(
159 res: ca_ptr,
160 poly: ca_srcptr,
161 len: slong,
162 n: slong,
163 ctx: *mut ca_ctx_struct,
164 );
165 pub fn ca_poly_shift_right(
166 res: *mut ca_poly_struct,
167 poly: *const ca_poly_struct,
168 n: slong,
169 ctx: *mut ca_ctx_struct,
170 );
171 pub fn ca_poly_neg(
172 res: *mut ca_poly_struct,
173 src: *const ca_poly_struct,
174 ctx: *mut ca_ctx_struct,
175 );
176 pub fn _ca_poly_add(
177 res: ca_ptr,
178 poly1: ca_srcptr,
179 len1: slong,
180 poly2: ca_srcptr,
181 len2: slong,
182 ctx: *mut ca_ctx_struct,
183 );
184 pub fn ca_poly_add(
185 res: *mut ca_poly_struct,
186 poly1: *const ca_poly_struct,
187 poly2: *const ca_poly_struct,
188 ctx: *mut ca_ctx_struct,
189 );
190 pub fn _ca_poly_sub(
191 res: ca_ptr,
192 poly1: ca_srcptr,
193 len1: slong,
194 poly2: ca_srcptr,
195 len2: slong,
196 ctx: *mut ca_ctx_struct,
197 );
198 pub fn ca_poly_sub(
199 res: *mut ca_poly_struct,
200 poly1: *const ca_poly_struct,
201 poly2: *const ca_poly_struct,
202 ctx: *mut ca_ctx_struct,
203 );
204 pub fn _ca_poly_mul(
205 C: ca_ptr,
206 A: ca_srcptr,
207 lenA: slong,
208 B: ca_srcptr,
209 lenB: slong,
210 ctx: *mut ca_ctx_struct,
211 );
212 pub fn ca_poly_mul(
213 res: *mut ca_poly_struct,
214 poly1: *const ca_poly_struct,
215 poly2: *const ca_poly_struct,
216 ctx: *mut ca_ctx_struct,
217 );
218 #[link_name = "ca_poly_mul_ca__extern"]
219 pub fn ca_poly_mul_ca(
220 res: *mut ca_poly_struct,
221 poly: *const ca_poly_struct,
222 c: *const ca_struct,
223 ctx: *mut ca_ctx_struct,
224 );
225 #[link_name = "ca_poly_div_ca__extern"]
226 pub fn ca_poly_div_ca(
227 res: *mut ca_poly_struct,
228 poly: *const ca_poly_struct,
229 c: *const ca_struct,
230 ctx: *mut ca_ctx_struct,
231 );
232 #[link_name = "ca_poly_div_fmpz__extern"]
233 pub fn ca_poly_div_fmpz(
234 res: *mut ca_poly_struct,
235 poly: *const ca_poly_struct,
236 c: *const fmpz,
237 ctx: *mut ca_ctx_struct,
238 );
239 pub fn _ca_poly_mullow_same_nf(
240 C: ca_ptr,
241 A: ca_srcptr,
242 Alen: slong,
243 B: ca_srcptr,
244 Blen: slong,
245 len: slong,
246 K: *mut ca_field_struct,
247 ctx: *mut ca_ctx_struct,
248 );
249 pub fn _ca_poly_mullow(
250 C: ca_ptr,
251 A: ca_srcptr,
252 lenA: slong,
253 B: ca_srcptr,
254 lenB: slong,
255 n: slong,
256 ctx: *mut ca_ctx_struct,
257 );
258 pub fn ca_poly_mullow(
259 res: *mut ca_poly_struct,
260 poly1: *const ca_poly_struct,
261 poly2: *const ca_poly_struct,
262 n: slong,
263 ctx: *mut ca_ctx_struct,
264 );
265 pub fn _ca_poly_divrem_basecase(
266 Q: ca_ptr,
267 R: ca_ptr,
268 A: ca_srcptr,
269 lenA: slong,
270 B: ca_srcptr,
271 lenB: slong,
272 invB: *const ca_struct,
273 ctx: *mut ca_ctx_struct,
274 );
275 pub fn ca_poly_divrem_basecase(
276 Q: *mut ca_poly_struct,
277 R: *mut ca_poly_struct,
278 A: *const ca_poly_struct,
279 B: *const ca_poly_struct,
280 ctx: *mut ca_ctx_struct,
281 ) -> libc::c_int;
282 pub fn _ca_poly_divrem(
283 Q: ca_ptr,
284 R: ca_ptr,
285 A: ca_srcptr,
286 lenA: slong,
287 B: ca_srcptr,
288 lenB: slong,
289 invB: *const ca_struct,
290 ctx: *mut ca_ctx_struct,
291 );
292 pub fn ca_poly_divrem(
293 Q: *mut ca_poly_struct,
294 R: *mut ca_poly_struct,
295 A: *const ca_poly_struct,
296 B: *const ca_poly_struct,
297 ctx: *mut ca_ctx_struct,
298 ) -> libc::c_int;
299 pub fn ca_poly_div(
300 Q: *mut ca_poly_struct,
301 A: *const ca_poly_struct,
302 B: *const ca_poly_struct,
303 ctx: *mut ca_ctx_struct,
304 ) -> libc::c_int;
305 pub fn ca_poly_rem(
306 R: *mut ca_poly_struct,
307 A: *const ca_poly_struct,
308 B: *const ca_poly_struct,
309 ctx: *mut ca_ctx_struct,
310 ) -> libc::c_int;
311 pub fn _ca_poly_pow_ui_trunc(
312 res: ca_ptr,
313 f: ca_srcptr,
314 flen: slong,
315 exp: ulong,
316 len: slong,
317 ctx: *mut ca_ctx_struct,
318 );
319 pub fn ca_poly_pow_ui_trunc(
320 res: *mut ca_poly_struct,
321 poly: *const ca_poly_struct,
322 exp: ulong,
323 len: slong,
324 ctx: *mut ca_ctx_struct,
325 );
326 pub fn _ca_poly_pow_ui(
327 res: ca_ptr,
328 f: ca_srcptr,
329 flen: slong,
330 exp: ulong,
331 ctx: *mut ca_ctx_struct,
332 );
333 pub fn ca_poly_pow_ui(
334 res: *mut ca_poly_struct,
335 poly: *const ca_poly_struct,
336 exp: ulong,
337 ctx: *mut ca_ctx_struct,
338 );
339 pub fn _ca_poly_evaluate_horner(
340 res: *mut ca_struct,
341 f: ca_srcptr,
342 len: slong,
343 x: *const ca_struct,
344 ctx: *mut ca_ctx_struct,
345 );
346 pub fn ca_poly_evaluate_horner(
347 res: *mut ca_struct,
348 f: *const ca_poly_struct,
349 a: *const ca_struct,
350 ctx: *mut ca_ctx_struct,
351 );
352 pub fn _ca_poly_evaluate(
353 res: *mut ca_struct,
354 f: ca_srcptr,
355 len: slong,
356 x: *const ca_struct,
357 ctx: *mut ca_ctx_struct,
358 );
359 pub fn ca_poly_evaluate(
360 res: *mut ca_struct,
361 f: *const ca_poly_struct,
362 a: *const ca_struct,
363 ctx: *mut ca_ctx_struct,
364 );
365 pub fn _ca_poly_compose(
366 res: ca_ptr,
367 poly1: ca_srcptr,
368 len1: slong,
369 poly2: ca_srcptr,
370 len2: slong,
371 ctx: *mut ca_ctx_struct,
372 );
373 pub fn ca_poly_compose(
374 res: *mut ca_poly_struct,
375 poly1: *const ca_poly_struct,
376 poly2: *const ca_poly_struct,
377 ctx: *mut ca_ctx_struct,
378 );
379 pub fn _ca_poly_derivative(res: ca_ptr, poly: ca_srcptr, len: slong, ctx: *mut ca_ctx_struct);
380 pub fn ca_poly_derivative(
381 res: *mut ca_poly_struct,
382 poly: *const ca_poly_struct,
383 ctx: *mut ca_ctx_struct,
384 );
385 pub fn _ca_poly_integral(res: ca_ptr, poly: ca_srcptr, len: slong, ctx: *mut ca_ctx_struct);
386 pub fn ca_poly_integral(
387 res: *mut ca_poly_struct,
388 poly: *const ca_poly_struct,
389 ctx: *mut ca_ctx_struct,
390 );
391 pub fn _ca_poly_gcd_euclidean(
392 G: ca_ptr,
393 A: ca_srcptr,
394 lenA: slong,
395 B: ca_srcptr,
396 lenB: slong,
397 ctx: *mut ca_ctx_struct,
398 ) -> slong;
399 pub fn ca_poly_gcd_euclidean(
400 G: *mut ca_poly_struct,
401 A: *const ca_poly_struct,
402 B: *const ca_poly_struct,
403 ctx: *mut ca_ctx_struct,
404 ) -> libc::c_int;
405 pub fn _ca_poly_gcd(
406 G: ca_ptr,
407 A: ca_srcptr,
408 lenA: slong,
409 B: ca_srcptr,
410 lenB: slong,
411 ctx: *mut ca_ctx_struct,
412 ) -> slong;
413 pub fn ca_poly_gcd(
414 G: *mut ca_poly_struct,
415 A: *const ca_poly_struct,
416 B: *const ca_poly_struct,
417 ctx: *mut ca_ctx_struct,
418 ) -> libc::c_int;
419 pub fn _ca_poly_inv_series(
420 res: ca_ptr,
421 f: ca_srcptr,
422 flen: slong,
423 len: slong,
424 ctx: *mut ca_ctx_struct,
425 );
426 pub fn ca_poly_inv_series(
427 res: *mut ca_poly_struct,
428 f: *const ca_poly_struct,
429 len: slong,
430 ctx: *mut ca_ctx_struct,
431 );
432 pub fn _ca_poly_div_series(
433 res: ca_ptr,
434 f: ca_srcptr,
435 flen: slong,
436 g: ca_srcptr,
437 glen: slong,
438 len: slong,
439 ctx: *mut ca_ctx_struct,
440 );
441 pub fn ca_poly_div_series(
442 res: *mut ca_poly_struct,
443 f: *const ca_poly_struct,
444 g: *const ca_poly_struct,
445 len: slong,
446 ctx: *mut ca_ctx_struct,
447 );
448 pub fn _ca_poly_exp_series(
449 res: ca_ptr,
450 f: ca_srcptr,
451 flen: slong,
452 len: slong,
453 ctx: *mut ca_ctx_struct,
454 );
455 pub fn ca_poly_exp_series(
456 res: *mut ca_poly_struct,
457 f: *const ca_poly_struct,
458 len: slong,
459 ctx: *mut ca_ctx_struct,
460 );
461 pub fn _ca_poly_log_series(
462 res: ca_ptr,
463 f: ca_srcptr,
464 flen: slong,
465 len: slong,
466 ctx: *mut ca_ctx_struct,
467 );
468 pub fn ca_poly_log_series(
469 res: *mut ca_poly_struct,
470 f: *const ca_poly_struct,
471 len: slong,
472 ctx: *mut ca_ctx_struct,
473 );
474 pub fn _ca_poly_vec_init(len: slong, ctx: *mut ca_ctx_struct) -> *mut ca_poly_struct;
475 pub fn ca_poly_vec_init(res: *mut ca_poly_vec_struct, len: slong, ctx: *mut ca_ctx_struct);
476 pub fn _ca_poly_vec_fit_length(
477 vec: *mut ca_poly_vec_struct,
478 len: slong,
479 ctx: *mut ca_ctx_struct,
480 );
481 pub fn ca_poly_vec_set_length(
482 vec: *mut ca_poly_vec_struct,
483 len: slong,
484 ctx: *mut ca_ctx_struct,
485 );
486 pub fn _ca_poly_vec_clear(v: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
487 pub fn ca_poly_vec_clear(vec: *mut ca_poly_vec_struct, ctx: *mut ca_ctx_struct);
488 pub fn ca_poly_vec_append(
489 vec: *mut ca_poly_vec_struct,
490 f: *const ca_poly_struct,
491 ctx: *mut ca_ctx_struct,
492 );
493 pub fn ca_poly_factor_squarefree(
494 c: *mut ca_struct,
495 fac: *mut ca_poly_vec_struct,
496 exp: *mut ulong,
497 F: *const ca_poly_struct,
498 ctx: *mut ca_ctx_struct,
499 ) -> libc::c_int;
500 pub fn ca_poly_squarefree_part(
501 res: *mut ca_poly_struct,
502 poly: *const ca_poly_struct,
503 ctx: *mut ca_ctx_struct,
504 ) -> libc::c_int;
505 pub fn _ca_poly_set_roots(
506 poly: ca_ptr,
507 roots: ca_srcptr,
508 exp: *const ulong,
509 len: slong,
510 ctx: *mut ca_ctx_struct,
511 );
512 pub fn ca_poly_set_roots(
513 poly: *mut ca_poly_struct,
514 roots: *mut ca_vec_struct,
515 exp: *const ulong,
516 ctx: *mut ca_ctx_struct,
517 );
518 pub fn _ca_poly_roots(
519 roots: ca_ptr,
520 poly: ca_srcptr,
521 len: slong,
522 ctx: *mut ca_ctx_struct,
523 ) -> libc::c_int;
524 pub fn ca_poly_roots(
525 roots: *mut ca_vec_struct,
526 exp: *mut ulong,
527 poly: *const ca_poly_struct,
528 ctx: *mut ca_ctx_struct,
529 ) -> libc::c_int;
530}