flint_sys/
fq_default.rs

1#![allow(non_camel_case_types)]
2
3//! See the [FLINT documentation](http://flintlib.org/doc/fq_default.html).
4
5use crate::deps::*;
6use crate::flint::*;
7use crate::fmpz::fmpz;
8use crate::fmpz_mod::fmpz_mod_ctx_struct;
9use crate::fmpz_mod_poly::fmpz_mod_poly_struct;
10use crate::fmpz_poly::fmpz_poly_struct;
11use crate::fq::{fq_ctx_t, fq_t};
12use crate::fq_nmod::{fq_nmod_ctx_t, fq_nmod_t};
13use crate::fq_zech::{fq_zech_ctx_t, fq_zech_t};
14use crate::nmod_poly::nmod_poly_struct;
15use libc::{c_char, c_int, FILE};
16
17#[repr(C)]
18#[derive(Copy, Clone)]
19pub union fq_default_struct {
20    pub fq: fq_t,
21    pub fq_nmod: fq_nmod_t,
22    pub fq_zech: fq_zech_t,
23}
24
25pub type fq_default_t = [fq_default_struct; 1usize];
26
27#[repr(C)]
28#[derive(Copy, Clone)]
29pub struct fq_default_ctx_struct {
30    pub type_: c_int,
31    pub ctx: fq_default_ctx_struct_ctx,
32}
33
34#[repr(C)]
35#[derive(Copy, Clone)]
36pub union fq_default_ctx_struct_ctx {
37    pub fq: fq_ctx_t,
38    pub fq_nmod: fq_nmod_ctx_t,
39    pub fq_zech: fq_zech_ctx_t,
40}
41
42pub type fq_default_ctx_t = [fq_default_ctx_struct; 1usize];
43
44extern "C" {
45    pub fn fq_default_ctx_init_type(
46        ctx: *mut fq_default_ctx_struct,
47        p: *const fmpz,
48        d: mp_limb_signed_t,
49        var: *const c_char,
50        type_: c_int,
51    );
52    pub fn fq_default_ctx_init(
53        ctx: *mut fq_default_ctx_struct,
54        p: *const fmpz,
55        d: mp_limb_signed_t,
56        var: *const c_char,
57    );
58    pub fn fq_default_ctx_init_modulus_type(
59        ctx: *mut fq_default_ctx_struct,
60        modulus: *const fmpz_mod_poly_struct,
61        mod_ctx: *const fmpz_mod_ctx_struct,
62        var: *const c_char,
63        type_: c_int,
64    );
65    pub fn fq_default_ctx_init_modulus(
66        ctx: *mut fq_default_ctx_struct,
67        modulus: *const fmpz_mod_poly_struct,
68        mod_ctx: *const fmpz_mod_ctx_struct,
69        var: *const c_char,
70    );
71    pub fn fq_default_ctx_init_modulus_nmod_type(
72        ctx: *mut fq_default_ctx_struct,
73        modulus: *const nmod_poly_struct,
74        var: *const c_char,
75        type_: c_int,
76    );
77    pub fn fq_default_ctx_init_modulus_nmod(
78        ctx: *mut fq_default_ctx_struct,
79        modulus: *const nmod_poly_struct,
80        var: *const c_char,
81    );
82    pub fn fq_default_ctx_clear(ctx: *mut fq_default_ctx_struct);
83    pub fn fq_default_ctx_type(ctx: *const fq_default_ctx_struct) -> c_int;
84    pub fn fq_default_ctx_degree(ctx: *const fq_default_ctx_struct) -> mp_limb_signed_t;
85    pub fn fq_default_ctx_prime(prime: *mut fmpz, ctx: *const fq_default_ctx_struct);
86    pub fn fq_default_ctx_modulus(p: *mut fmpz_mod_poly_struct, ctx: *const fq_default_ctx_struct);
87    pub fn fq_default_ctx_order(f: *mut fmpz, ctx: *const fq_default_ctx_struct);
88    pub fn fq_default_ctx_fprint(file: *mut FILE, ctx: *const fq_default_ctx_struct) -> c_int;
89    pub fn fq_default_ctx_print(ctx: *const fq_default_ctx_struct);
90    pub fn fq_default_init(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
91    pub fn fq_default_init2(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
92    pub fn fq_default_clear(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
93    pub fn fq_default_is_invertible(
94        op: *const fq_default_struct,
95        ctx: *const fq_default_ctx_struct,
96    ) -> c_int;
97    pub fn fq_default_add(
98        rop: *mut fq_default_struct,
99        op1: *const fq_default_struct,
100        op2: *const fq_default_struct,
101        ctx: *const fq_default_ctx_struct,
102    );
103    pub fn fq_default_sub(
104        rop: *mut fq_default_struct,
105        op1: *const fq_default_struct,
106        op2: *const fq_default_struct,
107        ctx: *const fq_default_ctx_struct,
108    );
109    pub fn fq_default_sub_one(
110        rop: *mut fq_default_struct,
111        op1: *const fq_default_struct,
112        ctx: *const fq_default_ctx_struct,
113    );
114    pub fn fq_default_neg(
115        rop: *mut fq_default_struct,
116        op1: *const fq_default_struct,
117        ctx: *const fq_default_ctx_struct,
118    );
119    pub fn fq_default_mul(
120        rop: *mut fq_default_struct,
121        op1: *const fq_default_struct,
122        op2: *const fq_default_struct,
123        ctx: *const fq_default_ctx_struct,
124    );
125    pub fn fq_default_mul_fmpz(
126        rop: *mut fq_default_struct,
127        op: *const fq_default_struct,
128        x: *const fmpz,
129        ctx: *const fq_default_ctx_struct,
130    );
131    pub fn fq_default_mul_si(
132        rop: *mut fq_default_struct,
133        op: *const fq_default_struct,
134        x: mp_limb_signed_t,
135        ctx: *const fq_default_ctx_struct,
136    );
137    pub fn fq_default_mul_ui(
138        rop: *mut fq_default_struct,
139        op: *const fq_default_struct,
140        x: mp_limb_t,
141        ctx: *const fq_default_ctx_struct,
142    );
143    pub fn fq_default_sqr(
144        rop: *mut fq_default_struct,
145        op: *const fq_default_struct,
146        ctx: *const fq_default_ctx_struct,
147    );
148    pub fn fq_default_inv(
149        rop: *mut fq_default_struct,
150        op1: *const fq_default_struct,
151        ctx: *const fq_default_ctx_struct,
152    );
153    pub fn fq_default_div(
154        rop: *mut fq_default_struct,
155        op1: *const fq_default_struct,
156        op2: *const fq_default_struct,
157        ctx: *const fq_default_ctx_struct,
158    );
159    pub fn fq_default_pow(
160        rop: *mut fq_default_struct,
161        op1: *const fq_default_struct,
162        e: *const fmpz,
163        ctx: *const fq_default_ctx_struct,
164    );
165    pub fn fq_default_pow_ui(
166        rop: *mut fq_default_struct,
167        op: *const fq_default_struct,
168        e: mp_limb_t,
169        ctx: *const fq_default_ctx_struct,
170    );
171    pub fn fq_default_sqrt(
172        rop: *mut fq_default_struct,
173        op: *const fq_default_struct,
174        ctx: *const fq_default_ctx_struct,
175    ) -> c_int;
176    pub fn fq_default_pth_root(
177        rop: *mut fq_default_struct,
178        op1: *const fq_default_struct,
179        ctx: *const fq_default_ctx_struct,
180    );
181    pub fn fq_default_is_square(
182        op: *const fq_default_struct,
183        ctx: *const fq_default_ctx_struct,
184    ) -> c_int;
185    pub fn fq_default_randtest(
186        rop: *mut fq_default_struct,
187        state: *const flint_rand_s,
188        ctx: *const fq_default_ctx_struct,
189    );
190    pub fn fq_default_randtest_not_zero(
191        rop: *mut fq_default_struct,
192        state: *const flint_rand_s,
193        ctx: *const fq_default_ctx_struct,
194    );
195    pub fn fq_default_rand(
196        rop: *mut fq_default_struct,
197        state: *const flint_rand_s,
198        ctx: *const fq_default_ctx_struct,
199    );
200    pub fn fq_default_rand_not_zero(
201        rop: *mut fq_default_struct,
202        state: *const flint_rand_s,
203        ctx: *const fq_default_ctx_struct,
204    );
205    pub fn fq_default_equal(
206        op1: *const fq_default_struct,
207        op2: *const fq_default_struct,
208        ctx: *const fq_default_ctx_struct,
209    ) -> c_int;
210    pub fn fq_default_is_zero(
211        op: *const fq_default_struct,
212        ctx: *const fq_default_ctx_struct,
213    ) -> c_int;
214    pub fn fq_default_is_one(
215        op: *const fq_default_struct,
216        ctx: *const fq_default_ctx_struct,
217    ) -> c_int;
218    pub fn fq_default_set(
219        rop: *mut fq_default_struct,
220        op: *const fq_default_struct,
221        ctx: *const fq_default_ctx_struct,
222    );
223    pub fn fq_default_set_fmpz(
224        rop: *mut fq_default_struct,
225        x: *const fmpz,
226        ctx: *const fq_default_ctx_struct,
227    );
228    pub fn fq_default_set_ui(
229        rop: *mut fq_default_struct,
230        x: mp_limb_t,
231        ctx: *const fq_default_ctx_struct,
232    );
233    pub fn fq_default_set_si(
234        rop: *mut fq_default_struct,
235        x: mp_limb_signed_t,
236        ctx: *const fq_default_ctx_struct,
237    );
238    pub fn fq_default_zero(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
239    pub fn fq_default_one(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
240    pub fn fq_default_swap(
241        op1: *mut fq_default_struct,
242        op2: *mut fq_default_struct,
243        ctx: *const fq_default_ctx_struct,
244    );
245    pub fn fq_default_gen(rop: *mut fq_default_struct, ctx: *const fq_default_ctx_struct);
246    pub fn fq_default_get_nmod_poly(
247        poly: *mut nmod_poly_struct,
248        op: *const fq_default_struct,
249        ctx: *const fq_default_ctx_struct,
250    );
251    pub fn fq_default_set_nmod_poly(
252        op: *mut fq_default_struct,
253        poly: *const nmod_poly_struct,
254        ctx: *const fq_default_ctx_struct,
255    );
256    pub fn fq_default_get_fmpz_mod_poly(
257        poly: *mut fmpz_mod_poly_struct,
258        op: *const fq_default_struct,
259        ctx: *const fq_default_ctx_struct,
260    );
261    pub fn fq_default_set_fmpz_mod_poly(
262        op: *mut fq_default_struct,
263        poly: *const fmpz_mod_poly_struct,
264        ctx: *const fq_default_ctx_struct,
265    );
266    pub fn fq_default_get_fmpz_poly(
267        poly: *mut fmpz_poly_struct,
268        op: *const fq_default_struct,
269        ctx: *const fq_default_ctx_struct,
270    );
271    pub fn fq_default_set_fmpz_poly(
272        op: *mut fq_default_struct,
273        poly: *const fmpz_poly_struct,
274        ctx: *const fq_default_ctx_struct,
275    );
276    pub fn fq_default_get_coeff_fmpz(
277        c: *mut fmpz,
278        op: *const fq_default_struct,
279        n: mp_limb_signed_t,
280        ctx: *const fq_default_ctx_struct,
281    );
282    pub fn fq_default_fprint(
283        file: *mut FILE,
284        op: *const fq_default_struct,
285        ctx: *const fq_default_ctx_struct,
286    ) -> c_int;
287    pub fn fq_default_print(op: *const fq_default_struct, ctx: *const fq_default_ctx_struct);
288    pub fn fq_default_fprint_pretty(
289        file: *mut FILE,
290        op: *const fq_default_struct,
291        ctx: *const fq_default_ctx_struct,
292    ) -> c_int;
293    pub fn fq_default_print_pretty(op: *const fq_default_struct, ctx: *const fq_default_ctx_struct);
294    pub fn fq_default_get_str(
295        op: *const fq_default_struct,
296        ctx: *const fq_default_ctx_struct,
297    ) -> *mut c_char;
298    pub fn fq_default_get_str_pretty(
299        op: *const fq_default_struct,
300        ctx: *const fq_default_ctx_struct,
301    ) -> *mut c_char;
302    pub fn fq_default_trace(
303        rop: *mut fmpz,
304        op: *const fq_default_struct,
305        ctx: *const fq_default_ctx_struct,
306    );
307    pub fn fq_default_frobenius(
308        rop: *mut fq_default_struct,
309        op: *const fq_default_struct,
310        e: mp_limb_signed_t,
311        ctx: *const fq_default_ctx_struct,
312    );
313    pub fn fq_default_norm(
314        rop: *mut fmpz,
315        op: *const fq_default_struct,
316        ctx: *const fq_default_ctx_struct,
317    );
318}