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
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
use crate::deps::*;
use crate::flint::*;
use crate::fmpz::fmpz;
use crate::fmpz_mat::fmpz_mat_struct;
use libc::{c_int, c_uint};
pub const rep_type_GRAM: rep_type = 0;
pub const rep_type_Z_BASIS: rep_type = 1;
pub type rep_type = c_uint;
pub const gram_type_APPROX: gram_type = 0;
pub const gram_type_EXACT: gram_type = 1;
pub type gram_type = c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fmpz_lll_struct {
pub delta: f64,
pub eta: f64,
pub rt: rep_type,
pub gt: gram_type,
}
pub type fmpz_lll_t = [fmpz_lll_struct; 1usize];
extern "C" {
pub fn fmpz_lll_context_init_default(fl: *mut fmpz_lll_struct);
pub fn fmpz_lll_context_init(
fl: *mut fmpz_lll_struct,
delta: f64,
eta: f64,
rt: rep_type,
gt: gram_type,
);
pub fn fmpz_lll_randtest(fl: *mut fmpz_lll_struct, state: *const flint_rand_s);
pub fn fmpz_lll_heuristic_dot(
vec1: *const f64,
vec2: *const f64,
len2: mp_limb_signed_t,
B: *const fmpz_mat_struct,
k: mp_limb_signed_t,
j: mp_limb_signed_t,
exp_adj: mp_limb_signed_t,
) -> f64;
pub fn fmpz_lll_shift(B: *const fmpz_mat_struct) -> c_int;
pub fn fmpz_lll_d(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_d_heuristic(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_mpf2(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
prec: mp_limb_t,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_mpf(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_wrapper(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_d_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_d_heuristic_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_mpf2_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
prec: mp_limb_t,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_mpf_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_wrapper_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_d_with_removal_knapsack(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_wrapper_with_removal_knapsack(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_with_removal_ulll(
FM: *mut fmpz_mat_struct,
UM: *mut fmpz_mat_struct,
new_size: mp_limb_signed_t,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_is_reduced_d(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_is_reduced_mpfr(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
prec: mp_limb_t,
) -> c_int;
pub fn fmpz_lll_is_reduced(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
prec: mp_limb_t,
) -> c_int;
pub fn fmpz_lll_is_reduced_d_with_removal(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
gs_B: *const fmpz,
newd: c_int,
) -> c_int;
pub fn fmpz_lll_is_reduced_mpfr_with_removal(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
gs_B: *const fmpz,
newd: c_int,
prec: mp_limb_t,
) -> c_int;
pub fn fmpz_lll_is_reduced_with_removal(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
gs_B: *const fmpz,
newd: c_int,
prec: mp_limb_t,
) -> c_int;
pub fn fmpz_lll(B: *mut fmpz_mat_struct, U: *mut fmpz_mat_struct, fl: *const fmpz_lll_struct);
pub fn fmpz_lll_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> c_int;
pub fn fmpz_lll_storjohann_ulll(
FM: *mut fmpz_mat_struct,
new_size: mp_limb_signed_t,
fl: *const fmpz_lll_struct,
);
}