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
531
532
533
534
535
536
537
/* 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::*;


extern "C" {
    #[link_name = "ca_mat_entry_ptr__extern"]
    pub fn ca_mat_entry_ptr(mat: *mut ca_mat_struct, i: slong, j: slong) -> ca_ptr;
    pub fn ca_mat_init(mat: *mut ca_mat_struct, r: slong, c: slong, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_clear(mat: *mut ca_mat_struct, ctx: *mut ca_ctx_struct);
    #[link_name = "ca_mat_swap__extern"]
    pub fn ca_mat_swap(mat1: *mut ca_mat_struct, mat2: *mut ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_window_init(
        window: *mut ca_mat_struct,
        mat: *const ca_mat_struct,
        r1: slong,
        c1: slong,
        r2: slong,
        c2: slong,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_window_clear__extern"]
    pub fn ca_mat_window_clear(UNUSED_window: *mut ca_mat_struct, UNUSED_ctx: *mut ca_ctx_struct);
    #[link_name = "ca_mat_is_empty__extern"]
    pub fn ca_mat_is_empty(mat: *const ca_mat_struct) -> libc::c_int;
    #[link_name = "ca_mat_is_square__extern"]
    pub fn ca_mat_is_square(mat: *const ca_mat_struct) -> libc::c_int;
    pub fn ca_mat_set(dest: *mut ca_mat_struct, src: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_set_fmpz_mat(
        dest: *mut ca_mat_struct,
        src: *const fmpz_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_set_fmpq_mat(
        dest: *mut ca_mat_struct,
        src: *const fmpq_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_set_ca(y: *mut ca_mat_struct, x: *const ca_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_get_fexpr(
        res: *mut fexpr_struct,
        A: *const ca_mat_struct,
        flags: ulong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_transfer(
        res: *mut ca_mat_struct,
        res_ctx: *mut ca_ctx_struct,
        src: *const ca_mat_struct,
        src_ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_randtest(
        mat: *mut ca_mat_struct,
        state: *mut flint_rand_struct,
        len: slong,
        bits: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_randtest_rational(
        mat: *mut ca_mat_struct,
        state: *mut flint_rand_struct,
        bits: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_randops(
        mat: *mut ca_mat_struct,
        state: *mut flint_rand_struct,
        count: slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_print(mat: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_printn(mat: *const ca_mat_struct, digits: slong, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_zero(mat: *mut ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_one(mat: *mut ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_ones(mat: *mut ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_pascal(mat: *mut ca_mat_struct, triangular: libc::c_int, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_stirling(mat: *mut ca_mat_struct, kind: libc::c_int, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_hilbert(mat: *mut ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_dft(res: *mut ca_mat_struct, type_: libc::c_int, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_check_equal(
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_check_is_zero(A: *const ca_mat_struct, ctx: *mut ca_ctx_struct) -> truth_t;
    pub fn ca_mat_check_is_one(A: *const ca_mat_struct, ctx: *mut ca_ctx_struct) -> truth_t;
    pub fn ca_mat_transpose(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_conj(B: *mut ca_mat_struct, A: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_conj_transpose(
        mat1: *mut ca_mat_struct,
        mat2: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_add_ca(
        y: *mut ca_mat_struct,
        a: *const ca_mat_struct,
        x: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_sub_ca(
        y: *mut ca_mat_struct,
        a: *const ca_mat_struct,
        x: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_addmul_ca(
        y: *mut ca_mat_struct,
        a: *const ca_mat_struct,
        x: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_submul_ca(
        y: *mut ca_mat_struct,
        a: *const ca_mat_struct,
        x: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_neg(dest: *mut ca_mat_struct, src: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_add(
        res: *mut ca_mat_struct,
        mat1: *const ca_mat_struct,
        mat2: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_sub(
        res: *mut ca_mat_struct,
        mat1: *const ca_mat_struct,
        mat2: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_mul(
        C: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_mul_classical(
        C: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_mul_same_nf(
        C: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        K: *mut ca_field_struct,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_mul_si__extern"]
    pub fn ca_mat_mul_si(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: slong,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_mul_fmpz__extern"]
    pub fn ca_mat_mul_fmpz(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: *const fmpz,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_mul_fmpq__extern"]
    pub fn ca_mat_mul_fmpq(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: *const fmpq,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_mul_ca__extern"]
    pub fn ca_mat_mul_ca(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_div_si__extern"]
    pub fn ca_mat_div_si(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: slong,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_div_fmpz__extern"]
    pub fn ca_mat_div_fmpz(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: *const fmpz,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_div_fmpq__extern"]
    pub fn ca_mat_div_fmpq(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: *const fmpq,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_div_ca__extern"]
    pub fn ca_mat_div_ca(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        c: *const ca_struct,
        ctx: *mut ca_ctx_struct,
    );
    #[link_name = "ca_mat_sqr__extern"]
    pub fn ca_mat_sqr(res: *mut ca_mat_struct, A: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_pow_ui_binexp(
        B: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        exp: ulong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_mat_ca_poly_evaluate(
        y: *mut ca_mat_struct,
        poly: ca_srcptr,
        len: slong,
        x: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_ca_poly_evaluate(
        res: *mut ca_mat_struct,
        f: *const ca_poly_struct,
        a: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_trace(trace: *mut ca_struct, mat: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_find_pivot(
        pivot_row: *mut slong,
        mat: *mut ca_mat_struct,
        start_row: slong,
        end_row: slong,
        column: slong,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    #[link_name = "_ca_mat_swap_rows__extern"]
    pub fn _ca_mat_swap_rows(mat: *mut ca_mat_struct, perm: *mut slong, r: slong, s: slong);
    pub fn ca_mat_lu_classical(
        rank: *mut slong,
        P: *mut slong,
        LU: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        rank_check: libc::c_int,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_lu_recursive(
        rank: *mut slong,
        P: *mut slong,
        LU: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        rank_check: libc::c_int,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_lu(
        rank: *mut slong,
        P: *mut slong,
        LU: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        rank_check: libc::c_int,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_fflu(
        rank: *mut slong,
        P: *mut slong,
        LU: *mut ca_mat_struct,
        den: *mut ca_struct,
        A: *const ca_mat_struct,
        rank_check: libc::c_int,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_rref_fflu(
        rank: *mut slong,
        R: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_rref_lu(
        rank: *mut slong,
        R: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_rref(
        rank: *mut slong,
        R: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_nonsingular_lu(
        P: *mut slong,
        LU: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_nonsingular_fflu(
        P: *mut slong,
        LU: *mut ca_mat_struct,
        den: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_nonsingular_solve_adjugate(
        X: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_nonsingular_solve_fflu(
        X: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_nonsingular_solve_lu(
        X: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_nonsingular_solve(
        X: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_inv(
        X: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_solve_tril_classical(
        X: *mut ca_mat_struct,
        L: *const ca_mat_struct,
        B: *const ca_mat_struct,
        unit: libc::c_int,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_solve_tril_recursive(
        X: *mut ca_mat_struct,
        L: *const ca_mat_struct,
        B: *const ca_mat_struct,
        unit: libc::c_int,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_solve_tril(
        X: *mut ca_mat_struct,
        L: *const ca_mat_struct,
        B: *const ca_mat_struct,
        unit: libc::c_int,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_solve_triu_classical(
        X: *mut ca_mat_struct,
        U: *const ca_mat_struct,
        B: *const ca_mat_struct,
        unit: libc::c_int,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_solve_triu_recursive(
        X: *mut ca_mat_struct,
        U: *const ca_mat_struct,
        B: *const ca_mat_struct,
        unit: libc::c_int,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_solve_triu(
        X: *mut ca_mat_struct,
        U: *const ca_mat_struct,
        B: *const ca_mat_struct,
        unit: libc::c_int,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_solve_lu_precomp(
        X: *mut ca_mat_struct,
        perm: *const slong,
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_solve_fflu_precomp(
        X: *mut ca_mat_struct,
        perm: *const slong,
        A: *const ca_mat_struct,
        den: *const ca_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_rank(
        rank: *mut slong,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_right_kernel(
        X: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_det_berkowitz(
        det: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_det_lu(
        det: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_det_bareiss(
        det: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_det_cofactor(
        det: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_det(det: *mut ca_struct, A: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_adjugate_cofactor(
        adj: *mut ca_mat_struct,
        det: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_adjugate_charpoly(
        adj: *mut ca_mat_struct,
        det: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_adjugate(
        adj: *mut ca_mat_struct,
        det: *mut ca_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_mat_charpoly_berkowitz(
        cp: ca_ptr,
        mat: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_charpoly_berkowitz(
        cp: *mut ca_poly_struct,
        mat: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn _ca_mat_charpoly_danilevsky(
        p: ca_ptr,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_charpoly_danilevsky(
        cp: *mut ca_poly_struct,
        mat: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn _ca_mat_charpoly(cp: ca_ptr, mat: *const ca_mat_struct, ctx: *mut ca_ctx_struct);
    pub fn ca_mat_charpoly(
        cp: *mut ca_poly_struct,
        mat: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_companion(
        A: *mut ca_mat_struct,
        poly: *const ca_poly_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_eigenvalues(
        lambda: *mut ca_vec_struct,
        exp: *mut ulong,
        mat: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_diagonalization(
        D: *mut ca_mat_struct,
        P: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn ca_mat_set_jordan_blocks(
        mat: *mut ca_mat_struct,
        lambda: *const ca_vec_struct,
        num_blocks: slong,
        block_lambda: *mut slong,
        block_size: *mut slong,
        ctx: *mut ca_ctx_struct,
    );
    pub fn ca_mat_jordan_blocks(
        lambda: *mut ca_vec_struct,
        num_blocks: *mut slong,
        block_lambda: *mut slong,
        block_size: *mut slong,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_jordan_transformation(
        mat: *mut ca_mat_struct,
        lambda: *const ca_vec_struct,
        num_blocks: slong,
        block_lambda: *mut slong,
        block_size: *mut slong,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_jordan_form(
        J: *mut ca_mat_struct,
        P: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_exp(
        res: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> libc::c_int;
    pub fn ca_mat_log(
        res: *mut ca_mat_struct,
        A: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> truth_t;
    pub fn _ca_mat_same_field(A: *const ca_mat_struct, ctx: *mut ca_ctx_struct) -> ca_field_ptr;
    pub fn _ca_mat_same_field2(
        A: *const ca_mat_struct,
        B: *const ca_mat_struct,
        ctx: *mut ca_ctx_struct,
    ) -> ca_field_ptr;
}