flint-sys 0.9.0

Bindings to the FLINT C library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
/* automatically generated by rust-bindgen 0.70.1 */

use crate::deps::*;
use crate::ca_types::*;
use crate::fexpr::*;
use crate::flint::*;
use crate::fmpq_types::*;
use crate::fmpz_types::*;
use crate::gr_types::*;


#[repr(C)]
pub struct ca_poly_vec_struct {
    pub entries: *mut ca_poly_struct,
    pub length: slong,
    pub alloc: slong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of ca_poly_vec_struct"][::std::mem::size_of::<ca_poly_vec_struct>() - 24usize];
    ["Alignment of ca_poly_vec_struct"][::std::mem::align_of::<ca_poly_vec_struct>() - 8usize];
    ["Offset of field: ca_poly_vec_struct::entries"]
        [::std::mem::offset_of!(ca_poly_vec_struct, entries) - 0usize];
    ["Offset of field: ca_poly_vec_struct::length"]
        [::std::mem::offset_of!(ca_poly_vec_struct, length) - 8usize];
    ["Offset of field: ca_poly_vec_struct::alloc"]
        [::std::mem::offset_of!(ca_poly_vec_struct, alloc) - 16usize];
};
impl Default for ca_poly_vec_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 ca_poly_vec_t = [ca_poly_vec_struct; 1usize];
extern "C" {
    #[link_name = "ca_poly_coeff_ptr__extern"]
    pub fn ca_poly_coeff_ptr(poly: *mut ca_poly_struct, i: slong) -> ca_ptr;
    pub fn ca_poly_init(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_init2(poly: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_clear(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_fit_length(poly: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
    pub fn _ca_poly_set_length(poly: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
    pub fn _ca_poly_normalise(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
    #[link_name = "ca_poly_swap__extern"]
    pub fn ca_poly_swap(
        poly1: *mut ca_poly_struct,
        poly2: *mut ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_set_ca(poly: *mut ca_poly_struct, x: *const ca_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_set_si(poly: *mut ca_poly_struct, x: slong, ctx: *mut ca_ctx_struct);
    #[link_name = "ca_poly_zero__extern"]
    pub fn ca_poly_zero(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
    #[link_name = "ca_poly_x__extern"]
    pub fn ca_poly_x(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
    #[link_name = "ca_poly_one__extern"]
    pub fn ca_poly_one(poly: *mut ca_poly_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_set(
        res: *mut ca_poly_struct,
        src: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_set_fmpz_poly(
        res: *mut ca_poly_struct,
        src: *const fmpz_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_set_fmpq_poly(
        res: *mut ca_poly_struct,
        src: *const fmpq_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_transfer(
        res: *mut ca_poly_struct,
        res_ctx: *mut ca_ctx_struct,
        src: *const ca_poly_struct,
        src_ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_set_coeff_ca(
        poly: *mut ca_poly_struct,
        n: slong,
        x: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_get_fexpr(
        res: *mut fexpr_struct,
        A: *const ca_poly_struct,
        flags: ulong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_randtest(
        poly: *mut ca_poly_struct,
        state: *mut flint_rand_struct,
        len: slong,
        depth: slong,
        bits: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_randtest_rational(
        poly: *mut ca_poly_struct,
        state: *mut flint_rand_struct,
        len: slong,
        bits: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_print(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_printn(poly: *const ca_poly_struct, digits: slong, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_is_proper(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct) -> libc::c_int;
    pub fn ca_poly_make_monic(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn _ca_poly_reverse(
        res: ca_ptr,
        poly: ca_srcptr,
        len: slong,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_reverse(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_check_equal(
        poly1: ca_srcptr,
        len1: slong,
        poly2: ca_srcptr,
        len2: slong,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_poly_check_equal(
        poly1: *const ca_poly_struct,
        poly2: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_poly_check_is_zero(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct) -> truth_t;
    pub fn ca_poly_check_is_one(poly: *const ca_poly_struct, ctx: *mut ca_ctx_struct) -> truth_t;
    pub fn _ca_poly_shift_left(
        res: ca_ptr,
        poly: ca_srcptr,
        len: slong,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_shift_left(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_shift_right(
        res: ca_ptr,
        poly: ca_srcptr,
        len: slong,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_shift_right(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_neg(
        res: *mut ca_poly_struct,
        src: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_add(
        res: ca_ptr,
        poly1: ca_srcptr,
        len1: slong,
        poly2: ca_srcptr,
        len2: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_add(
        res: *mut ca_poly_struct,
        poly1: *const ca_poly_struct,
        poly2: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_sub(
        res: ca_ptr,
        poly1: ca_srcptr,
        len1: slong,
        poly2: ca_srcptr,
        len2: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_sub(
        res: *mut ca_poly_struct,
        poly1: *const ca_poly_struct,
        poly2: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_mul(
        C: ca_ptr,
        A: ca_srcptr,
        lenA: slong,
        B: ca_srcptr,
        lenB: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_mul(
        res: *mut ca_poly_struct,
        poly1: *const ca_poly_struct,
        poly2: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_poly_mul_ca__extern"]
    pub fn ca_poly_mul_ca(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        c: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_poly_div_ca__extern"]
    pub fn ca_poly_div_ca(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        c: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_poly_div_fmpz__extern"]
    pub fn ca_poly_div_fmpz(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        c: *const fmpz,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_mullow_same_nf(
        C: ca_ptr,
        A: ca_srcptr,
        Alen: slong,
        B: ca_srcptr,
        Blen: slong,
        len: slong,
        K: *mut ca_field_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_mullow(
        C: ca_ptr,
        A: ca_srcptr,
        lenA: slong,
        B: ca_srcptr,
        lenB: slong,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_mullow(
        res: *mut ca_poly_struct,
        poly1: *const ca_poly_struct,
        poly2: *const ca_poly_struct,
        n: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_divrem_basecase(
        Q: ca_ptr,
        R: ca_ptr,
        A: ca_srcptr,
        lenA: slong,
        B: ca_srcptr,
        lenB: slong,
        invB: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_divrem_basecase(
        Q: *mut ca_poly_struct,
        R: *mut ca_poly_struct,
        A: *const ca_poly_struct,
        B: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn _ca_poly_divrem(
        Q: ca_ptr,
        R: ca_ptr,
        A: ca_srcptr,
        lenA: slong,
        B: ca_srcptr,
        lenB: slong,
        invB: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_divrem(
        Q: *mut ca_poly_struct,
        R: *mut ca_poly_struct,
        A: *const ca_poly_struct,
        B: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_poly_div(
        Q: *mut ca_poly_struct,
        A: *const ca_poly_struct,
        B: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_poly_rem(
        R: *mut ca_poly_struct,
        A: *const ca_poly_struct,
        B: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn _ca_poly_pow_ui_trunc(
        res: ca_ptr,
        f: ca_srcptr,
        flen: slong,
        exp: ulong,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_pow_ui_trunc(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        exp: ulong,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_pow_ui(
        res: ca_ptr,
        f: ca_srcptr,
        flen: slong,
        exp: ulong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_pow_ui(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        exp: ulong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_evaluate_horner(
        res: *mut ca_struct,
        f: ca_srcptr,
        len: slong,
        x: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_evaluate_horner(
        res: *mut ca_struct,
        f: *const ca_poly_struct,
        a: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_evaluate(
        res: *mut ca_struct,
        f: ca_srcptr,
        len: slong,
        x: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_evaluate(
        res: *mut ca_struct,
        f: *const ca_poly_struct,
        a: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_compose(
        res: ca_ptr,
        poly1: ca_srcptr,
        len1: slong,
        poly2: ca_srcptr,
        len2: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_compose(
        res: *mut ca_poly_struct,
        poly1: *const ca_poly_struct,
        poly2: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_derivative(res: ca_ptr, poly: ca_srcptr, len: slong, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_derivative(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_integral(res: ca_ptr, poly: ca_srcptr, len: slong, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_integral(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_gcd_euclidean(
        G: ca_ptr,
        A: ca_srcptr,
        lenA: slong,
        B: ca_srcptr,
        lenB: slong,
        ctx: *mut ca_ctx_struct,
    ) -> slong;
    pub fn ca_poly_gcd_euclidean(
        G: *mut ca_poly_struct,
        A: *const ca_poly_struct,
        B: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn _ca_poly_gcd(
        G: ca_ptr,
        A: ca_srcptr,
        lenA: slong,
        B: ca_srcptr,
        lenB: slong,
        ctx: *mut ca_ctx_struct,
    ) -> slong;
    pub fn ca_poly_gcd(
        G: *mut ca_poly_struct,
        A: *const ca_poly_struct,
        B: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn _ca_poly_inv_series(
        res: ca_ptr,
        f: ca_srcptr,
        flen: slong,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_inv_series(
        res: *mut ca_poly_struct,
        f: *const ca_poly_struct,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_div_series(
        res: ca_ptr,
        f: ca_srcptr,
        flen: slong,
        g: ca_srcptr,
        glen: slong,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_div_series(
        res: *mut ca_poly_struct,
        f: *const ca_poly_struct,
        g: *const ca_poly_struct,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_exp_series(
        res: ca_ptr,
        f: ca_srcptr,
        flen: slong,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_exp_series(
        res: *mut ca_poly_struct,
        f: *const ca_poly_struct,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_log_series(
        res: ca_ptr,
        f: ca_srcptr,
        flen: slong,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_log_series(
        res: *mut ca_poly_struct,
        f: *const ca_poly_struct,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_vec_init(len: slong, ctx: *mut ca_ctx_struct) -> *mut ca_poly_struct;
    pub fn ca_poly_vec_init(res: *mut ca_poly_vec_struct, len: slong, ctx: *mut ca_ctx_struct);
    pub fn _ca_poly_vec_fit_length(
        vec: *mut ca_poly_vec_struct,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_vec_set_length(
        vec: *mut ca_poly_vec_struct,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_vec_clear(v: *mut ca_poly_struct, len: slong, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_vec_clear(vec: *mut ca_poly_vec_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_poly_vec_append(
        vec: *mut ca_poly_vec_struct,
        f: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_factor_squarefree(
        c: *mut ca_struct,
        fac: *mut ca_poly_vec_struct,
        exp: *mut ulong,
        F: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_poly_squarefree_part(
        res: *mut ca_poly_struct,
        poly: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn _ca_poly_set_roots(
        poly: ca_ptr,
        roots: ca_srcptr,
        exp: *const ulong,
        len: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_poly_set_roots(
        poly: *mut ca_poly_struct,
        roots: *mut ca_vec_struct,
        exp: *const ulong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_poly_roots(
        roots: ca_ptr,
        poly: ca_srcptr,
        len: slong,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_poly_roots(
        roots: *mut ca_vec_struct,
        exp: *mut ulong,
        poly: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
}