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
/* automatically generated by rust-bindgen 0.70.1 */

use crate::deps::*;
use crate::arf_types::*;
use crate::flint::*;
use crate::fmpz_types::*;
use crate::gr_types::*;
use crate::mpoly_types::*;


pub const FEXPR_TYPE_BITS: u32 = 4;
pub const FEXPR_SMALL_SYMBOL_LEN: u32 = 7;
pub const FEXPR_LATEX_SMALL: u32 = 1;
pub const FEXPR_LATEX_LOGIC: u32 = 2;
#[repr(C)]
pub struct fexpr_struct {
    pub data: *mut ulong,
    pub alloc: slong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fexpr_struct"][::std::mem::size_of::<fexpr_struct>() - 16usize];
    ["Alignment of fexpr_struct"][::std::mem::align_of::<fexpr_struct>() - 8usize];
    ["Offset of field: fexpr_struct::data"][::std::mem::offset_of!(fexpr_struct, data) - 0usize];
    ["Offset of field: fexpr_struct::alloc"][::std::mem::offset_of!(fexpr_struct, alloc) - 8usize];
};
impl Default for fexpr_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 fexpr_t = [fexpr_struct; 1usize];
pub type fexpr_ptr = *mut fexpr_struct;
pub type fexpr_srcptr = *const fexpr_struct;
#[repr(C)]
pub struct fexpr_vec_struct {
    pub entries: *mut fexpr_struct,
    pub alloc: slong,
    pub length: slong,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fexpr_vec_struct"][::std::mem::size_of::<fexpr_vec_struct>() - 24usize];
    ["Alignment of fexpr_vec_struct"][::std::mem::align_of::<fexpr_vec_struct>() - 8usize];
    ["Offset of field: fexpr_vec_struct::entries"]
        [::std::mem::offset_of!(fexpr_vec_struct, entries) - 0usize];
    ["Offset of field: fexpr_vec_struct::alloc"]
        [::std::mem::offset_of!(fexpr_vec_struct, alloc) - 8usize];
    ["Offset of field: fexpr_vec_struct::length"]
        [::std::mem::offset_of!(fexpr_vec_struct, length) - 16usize];
};
impl Default for fexpr_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 fexpr_vec_t = [fexpr_vec_struct; 1usize];
extern "C" {
    #[link_name = "fexpr_init__extern"]
    pub fn fexpr_init(expr: *mut fexpr_struct);
    #[link_name = "fexpr_clear__extern"]
    pub fn fexpr_clear(expr: *mut fexpr_struct);
    #[link_name = "_fexpr_vec_init__extern"]
    pub fn _fexpr_vec_init(len: slong) -> fexpr_ptr;
    #[link_name = "_fexpr_vec_clear__extern"]
    pub fn _fexpr_vec_clear(vec: fexpr_ptr, len: slong);
    #[link_name = "fexpr_fit_size__extern"]
    pub fn fexpr_fit_size(expr: *mut fexpr_struct, size: slong);
    #[link_name = "_fexpr_size__extern"]
    pub fn _fexpr_size(expr: *const ulong) -> slong;
    #[link_name = "fexpr_size__extern"]
    pub fn fexpr_size(expr: *const fexpr_struct) -> slong;
    #[link_name = "fexpr_set__extern"]
    pub fn fexpr_set(res: *mut fexpr_struct, expr: *const fexpr_struct);
    #[link_name = "fexpr_swap__extern"]
    pub fn fexpr_swap(a: *mut fexpr_struct, b: *mut fexpr_struct);
    #[link_name = "fexpr_equal__extern"]
    pub fn fexpr_equal(a: *const fexpr_struct, b: *const fexpr_struct) -> libc::c_int;
    pub fn fexpr_equal_si(expr: *const fexpr_struct, c: slong) -> libc::c_int;
    pub fn fexpr_equal_ui(expr: *const fexpr_struct, c: ulong) -> libc::c_int;
    pub fn fexpr_hash(expr: *const fexpr_struct) -> ulong;
    pub fn fexpr_cmp_fast(a: *const fexpr_struct, b: *const fexpr_struct) -> libc::c_int;
    pub fn _fexpr_vec_sort_fast(vec: fexpr_ptr, len: slong);
    #[link_name = "_fexpr_is_integer__extern"]
    pub fn _fexpr_is_integer(expr: *const ulong) -> libc::c_int;
    #[link_name = "fexpr_is_integer__extern"]
    pub fn fexpr_is_integer(expr: *const fexpr_struct) -> libc::c_int;
    pub fn fexpr_is_neg_integer(expr: *const fexpr_struct) -> libc::c_int;
    #[link_name = "_fexpr_is_symbol__extern"]
    pub fn _fexpr_is_symbol(expr: *const ulong) -> libc::c_int;
    #[link_name = "fexpr_is_symbol__extern"]
    pub fn fexpr_is_symbol(expr: *const fexpr_struct) -> libc::c_int;
    #[link_name = "_fexpr_is_string__extern"]
    pub fn _fexpr_is_string(expr: *const ulong) -> libc::c_int;
    #[link_name = "fexpr_is_string__extern"]
    pub fn fexpr_is_string(expr: *const fexpr_struct) -> libc::c_int;
    #[link_name = "_fexpr_is_atom__extern"]
    pub fn _fexpr_is_atom(expr: *const ulong) -> libc::c_int;
    #[link_name = "fexpr_is_atom__extern"]
    pub fn fexpr_is_atom(expr: *const fexpr_struct) -> libc::c_int;
    #[link_name = "fexpr_zero__extern"]
    pub fn fexpr_zero(res: *mut fexpr_struct);
    #[link_name = "fexpr_is_zero__extern"]
    pub fn fexpr_is_zero(expr: *const fexpr_struct) -> libc::c_int;
    pub fn fexpr_set_si(res: *mut fexpr_struct, c: slong);
    pub fn fexpr_set_ui(res: *mut fexpr_struct, c: ulong);
    pub fn fexpr_set_fmpz(res: *mut fexpr_struct, c: *const fmpz);
    pub fn fexpr_get_fmpz(c: *mut fmpz, x: *const fexpr_struct) -> libc::c_int;
    pub fn fexpr_set_fmpq(res: *mut fexpr_struct, x: *const fmpq);
    #[link_name = "fexpr_set_symbol_builtin__extern"]
    pub fn fexpr_set_symbol_builtin(res: *mut fexpr_struct, id: slong);
    pub fn fexpr_set_symbol_str(res: *mut fexpr_struct, s: *const libc::c_char);
    pub fn fexpr_set_string(res: *mut fexpr_struct, s: *const libc::c_char);
    pub fn fexpr_get_symbol_str(expr: *const fexpr_struct) -> *mut libc::c_char;
    pub fn fexpr_get_string(expr: *const fexpr_struct) -> *mut libc::c_char;
    pub fn fexpr_get_decimal_str(
        expr: *const fexpr_struct,
        digits: slong,
        flags: ulong,
    ) -> *mut libc::c_char;
    pub fn fexpr_depth(expr: *const fexpr_struct) -> slong;
    pub fn fexpr_num_leaves(expr: *const fexpr_struct) -> slong;
    #[link_name = "fexpr_size_bytes__extern"]
    pub fn fexpr_size_bytes(expr: *const fexpr_struct) -> slong;
    #[link_name = "fexpr_allocated_bytes__extern"]
    pub fn fexpr_allocated_bytes(expr: *const fexpr_struct) -> slong;
    #[link_name = "fexpr_is_any_builtin_symbol__extern"]
    pub fn fexpr_is_any_builtin_symbol(expr: *const fexpr_struct) -> libc::c_int;
    #[link_name = "fexpr_is_builtin_symbol__extern"]
    pub fn fexpr_is_builtin_symbol(expr: *const fexpr_struct, i: slong) -> libc::c_int;
    pub fn fexpr_is_builtin_call(expr: *const fexpr_struct, i: slong) -> libc::c_int;
    pub fn fexpr_is_any_builtin_call(expr: *const fexpr_struct) -> libc::c_int;
    #[link_name = "fexpr_nargs__extern"]
    pub fn fexpr_nargs(expr: *const fexpr_struct) -> slong;
    pub fn fexpr_func(res: *mut fexpr_struct, expr: *const fexpr_struct);
    pub fn fexpr_view_func(res: *mut fexpr_struct, expr: *const fexpr_struct);
    pub fn fexpr_arg(res: *mut fexpr_struct, expr: *const fexpr_struct, i: slong);
    pub fn fexpr_view_arg(res: *mut fexpr_struct, expr: *const fexpr_struct, i: slong);
    #[link_name = "fexpr_view_next__extern"]
    pub fn fexpr_view_next(view: *mut fexpr_struct);
    pub fn fexpr_call0(res: *mut fexpr_struct, f: *const fexpr_struct);
    pub fn fexpr_call1(res: *mut fexpr_struct, f: *const fexpr_struct, x1: *const fexpr_struct);
    pub fn fexpr_call2(
        res: *mut fexpr_struct,
        f: *const fexpr_struct,
        x1: *const fexpr_struct,
        x2: *const fexpr_struct,
    );
    pub fn fexpr_call3(
        res: *mut fexpr_struct,
        f: *const fexpr_struct,
        x1: *const fexpr_struct,
        x2: *const fexpr_struct,
        x3: *const fexpr_struct,
    );
    pub fn fexpr_call4(
        res: *mut fexpr_struct,
        f: *const fexpr_struct,
        x1: *const fexpr_struct,
        x2: *const fexpr_struct,
        x3: *const fexpr_struct,
        x4: *const fexpr_struct,
    );
    pub fn fexpr_call_vec(
        res: *mut fexpr_struct,
        f: *const fexpr_struct,
        args: fexpr_srcptr,
        len: slong,
    );
    pub fn fexpr_call_builtin1(res: *mut fexpr_struct, f: slong, x: *const fexpr_struct);
    pub fn fexpr_call_builtin2(
        res: *mut fexpr_struct,
        f: slong,
        x: *const fexpr_struct,
        y: *const fexpr_struct,
    );
    pub fn fexpr_contains(expr: *const fexpr_struct, x: *const fexpr_struct) -> libc::c_int;
    pub fn fexpr_replace(
        res: *mut fexpr_struct,
        expr: *const fexpr_struct,
        x: *const fexpr_struct,
        y: *const fexpr_struct,
    ) -> libc::c_int;
    pub fn fexpr_replace2(
        res: *mut fexpr_struct,
        expr: *const fexpr_struct,
        x1: *const fexpr_struct,
        y1: *const fexpr_struct,
        x2: *const fexpr_struct,
        y2: *const fexpr_struct,
    ) -> libc::c_int;
    pub fn fexpr_replace_vec(
        res: *mut fexpr_struct,
        expr: *const fexpr_struct,
        xs: *const fexpr_vec_struct,
        ys: *const fexpr_vec_struct,
    ) -> libc::c_int;
    pub fn fexpr_write(stream: *mut gr_stream_struct, expr: *const fexpr_struct);
    pub fn fexpr_print(expr: *const fexpr_struct);
    pub fn fexpr_get_str(expr: *const fexpr_struct) -> *mut libc::c_char;
    pub fn fexpr_write_latex(out: *mut gr_stream_struct, expr: *const fexpr_struct, flags: ulong);
    pub fn fexpr_print_latex(expr: *const fexpr_struct, flags: ulong);
    pub fn fexpr_get_str_latex(expr: *const fexpr_struct, flags: ulong) -> *mut libc::c_char;
    pub fn fexpr_write_latex_call(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_subscript(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_subscript_call(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_infix(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_mul(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_div(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_neg_pos(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_add(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_sub(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_pow(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_exp(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_factorial(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_integral(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_sum_product(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_divsum(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_limit(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_derivative(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_logic(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_collection(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_matrix(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_simple(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_simple2(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_simple2_small(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_alg_structure(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_setop(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_cases(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_where(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_show_form(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_range(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_decimal(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_call1_optional_derivative(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_call2_optional_derivative(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_sub1_call1_optional_derivative(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_sub1_call2_optional_derivative(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_misc_special(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_write_latex_residue(
        out: *mut gr_stream_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    );
    pub fn fexpr_set_arf(res: *mut fexpr_struct, x: *const arf_struct);
    pub fn fexpr_set_d(res: *mut fexpr_struct, x: f64);
    pub fn fexpr_set_re_im_d(res: *mut fexpr_struct, x: f64, y: f64);
    pub fn fexpr_neg(res: *mut fexpr_struct, a: *const fexpr_struct);
    pub fn fexpr_add(res: *mut fexpr_struct, a: *const fexpr_struct, b: *const fexpr_struct);
    pub fn fexpr_sub(res: *mut fexpr_struct, a: *const fexpr_struct, b: *const fexpr_struct);
    pub fn fexpr_mul(res: *mut fexpr_struct, a: *const fexpr_struct, b: *const fexpr_struct);
    pub fn fexpr_div(res: *mut fexpr_struct, a: *const fexpr_struct, b: *const fexpr_struct);
    pub fn fexpr_pow(res: *mut fexpr_struct, a: *const fexpr_struct, b: *const fexpr_struct);
    pub fn fexpr_is_arithmetic_operation(expr: *const fexpr_struct) -> libc::c_int;
    pub fn fexpr_arithmetic_nodes(nodes: *mut fexpr_vec_struct, expr: *const fexpr_struct);
    pub fn fexpr_get_fmpz_mpoly_q(
        res: *mut fmpz_mpoly_q_struct,
        expr: *const fexpr_struct,
        vars: *const fexpr_vec_struct,
        ctx: *const fmpz_mpoly_ctx_struct,
    ) -> libc::c_int;
    pub fn fexpr_set_fmpz_mpoly(
        res: *mut fexpr_struct,
        poly: *const fmpz_mpoly_struct,
        vars: *const fexpr_vec_struct,
        ctx: *const fmpz_mpoly_ctx_struct,
    );
    pub fn fexpr_set_fmpz_mpoly_q(
        res: *mut fexpr_struct,
        frac: *const fmpz_mpoly_q_struct,
        vars: *const fexpr_vec_struct,
        ctx: *const fmpz_mpoly_ctx_struct,
    );
    pub fn fexpr_expanded_normal_form(
        res: *mut fexpr_struct,
        expr: *const fexpr_struct,
        flags: ulong,
    ) -> libc::c_int;
    #[link_name = "fexpr_vec_init__extern"]
    pub fn fexpr_vec_init(vec: *mut fexpr_vec_struct, len: slong);
    #[link_name = "fexpr_vec_print__extern"]
    pub fn fexpr_vec_print(F: *const fexpr_vec_struct);
    #[link_name = "fexpr_vec_swap__extern"]
    pub fn fexpr_vec_swap(x: *mut fexpr_vec_struct, y: *mut fexpr_vec_struct);
    #[link_name = "fexpr_vec_fit_length__extern"]
    pub fn fexpr_vec_fit_length(vec: *mut fexpr_vec_struct, len: slong);
    #[link_name = "fexpr_vec_clear__extern"]
    pub fn fexpr_vec_clear(vec: *mut fexpr_vec_struct);
    #[link_name = "fexpr_vec_set__extern"]
    pub fn fexpr_vec_set(dest: *mut fexpr_vec_struct, src: *const fexpr_vec_struct);
    #[link_name = "fexpr_vec_append__extern"]
    pub fn fexpr_vec_append(vec: *mut fexpr_vec_struct, f: *const fexpr_struct);
    #[link_name = "fexpr_vec_insert_unique__extern"]
    pub fn fexpr_vec_insert_unique(vec: *mut fexpr_vec_struct, f: *const fexpr_struct) -> slong;
    #[link_name = "fexpr_vec_set_length__extern"]
    pub fn fexpr_vec_set_length(vec: *mut fexpr_vec_struct, len: slong);
}