1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3use crate::deps::*;
8use crate::flint::*;
9use crate::fmpz::fmpz;
10use crate::fmpz_mat::fmpz_mat_struct;
11use libc::{c_int, c_uint};
12
13pub const rep_type_GRAM: rep_type = 0;
14pub const rep_type_Z_BASIS: rep_type = 1;
15pub type rep_type = c_uint;
16pub const gram_type_APPROX: gram_type = 0;
17pub const gram_type_EXACT: gram_type = 1;
18pub type gram_type = c_uint;
19
20#[repr(C)]
21#[derive(Debug, Copy, Clone)]
22pub struct fmpz_lll_struct {
23 pub delta: f64,
24 pub eta: f64,
25 pub rt: rep_type,
26 pub gt: gram_type,
27}
28
29pub type fmpz_lll_t = [fmpz_lll_struct; 1usize];
30
31extern "C" {
44 pub fn fmpz_lll_context_init_default(fl: *mut fmpz_lll_struct);
45 pub fn fmpz_lll_context_init(
46 fl: *mut fmpz_lll_struct,
47 delta: f64,
48 eta: f64,
49 rt: rep_type,
50 gt: gram_type,
51 );
52 pub fn fmpz_lll_randtest(fl: *mut fmpz_lll_struct, state: *const flint_rand_s);
53 pub fn fmpz_lll_heuristic_dot(
54 vec1: *const f64,
55 vec2: *const f64,
56 len2: mp_limb_signed_t,
57 B: *const fmpz_mat_struct,
58 k: mp_limb_signed_t,
59 j: mp_limb_signed_t,
60 exp_adj: mp_limb_signed_t,
61 ) -> f64;
62 pub fn fmpz_lll_shift(B: *const fmpz_mat_struct) -> c_int;
97 pub fn fmpz_lll_d(
98 B: *mut fmpz_mat_struct,
99 U: *mut fmpz_mat_struct,
100 fl: *const fmpz_lll_struct,
101 ) -> c_int;
102 pub fn fmpz_lll_d_heuristic(
103 B: *mut fmpz_mat_struct,
104 U: *mut fmpz_mat_struct,
105 fl: *const fmpz_lll_struct,
106 ) -> c_int;
107 pub fn fmpz_lll_mpf2(
128 B: *mut fmpz_mat_struct,
129 U: *mut fmpz_mat_struct,
130 prec: mp_limb_t,
131 fl: *const fmpz_lll_struct,
132 ) -> c_int;
133 pub fn fmpz_lll_mpf(
134 B: *mut fmpz_mat_struct,
135 U: *mut fmpz_mat_struct,
136 fl: *const fmpz_lll_struct,
137 ) -> c_int;
138 pub fn fmpz_lll_wrapper(
139 B: *mut fmpz_mat_struct,
140 U: *mut fmpz_mat_struct,
141 fl: *const fmpz_lll_struct,
142 ) -> c_int;
143 pub fn fmpz_lll_d_with_removal(
180 B: *mut fmpz_mat_struct,
181 U: *mut fmpz_mat_struct,
182 gs_B: *const fmpz,
183 fl: *const fmpz_lll_struct,
184 ) -> c_int;
185 pub fn fmpz_lll_d_heuristic_with_removal(
186 B: *mut fmpz_mat_struct,
187 U: *mut fmpz_mat_struct,
188 gs_B: *const fmpz,
189 fl: *const fmpz_lll_struct,
190 ) -> c_int;
191 pub fn fmpz_lll_mpf2_with_removal(
192 B: *mut fmpz_mat_struct,
193 U: *mut fmpz_mat_struct,
194 prec: mp_limb_t,
195 gs_B: *const fmpz,
196 fl: *const fmpz_lll_struct,
197 ) -> c_int;
198 pub fn fmpz_lll_mpf_with_removal(
199 B: *mut fmpz_mat_struct,
200 U: *mut fmpz_mat_struct,
201 gs_B: *const fmpz,
202 fl: *const fmpz_lll_struct,
203 ) -> c_int;
204 pub fn fmpz_lll_wrapper_with_removal(
205 B: *mut fmpz_mat_struct,
206 U: *mut fmpz_mat_struct,
207 gs_B: *const fmpz,
208 fl: *const fmpz_lll_struct,
209 ) -> c_int;
210 pub fn fmpz_lll_d_with_removal_knapsack(
211 B: *mut fmpz_mat_struct,
212 U: *mut fmpz_mat_struct,
213 gs_B: *const fmpz,
214 fl: *const fmpz_lll_struct,
215 ) -> c_int;
216 pub fn fmpz_lll_wrapper_with_removal_knapsack(
217 B: *mut fmpz_mat_struct,
218 U: *mut fmpz_mat_struct,
219 gs_B: *const fmpz,
220 fl: *const fmpz_lll_struct,
221 ) -> c_int;
222 pub fn fmpz_lll_with_removal_ulll(
223 FM: *mut fmpz_mat_struct,
224 UM: *mut fmpz_mat_struct,
225 new_size: mp_limb_signed_t,
226 gs_B: *const fmpz,
227 fl: *const fmpz_lll_struct,
228 ) -> c_int;
229 pub fn fmpz_lll_is_reduced_d(B: *const fmpz_mat_struct, fl: *const fmpz_lll_struct) -> c_int;
230 pub fn fmpz_lll_is_reduced_mpfr(
231 B: *const fmpz_mat_struct,
232 fl: *const fmpz_lll_struct,
233 prec: mp_limb_t,
234 ) -> c_int;
235 pub fn fmpz_lll_is_reduced(
236 B: *const fmpz_mat_struct,
237 fl: *const fmpz_lll_struct,
238 prec: mp_limb_t,
239 ) -> c_int;
240 pub fn fmpz_lll_is_reduced_d_with_removal(
241 B: *const fmpz_mat_struct,
242 fl: *const fmpz_lll_struct,
243 gs_B: *const fmpz,
244 newd: c_int,
245 ) -> c_int;
246 pub fn fmpz_lll_is_reduced_mpfr_with_removal(
247 B: *const fmpz_mat_struct,
248 fl: *const fmpz_lll_struct,
249 gs_B: *const fmpz,
250 newd: c_int,
251 prec: mp_limb_t,
252 ) -> c_int;
253 pub fn fmpz_lll_is_reduced_with_removal(
254 B: *const fmpz_mat_struct,
255 fl: *const fmpz_lll_struct,
256 gs_B: *const fmpz,
257 newd: c_int,
258 prec: mp_limb_t,
259 ) -> c_int;
260 pub fn fmpz_lll(B: *mut fmpz_mat_struct, U: *mut fmpz_mat_struct, fl: *const fmpz_lll_struct);
261 pub fn fmpz_lll_with_removal(
262 B: *mut fmpz_mat_struct,
263 U: *mut fmpz_mat_struct,
264 gs_B: *const fmpz,
265 fl: *const fmpz_lll_struct,
266 ) -> c_int;
267 pub fn fmpz_lll_storjohann_ulll(
268 FM: *mut fmpz_mat_struct,
269 new_size: mp_limb_signed_t,
270 fl: *const fmpz_lll_struct,
271 );
272}