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

use libc::*;
use crate::deps::*;
use crate::flint::*;


pub const FMPQ_RECONSTRUCT_HGCD_CUTOFF: u32 = 500;
#[doc = " 2x2 integer matrix"]
#[repr(C)]
pub struct _fmpz_mat22_struct {
    pub _11: fmpz_t,
    pub _12: fmpz_t,
    pub _21: fmpz_t,
    pub _22: fmpz_t,
    pub det: libc::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _fmpz_mat22_struct"][::std::mem::size_of::<_fmpz_mat22_struct>() - 40usize];
    ["Alignment of _fmpz_mat22_struct"][::std::mem::align_of::<_fmpz_mat22_struct>() - 8usize];
    ["Offset of field: _fmpz_mat22_struct::_11"]
        [::std::mem::offset_of!(_fmpz_mat22_struct, _11) - 0usize];
    ["Offset of field: _fmpz_mat22_struct::_12"]
        [::std::mem::offset_of!(_fmpz_mat22_struct, _12) - 8usize];
    ["Offset of field: _fmpz_mat22_struct::_21"]
        [::std::mem::offset_of!(_fmpz_mat22_struct, _21) - 16usize];
    ["Offset of field: _fmpz_mat22_struct::_22"]
        [::std::mem::offset_of!(_fmpz_mat22_struct, _22) - 24usize];
    ["Offset of field: _fmpz_mat22_struct::det"]
        [::std::mem::offset_of!(_fmpz_mat22_struct, det) - 32usize];
};
impl Default for _fmpz_mat22_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 _fmpz_mat22_t = [_fmpz_mat22_struct; 1usize];
#[repr(C)]
pub struct _ui_mat22_struct {
    pub _11: ulong,
    pub _12: ulong,
    pub _21: ulong,
    pub _22: ulong,
    pub det: libc::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _ui_mat22_struct"][::std::mem::size_of::<_ui_mat22_struct>() - 40usize];
    ["Alignment of _ui_mat22_struct"][::std::mem::align_of::<_ui_mat22_struct>() - 8usize];
    ["Offset of field: _ui_mat22_struct::_11"]
        [::std::mem::offset_of!(_ui_mat22_struct, _11) - 0usize];
    ["Offset of field: _ui_mat22_struct::_12"]
        [::std::mem::offset_of!(_ui_mat22_struct, _12) - 8usize];
    ["Offset of field: _ui_mat22_struct::_21"]
        [::std::mem::offset_of!(_ui_mat22_struct, _21) - 16usize];
    ["Offset of field: _ui_mat22_struct::_22"]
        [::std::mem::offset_of!(_ui_mat22_struct, _22) - 24usize];
    ["Offset of field: _ui_mat22_struct::det"]
        [::std::mem::offset_of!(_ui_mat22_struct, det) - 32usize];
};
impl Default for _ui_mat22_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 _ui_mat22_t = [_ui_mat22_struct; 1usize];
#[doc = " resizable integer vector specific to cfrac functionality"]
#[repr(C)]
pub struct _fmpq_cfrac_list_struct {
    pub array: *mut fmpz,
    pub length: slong,
    pub alloc: slong,
    pub limit: slong,
    pub alt_sum: fmpz_t,
    pub want_alt_sum: libc::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _fmpq_cfrac_list_struct"][::std::mem::size_of::<_fmpq_cfrac_list_struct>() - 48usize];
    ["Alignment of _fmpq_cfrac_list_struct"]
        [::std::mem::align_of::<_fmpq_cfrac_list_struct>() - 8usize];
    ["Offset of field: _fmpq_cfrac_list_struct::array"]
        [::std::mem::offset_of!(_fmpq_cfrac_list_struct, array) - 0usize];
    ["Offset of field: _fmpq_cfrac_list_struct::length"]
        [::std::mem::offset_of!(_fmpq_cfrac_list_struct, length) - 8usize];
    ["Offset of field: _fmpq_cfrac_list_struct::alloc"]
        [::std::mem::offset_of!(_fmpq_cfrac_list_struct, alloc) - 16usize];
    ["Offset of field: _fmpq_cfrac_list_struct::limit"]
        [::std::mem::offset_of!(_fmpq_cfrac_list_struct, limit) - 24usize];
    ["Offset of field: _fmpq_cfrac_list_struct::alt_sum"]
        [::std::mem::offset_of!(_fmpq_cfrac_list_struct, alt_sum) - 32usize];
    ["Offset of field: _fmpq_cfrac_list_struct::want_alt_sum"]
        [::std::mem::offset_of!(_fmpq_cfrac_list_struct, want_alt_sum) - 40usize];
};
impl Default for _fmpq_cfrac_list_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 _fmpq_cfrac_list_t = [_fmpq_cfrac_list_struct; 1usize];
#[doc = " ball for closed interval [left, right]"]
#[repr(C)]
pub struct _fmpq_ball_struct {
    pub left_num: fmpz_t,
    pub left_den: fmpz_t,
    pub right_num: fmpz_t,
    pub right_den: fmpz_t,
    pub exact: libc::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _fmpq_ball_struct"][::std::mem::size_of::<_fmpq_ball_struct>() - 40usize];
    ["Alignment of _fmpq_ball_struct"][::std::mem::align_of::<_fmpq_ball_struct>() - 8usize];
    ["Offset of field: _fmpq_ball_struct::left_num"]
        [::std::mem::offset_of!(_fmpq_ball_struct, left_num) - 0usize];
    ["Offset of field: _fmpq_ball_struct::left_den"]
        [::std::mem::offset_of!(_fmpq_ball_struct, left_den) - 8usize];
    ["Offset of field: _fmpq_ball_struct::right_num"]
        [::std::mem::offset_of!(_fmpq_ball_struct, right_num) - 16usize];
    ["Offset of field: _fmpq_ball_struct::right_den"]
        [::std::mem::offset_of!(_fmpq_ball_struct, right_den) - 24usize];
    ["Offset of field: _fmpq_ball_struct::exact"]
        [::std::mem::offset_of!(_fmpq_ball_struct, exact) - 32usize];
};
impl Default for _fmpq_ball_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 _fmpq_ball_t = [_fmpq_ball_struct; 1usize];
extern "C" {
    #[link_name = "fmpq_init__extern"]
    pub fn fmpq_init(x: *mut fmpq);
    #[link_name = "fmpq_clear__extern"]
    pub fn fmpq_clear(x: *mut fmpq);
    #[link_name = "fmpq_swap__extern"]
    pub fn fmpq_swap(op1: *mut fmpq, op2: *mut fmpq);
    pub fn _fmpq_canonicalise(num: *mut fmpz, den: *mut fmpz);
    pub fn fmpq_canonicalise(res: *mut fmpq);
    pub fn _fmpq_is_canonical(num: *const fmpz, den: *const fmpz) -> libc::c_int;
    pub fn fmpq_is_canonical(x: *const fmpq) -> libc::c_int;
    #[link_name = "fmpq_zero__extern"]
    pub fn fmpq_zero(res: *mut fmpq);
    #[link_name = "fmpq_one__extern"]
    pub fn fmpq_one(res: *mut fmpq);
    #[link_name = "fmpq_set__extern"]
    pub fn fmpq_set(dest: *mut fmpq, src: *const fmpq);
    pub fn flint_mpq_init_set_readonly(z: *mut __mpq_struct, f: *const fmpq);
    pub fn flint_mpq_clear_readonly(z: *mut __mpq_struct);
    pub fn fmpq_init_set_readonly(f: *mut fmpq, z: *const __mpq_struct);
    pub fn fmpq_clear_readonly(f: *mut fmpq);
    pub fn _fmpq_set_si(rnum: *mut fmpz, rden: *mut fmpz, p: slong, q: ulong);
    pub fn _fmpq_set_ui(rnum: *mut fmpz, rden: *mut fmpz, p: ulong, q: ulong);
    pub fn fmpq_set_si(res: *mut fmpq, p: slong, q: ulong);
    pub fn fmpq_set_ui(res: *mut fmpq, p: ulong, q: ulong);
    pub fn fmpq_set_fmpz_frac(res: *mut fmpq, p: *const fmpz, q: *const fmpz);
    pub fn fmpq_set_mpq(dest: *mut fmpq, src: *const __mpq_struct);
    #[link_name = "fmpq_set_fmpz__extern"]
    pub fn fmpq_set_fmpz(q: *mut fmpq, n: *const fmpz);
    pub fn fmpq_get_d(a: *const fmpq) -> f64;
    pub fn fmpq_get_mpz_frac(a: *mut __mpz_struct, b: *mut __mpz_struct, c: *mut fmpq);
    pub fn fmpq_get_mpq(dest: *mut __mpq_struct, src: *const fmpq);
    pub fn fmpq_get_mpfr(r: *mut __mpfr_struct, x: *const fmpq, rnd: mpfr_rnd_t) -> libc::c_int;
    pub fn fmpq_set_str(
        res: *mut fmpq,
        str_: *const libc::c_char,
        base: libc::c_int,
    ) -> libc::c_int;
    pub fn _fmpq_get_str(
        str_: *mut libc::c_char,
        b: libc::c_int,
        num: *const fmpz,
        den: *const fmpz,
    ) -> *mut libc::c_char;
    pub fn fmpq_get_str(
        str_: *mut libc::c_char,
        b: libc::c_int,
        x: *const fmpq,
    ) -> *mut libc::c_char;
    #[link_name = "fmpq_is_zero__extern"]
    pub fn fmpq_is_zero(x: *const fmpq) -> libc::c_int;
    #[link_name = "fmpq_is_one__extern"]
    pub fn fmpq_is_one(x: *const fmpq) -> libc::c_int;
    #[link_name = "fmpq_is_pm1__extern"]
    pub fn fmpq_is_pm1(x: *const fmpq) -> libc::c_int;
    #[link_name = "fmpq_sgn__extern"]
    pub fn fmpq_sgn(x: *const fmpq) -> libc::c_int;
    #[link_name = "fmpq_equal_si__extern"]
    pub fn fmpq_equal_si(q: *mut fmpq, n: slong) -> libc::c_int;
    #[link_name = "fmpq_equal_ui__extern"]
    pub fn fmpq_equal_ui(q: *mut fmpq, n: ulong) -> libc::c_int;
    #[link_name = "fmpq_equal__extern"]
    pub fn fmpq_equal(x: *const fmpq, y: *const fmpq) -> libc::c_int;
    pub fn _fmpq_cmp_si(p: *const fmpz, q: *const fmpz, c: slong) -> libc::c_int;
    pub fn _fmpq_cmp_ui(p: *const fmpz, q: *const fmpz, c: ulong) -> libc::c_int;
    pub fn _fmpq_cmp_fmpz(p: *const fmpz, q: *const fmpz, r: *const fmpz) -> libc::c_int;
    pub fn _fmpq_cmp(p: *const fmpz, q: *const fmpz, r: *const fmpz, s: *const fmpz)
        -> libc::c_int;
    pub fn fmpq_cmp_si(x: *const fmpq, c: slong) -> libc::c_int;
    pub fn fmpq_cmp_ui(x: *const fmpq, c: ulong) -> libc::c_int;
    pub fn fmpq_cmp_fmpz(x: *const fmpq, y: *const fmpz) -> libc::c_int;
    pub fn fmpq_cmp(x: *const fmpq, y: *const fmpq) -> libc::c_int;
    pub fn fmpq_height_bits(x: *const fmpq) -> flint_bitcnt_t;
    pub fn fmpq_height(height: *mut fmpz, x: *const fmpq);
    #[link_name = "fmpq_neg__extern"]
    pub fn fmpq_neg(dest: *mut fmpq, src: *const fmpq);
    #[link_name = "fmpq_abs__extern"]
    pub fn fmpq_abs(dest: *mut fmpq, src: *const fmpq);
    pub fn _fmpq_add_si(rnum: *mut fmpz, rden: *mut fmpz, p: *const fmpz, q: *const fmpz, r: slong);
    pub fn _fmpq_add_ui(rnum: *mut fmpz, rden: *mut fmpz, p: *const fmpz, q: *const fmpz, r: ulong);
    pub fn _fmpq_add_fmpz(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        p: *const fmpz,
        q: *const fmpz,
        r: *const fmpz,
    );
    pub fn _fmpq_add_small(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        p1: slong,
        q1: ulong,
        p2: slong,
        q2: ulong,
    );
    pub fn _fmpq_add(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        op1num: *const fmpz,
        op1den: *const fmpz,
        op2num: *const fmpz,
        op2den: *const fmpz,
    );
    pub fn fmpq_add_si(res: *mut fmpq, op1: *const fmpq, c: slong);
    pub fn fmpq_add_ui(res: *mut fmpq, op1: *const fmpq, c: ulong);
    pub fn fmpq_add_fmpz(res: *mut fmpq, op1: *const fmpq, c: *const fmpz);
    pub fn fmpq_add(res: *mut fmpq, op1: *const fmpq, op2: *const fmpq);
    pub fn _fmpq_sub_si(rnum: *mut fmpz, rden: *mut fmpz, p: *const fmpz, q: *const fmpz, r: slong);
    pub fn _fmpq_sub_ui(rnum: *mut fmpz, rden: *mut fmpz, p: *const fmpz, q: *const fmpz, r: ulong);
    pub fn _fmpq_sub_fmpz(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        p: *const fmpz,
        q: *const fmpz,
        r: *const fmpz,
    );
    pub fn _fmpq_sub(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        op1num: *const fmpz,
        op1den: *const fmpz,
        op2num: *const fmpz,
        op2den: *const fmpz,
    );
    pub fn fmpq_sub_si(res: *mut fmpq, op1: *const fmpq, c: slong);
    pub fn fmpq_sub_ui(res: *mut fmpq, op1: *const fmpq, c: ulong);
    pub fn fmpq_sub_fmpz(res: *mut fmpq, op1: *const fmpq, c: *const fmpz);
    pub fn fmpq_sub(res: *mut fmpq, op1: *const fmpq, op2: *const fmpq);
    pub fn _fmpq_mul_si(rnum: *mut fmpz, rden: *mut fmpz, p: *const fmpz, q: *const fmpz, r: slong);
    pub fn _fmpq_mul_ui(rnum: *mut fmpz, rden: *mut fmpz, p: *const fmpz, q: *const fmpz, r: ulong);
    pub fn _fmpq_mul_small(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        p1: slong,
        q1: ulong,
        p2: slong,
        q2: ulong,
    );
    pub fn _fmpq_mul(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        op1num: *const fmpz,
        op1den: *const fmpz,
        op2num: *const fmpz,
        op2den: *const fmpz,
    );
    pub fn fmpq_mul_si(res: *mut fmpq, op1: *const fmpq, c: slong);
    pub fn fmpq_mul_ui(res: *mut fmpq, op1: *const fmpq, c: ulong);
    pub fn fmpq_mul_fmpz(res: *mut fmpq, op: *const fmpq, x: *const fmpz);
    pub fn fmpq_mul_2exp(res: *mut fmpq, x: *const fmpq, exp: flint_bitcnt_t);
    pub fn fmpq_mul(res: *mut fmpq, op1: *const fmpq, op2: *const fmpq);
    pub fn fmpq_inv(dest: *mut fmpq, src: *const fmpq);
    pub fn _fmpq_div(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        op1num: *const fmpz,
        op1den: *const fmpz,
        op2num: *const fmpz,
        op2den: *const fmpz,
    );
    pub fn fmpq_div_fmpz(res: *mut fmpq, op: *const fmpq, x: *const fmpz);
    pub fn fmpq_div_2exp(res: *mut fmpq, x: *const fmpq, exp: flint_bitcnt_t);
    pub fn fmpq_div(res: *mut fmpq, op1: *const fmpq, op2: *const fmpq);
    pub fn _fmpq_pow_si(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        opnum: *const fmpz,
        opden: *const fmpz,
        e: slong,
    );
    pub fn fmpq_pow_si(rop: *mut fmpq, op: *const fmpq, e: slong);
    pub fn fmpq_pow_fmpz(a: *mut fmpq, b: *const fmpq, e: *const fmpz) -> libc::c_int;
    pub fn _fmpq_addmul(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        op1num: *const fmpz,
        op1den: *const fmpz,
        op2num: *const fmpz,
        op2den: *const fmpz,
    );
    pub fn _fmpq_submul(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        op1num: *const fmpz,
        op1den: *const fmpz,
        op2num: *const fmpz,
        op2den: *const fmpz,
    );
    pub fn fmpq_addmul(res: *mut fmpq, op1: *const fmpq, op2: *const fmpq);
    pub fn fmpq_submul(res: *mut fmpq, op1: *const fmpq, op2: *const fmpq);
    pub fn _fmpq_fprint(file: *mut FILE, num: *const fmpz, den: *const fmpz) -> libc::c_int;
    pub fn fmpq_fprint(file: *mut FILE, x: *const fmpq) -> libc::c_int;
    pub fn _fmpq_print(num: *const fmpz, den: *const fmpz) -> libc::c_int;
    pub fn fmpq_print(x: *const fmpq) -> libc::c_int;
    pub fn _fmpq_randtest(
        num: *mut fmpz,
        den: *mut fmpz,
        state: *mut flint_rand_struct,
        bits: flint_bitcnt_t,
    );
    pub fn _fmpq_randbits(
        num: *mut fmpz,
        den: *mut fmpz,
        state: *mut flint_rand_struct,
        bits: flint_bitcnt_t,
    );
    pub fn fmpq_randtest(res: *mut fmpq, state: *mut flint_rand_struct, bits: flint_bitcnt_t);
    pub fn fmpq_randtest_not_zero(
        res: *mut fmpq,
        state: *mut flint_rand_struct,
        bits: flint_bitcnt_t,
    );
    pub fn fmpq_randbits(res: *mut fmpq, state: *mut flint_rand_struct, bits: flint_bitcnt_t);
    pub fn _fmpq_mod_fmpz(
        res: *mut fmpz,
        num: *const fmpz,
        den: *const fmpz,
        mod_: *const fmpz,
    ) -> libc::c_int;
    pub fn fmpq_mod_fmpz(res: *mut fmpz, x: *const fmpq, mod_: *const fmpz) -> libc::c_int;
    pub fn _fmpq_gcd(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        p: *const fmpz,
        q: *const fmpz,
        r: *const fmpz,
        s: *const fmpz,
    );
    pub fn fmpq_gcd(res: *mut fmpq, op1: *const fmpq, op2: *const fmpq);
    pub fn _fmpq_gcd_cofactors(
        ng: *mut fmpz,
        dg: *mut fmpz,
        A: *mut fmpz,
        B: *mut fmpz,
        na: *const fmpz,
        da: *const fmpz,
        nb: *const fmpz,
        db: *const fmpz,
    );
    pub fn fmpq_gcd_cofactors(
        g: *mut fmpq,
        A: *mut fmpz,
        B: *mut fmpz,
        a: *const fmpq,
        b: *const fmpq,
    );
    pub fn _fmpq_reconstruct_fmpz(
        num: *mut fmpz,
        den: *mut fmpz,
        a: *const fmpz,
        m: *const fmpz,
    ) -> libc::c_int;
    pub fn fmpq_reconstruct_fmpz(res: *mut fmpq, a: *const fmpz, m: *const fmpz) -> libc::c_int;
    pub fn _fmpq_reconstruct_fmpz_2_naive(
        n: *mut fmpz,
        d: *mut fmpz,
        a: *const fmpz,
        m: *const fmpz,
        N: *const fmpz,
        D: *const fmpz,
    ) -> libc::c_int;
    pub fn _fmpq_reconstruct_fmpz_2(
        n: *mut fmpz,
        d: *mut fmpz,
        a: *const fmpz,
        m: *const fmpz,
        N: *const fmpz,
        D: *const fmpz,
    ) -> libc::c_int;
    pub fn fmpq_reconstruct_fmpz_2(
        res: *mut fmpq,
        a: *const fmpz,
        m: *const fmpz,
        N: *const fmpz,
        D: *const fmpz,
    ) -> libc::c_int;
    pub fn _fmpq_next_calkin_wilf(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        num: *const fmpz,
        den: *const fmpz,
    );
    pub fn fmpq_next_calkin_wilf(res: *mut fmpq, x: *const fmpq);
    pub fn _fmpq_next_signed_calkin_wilf(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        num: *const fmpz,
        den: *const fmpz,
    );
    pub fn fmpq_next_signed_calkin_wilf(res: *mut fmpq, x: *const fmpq);
    pub fn _fmpq_next_minimal(rnum: *mut fmpz, rden: *mut fmpz, num: *const fmpz, den: *const fmpz);
    pub fn fmpq_next_minimal(res: *mut fmpq, x: *const fmpq);
    pub fn _fmpq_next_signed_minimal(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        num: *const fmpz,
        den: *const fmpz,
    );
    pub fn fmpq_next_signed_minimal(res: *mut fmpq, x: *const fmpq);
    pub fn fmpq_farey_neighbors(
        left: *mut fmpq,
        right: *mut fmpq,
        mid: *const fmpq,
        Q: *const fmpz,
    );
    pub fn _fmpq_simplest_between(
        mid_num: *mut fmpz,
        mid_den: *mut fmpz,
        l_num: *const fmpz,
        l_den: *const fmpz,
        r_num: *const fmpz,
        r_den: *const fmpz,
    );
    pub fn fmpq_simplest_between(mid: *mut fmpq, l: *const fmpq, r: *const fmpq);
    pub fn fmpq_get_cfrac_naive(c: *mut fmpz, rem: *mut fmpq, x: *const fmpq, n: slong) -> slong;
    pub fn fmpq_get_cfrac(c: *mut fmpz, rem: *mut fmpq, x: *const fmpq, n: slong) -> slong;
    pub fn fmpq_set_cfrac(x: *mut fmpq, c: *const fmpz, n: slong);
    pub fn fmpq_cfrac_bound(x: *const fmpq) -> slong;
    pub fn fmpq_dedekind_sum_naive(s: *mut fmpq, h: *const fmpz, k: *const fmpz);
    pub fn fmpq_dedekind_sum(s: *mut fmpq, h: *const fmpz, k: *const fmpz);
    pub fn _fmpq_harmonic_ui(num: *mut fmpz, den: *mut fmpz, n: ulong);
    pub fn fmpq_harmonic_ui(x: *mut fmpq, n: ulong);
    pub fn _fmpz_mat22_init(M: *mut _fmpz_mat22_struct);
    pub fn _fmpz_mat22_clear(M: *mut _fmpz_mat22_struct);
    pub fn _fmpz_mat22_one(M: *mut _fmpz_mat22_struct);
    pub fn _fmpz_mat22_is_one(M: *mut _fmpz_mat22_struct) -> libc::c_int;
    pub fn _fmpz_mat22_bits(N: *const _fmpz_mat22_struct) -> flint_bitcnt_t;
    pub fn _fmpz_mat22_rmul(M: *mut _fmpz_mat22_struct, N: *const _fmpz_mat22_struct);
    pub fn _fmpz_mat22_rmul_ui(M: *mut _fmpz_mat22_struct, N: *const _ui_mat22_struct);
    pub fn _fmpz_mat22_rmul_inv_ui(M: *mut _fmpz_mat22_struct, N: *const _ui_mat22_struct);
    pub fn _fmpz_mat22_rmul_elem(M: *mut _fmpz_mat22_struct, q: *const fmpz);
    pub fn _fmpz_mat22_lmul_elem(M: *mut _fmpz_mat22_struct, q: *const fmpz);
    pub fn _fmpz_mat22_rmul_inv_elem(M: *mut _fmpz_mat22_struct, q: *const fmpz);
    pub fn _fmpz_mat22_addmul_inv_vec(
        ya: *mut fmpz,
        yb: *mut fmpz,
        N: *mut _fmpz_mat22_struct,
        xa: *mut fmpz,
        xb: *mut fmpz,
    );
    pub fn _fmpz_mat22_addmul_inv_mat(
        A11: *mut fmpz,
        A12: *mut fmpz,
        A21: *mut fmpz,
        A22: *mut fmpz,
        M: *mut _fmpz_mat22_struct,
        B11: *mut fmpz,
        B12: *mut fmpz,
        B21: *mut fmpz,
        B22: *mut fmpz,
    );
    pub fn _fmpq_cfrac_list_init(v: *mut _fmpq_cfrac_list_struct);
    pub fn _fmpq_cfrac_list_clear(v: *mut _fmpq_cfrac_list_struct);
    pub fn _fmpq_cfrac_list_fit_length(v: *mut _fmpq_cfrac_list_struct, len: slong);
    pub fn _fmpq_cfrac_list_push_back(v: *mut _fmpq_cfrac_list_struct, a: *const fmpz);
    pub fn _fmpq_cfrac_list_push_back_zero(v: *mut _fmpq_cfrac_list_struct);
    pub fn _fmpq_cfrac_list_append_ui(v: *mut _fmpq_cfrac_list_struct, a: *const ulong, n: slong);
    pub fn _fmpq_ball_init(x: *mut _fmpq_ball_struct);
    pub fn _fmpq_ball_clear(x: *mut _fmpq_ball_struct);
    #[link_name = "_fmpq_ball_swap__extern"]
    pub fn _fmpq_ball_swap(x: *mut _fmpq_ball_struct, y: *mut _fmpq_ball_struct);
    pub fn _fmpq_ball_gt_one(x: *const _fmpq_ball_struct) -> libc::c_int;
    pub fn _fmpq_hgcd(
        s: *mut _fmpq_cfrac_list_struct,
        M: *mut _fmpz_mat22_struct,
        x_num: *mut fmpz,
        x_den: *mut fmpz,
    );
    pub fn _fmpq_ball_get_cfrac(
        s: *mut _fmpq_cfrac_list_struct,
        M: *mut _fmpz_mat22_struct,
        needM: libc::c_int,
        x: *mut _fmpq_ball_struct,
    );
    pub fn fmpq_numerator(n: *mut fmpz, q: *const fmpq);
    pub fn fmpq_denominator(n: *mut fmpz, q: *const fmpq);
    pub fn fmpq_numerator_ptr(q: *mut fmpq) -> *mut fmpz;
    pub fn fmpq_denominator_ptr(q: *mut fmpq) -> *mut fmpz;
    pub fn fmpq_equal_fmpz(q: *mut fmpq, n: *mut fmpz) -> libc::c_int;
}