flint_sys/
fq_default_mat.rs

1#![allow(non_camel_case_types)]
2
3//! *See the [FLINT documentation](http://flintlib.org/doc/fq_default_mat.html).
4
5use crate::deps::*;
6use crate::flint::*;
7use crate::fmpz::fmpz;
8use crate::fmpz_mat::fmpz_mat_struct;
9use crate::fmpz_mod_mat::fmpz_mod_mat_struct;
10use crate::fq_default::{fq_default_ctx_struct, fq_default_struct};
11use crate::fq_mat::fq_mat_t;
12use crate::fq_nmod_mat::fq_nmod_mat_t;
13use crate::fq_zech_mat::fq_zech_mat_t;
14use crate::nmod_mat::nmod_mat_struct;
15use libc::{c_int, FILE};
16
17#[repr(C)]
18#[derive(Copy, Clone)]
19pub union fq_default_mat_struct {
20    pub fq: fq_mat_t,
21    pub fq_nmod: fq_nmod_mat_t,
22    pub fq_zech: fq_zech_mat_t,
23}
24
25pub type fq_default_mat_t = [fq_default_mat_struct; 1usize];
26
27extern "C" {
28    pub fn fq_default_mat_init(
29        mat: *mut fq_default_mat_struct,
30        rows: mp_limb_signed_t,
31        cols: mp_limb_signed_t,
32        ctx: *const fq_default_ctx_struct,
33    );
34    pub fn fq_default_mat_init_set(
35        mat: *mut fq_default_mat_struct,
36        src: *const fq_default_mat_struct,
37        ctx: *const fq_default_ctx_struct,
38    );
39    pub fn fq_default_mat_swap(
40        mat1: *mut fq_default_mat_struct,
41        mat2: *const fq_default_mat_struct,
42        ctx: *const fq_default_ctx_struct,
43    );
44    pub fn fq_default_mat_set(
45        mat1: *mut fq_default_mat_struct,
46        mat2: *const fq_default_mat_struct,
47        ctx: *const fq_default_ctx_struct,
48    );
49    pub fn fq_default_mat_clear(mat: *mut fq_default_mat_struct, ctx: *const fq_default_ctx_struct);
50    pub fn fq_default_mat_equal(
51        mat1: *mut fq_default_mat_struct,
52        mat2: *const fq_default_mat_struct,
53        ctx: *const fq_default_ctx_struct,
54    ) -> c_int;
55    pub fn fq_default_mat_is_zero(
56        mat: *const fq_default_mat_struct,
57        ctx: *const fq_default_ctx_struct,
58    ) -> c_int;
59    pub fn fq_default_mat_is_one(
60        mat: *const fq_default_mat_struct,
61        ctx: *const fq_default_ctx_struct,
62    ) -> c_int;
63    pub fn fq_default_mat_is_empty(
64        mat: *const fq_default_mat_struct,
65        ctx: *const fq_default_ctx_struct,
66    ) -> c_int;
67    pub fn fq_default_mat_is_square(
68        mat: *const fq_default_mat_struct,
69        ctx: *const fq_default_ctx_struct,
70    ) -> c_int;
71    pub fn fq_default_mat_entry(
72        val: *mut fq_default_struct,
73        mat: *const fq_default_mat_struct,
74        i: mp_limb_signed_t,
75        j: mp_limb_signed_t,
76        ctx: *const fq_default_ctx_struct,
77    );
78    pub fn fq_default_mat_entry_set(
79        mat: *mut fq_default_mat_struct,
80        i: mp_limb_signed_t,
81        j: mp_limb_signed_t,
82        x: *const fq_default_struct,
83        ctx: *const fq_default_ctx_struct,
84    );
85    pub fn fq_default_mat_entry_set_fmpz(
86        mat: *mut fq_default_mat_struct,
87        i: mp_limb_signed_t,
88        j: mp_limb_signed_t,
89        x: *const fmpz,
90        ctx: *const fq_default_ctx_struct,
91    );
92    pub fn fq_default_mat_nrows(
93        mat: *const fq_default_mat_struct,
94        ctx: *const fq_default_ctx_struct,
95    ) -> mp_limb_signed_t;
96    pub fn fq_default_mat_ncols(
97        mat: *const fq_default_mat_struct,
98        ctx: *const fq_default_ctx_struct,
99    ) -> mp_limb_signed_t;
100    pub fn fq_default_mat_swap_rows(
101        mat: *mut fq_default_mat_struct,
102        perm: *const mp_limb_signed_t,
103        r: mp_limb_signed_t,
104        s: mp_limb_signed_t,
105        ctx: *const fq_default_ctx_struct,
106    );
107    pub fn fq_default_mat_invert_rows(
108        mat: *mut fq_default_mat_struct,
109        perm: *const mp_limb_signed_t,
110        ctx: *const fq_default_ctx_struct,
111    );
112    pub fn fq_default_mat_swap_cols(
113        mat: *mut fq_default_mat_struct,
114        perm: *const mp_limb_signed_t,
115        r: mp_limb_signed_t,
116        s: mp_limb_signed_t,
117        ctx: *const fq_default_ctx_struct,
118    );
119    pub fn fq_default_mat_invert_cols(
120        mat: *mut fq_default_mat_struct,
121        perm: *const mp_limb_signed_t,
122        ctx: *const fq_default_ctx_struct,
123    );
124    pub fn fq_default_mat_zero(A: *mut fq_default_mat_struct, ctx: *const fq_default_ctx_struct);
125    pub fn fq_default_mat_one(A: *mut fq_default_mat_struct, ctx: *const fq_default_ctx_struct);
126    pub fn fq_default_mat_set_nmod_mat(
127        mat1: *mut fq_default_mat_struct,
128        mat2: *const nmod_mat_struct,
129        ctx: *const fq_default_ctx_struct,
130    );
131    pub fn fq_default_mat_set_fmpz_mod_mat(
132        mat1: *mut fq_default_mat_struct,
133        mat2: *const fmpz_mod_mat_struct,
134        ctx: *const fq_default_ctx_struct,
135    );
136    pub fn fq_default_mat_set_fmpz_mat(
137        mat1: *mut fq_default_mat_struct,
138        mat2: *const fmpz_mat_struct,
139        ctx: *const fq_default_ctx_struct,
140    );
141    pub fn fq_default_mat_window_init(
142        window: *mut fq_default_mat_struct,
143        mat: *const fq_default_mat_struct,
144        r1: mp_limb_signed_t,
145        c1: mp_limb_signed_t,
146        r2: mp_limb_signed_t,
147        c2: mp_limb_signed_t,
148        ctx: *const fq_default_ctx_struct,
149    );
150    pub fn fq_default_mat_window_clear(
151        window: *mut fq_default_mat_struct,
152        ctx: *const fq_default_ctx_struct,
153    );
154    pub fn fq_default_mat_concat_horizontal(
155        res: *mut fq_default_mat_struct,
156        mat1: *const fq_default_mat_struct,
157        mat2: *const fq_default_mat_struct,
158        ctx: *const fq_default_ctx_struct,
159    );
160    pub fn fq_default_mat_concat_vertical(
161        res: *mut fq_default_mat_struct,
162        mat1: *const fq_default_mat_struct,
163        mat2: *const fq_default_mat_struct,
164        ctx: *const fq_default_ctx_struct,
165    );
166    pub fn fq_default_mat_fprint(
167        file: *mut FILE,
168        mat: *const fq_default_mat_struct,
169        ctx: *const fq_default_ctx_struct,
170    ) -> c_int;
171    pub fn fq_default_mat_fprint_pretty(
172        file: *mut FILE,
173        mat: *const fq_default_mat_struct,
174        ctx: *const fq_default_ctx_struct,
175    ) -> c_int;
176    pub fn fq_default_mat_print(
177        mat: *mut fq_default_mat_struct,
178        ctx: *const fq_default_ctx_struct,
179    ) -> c_int;
180    pub fn fq_default_mat_print_pretty(
181        mat: *mut fq_default_mat_struct,
182        ctx: *const fq_default_ctx_struct,
183    ) -> c_int;
184    pub fn fq_default_mat_randtest(
185        mat: *mut fq_default_mat_struct,
186        state: *const flint_rand_s,
187        ctx: *const fq_default_ctx_struct,
188    );
189    pub fn fq_default_mat_randrank(
190        mat: *mut fq_default_mat_struct,
191        state: *const flint_rand_s,
192        rank: mp_limb_signed_t,
193        ctx: *const fq_default_ctx_struct,
194    );
195    pub fn fq_default_mat_randops(
196        mat: *mut fq_default_mat_struct,
197        count: mp_limb_signed_t,
198        state: *const flint_rand_s,
199        ctx: *const fq_default_ctx_struct,
200    );
201    pub fn fq_default_mat_randtril(
202        mat: *mut fq_default_mat_struct,
203        state: *const flint_rand_s,
204        unit: c_int,
205        ctx: *const fq_default_ctx_struct,
206    );
207    pub fn fq_default_mat_randtriu(
208        mat: *mut fq_default_mat_struct,
209        state: *const flint_rand_s,
210        unit: c_int,
211        ctx: *const fq_default_ctx_struct,
212    );
213    pub fn fq_default_mat_add(
214        C: *mut fq_default_mat_struct,
215        A: *const fq_default_mat_struct,
216        B: *const fq_default_mat_struct,
217        ctx: *const fq_default_ctx_struct,
218    );
219    pub fn fq_default_mat_sub(
220        C: *mut fq_default_mat_struct,
221        A: *const fq_default_mat_struct,
222        B: *const fq_default_mat_struct,
223        ctx: *const fq_default_ctx_struct,
224    );
225    pub fn fq_default_mat_neg(
226        B: *mut fq_default_mat_struct,
227        A: *const fq_default_mat_struct,
228        ctx: *const fq_default_ctx_struct,
229    );
230    pub fn fq_default_mat_submul(
231        D: *mut fq_default_mat_struct,
232        C: *const fq_default_mat_struct,
233        A: *const fq_default_mat_struct,
234        B: *const fq_default_mat_struct,
235        ctx: *const fq_default_ctx_struct,
236    );
237    pub fn fq_default_mat_mul(
238        C: *mut fq_default_mat_struct,
239        A: *const fq_default_mat_struct,
240        B: *const fq_default_mat_struct,
241        ctx: *const fq_default_ctx_struct,
242    );
243    pub fn fq_default_mat_lu(
244        P: *mut mp_limb_signed_t,
245        A: *const fq_default_mat_struct,
246        rank_check: c_int,
247        ctx: *const fq_default_ctx_struct,
248    ) -> mp_limb_signed_t;
249    pub fn fq_default_mat_inv(
250        B: *mut fq_default_mat_struct,
251        A: *const fq_default_mat_struct,
252        ctx: *const fq_default_ctx_struct,
253    ) -> c_int;
254    pub fn fq_default_mat_rref(
255        A: *mut fq_default_mat_struct,
256        ctx: *const fq_default_ctx_struct,
257    ) -> mp_limb_signed_t;
258    pub fn fq_default_mat_nullspace(
259        X: *mut fq_default_mat_struct,
260        A: *const fq_default_mat_struct,
261        ctx: *const fq_default_ctx_struct,
262    ) -> mp_limb_signed_t;
263    pub fn fq_default_mat_rank(
264        A: *mut fq_default_mat_struct,
265        ctx: *const fq_default_ctx_struct,
266    ) -> mp_limb_signed_t;
267    pub fn fq_default_mat_solve_tril(
268        X: *mut fq_default_mat_struct,
269        L: *const fq_default_mat_struct,
270        B: *const fq_default_mat_struct,
271        unit: c_int,
272        ctx: *const fq_default_ctx_struct,
273    );
274    pub fn fq_default_mat_solve_triu(
275        X: *mut fq_default_mat_struct,
276        U: *const fq_default_mat_struct,
277        B: *const fq_default_mat_struct,
278        unit: c_int,
279        ctx: *const fq_default_ctx_struct,
280    );
281    pub fn fq_default_mat_solve(
282        X: *mut fq_default_mat_struct,
283        A: *const fq_default_mat_struct,
284        C: *const fq_default_mat_struct,
285        ctx: *const fq_default_ctx_struct,
286    ) -> c_int;
287    pub fn fq_default_mat_can_solve(
288        X: *mut fq_default_mat_struct,
289        A: *const fq_default_mat_struct,
290        B: *const fq_default_mat_struct,
291        ctx: *const fq_default_ctx_struct,
292    ) -> c_int;
293    pub fn fq_default_mat_similarity(
294        A: *mut fq_default_mat_struct,
295        r: mp_limb_signed_t,
296        d: *const fq_default_struct,
297        ctx: *const fq_default_ctx_struct,
298    );
299}