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
/*
Copyright (C) 2009, 2010 William Hart
Copyright (C) 2009, 2010 Andy Novocin
Copyright (C) 2014 Abhinav Baid
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/
#include "fmpz_mat.h"
#include "fmpz_lll.h"
int
fmpz_lll_is_reduced_with_removal(const fmpz_mat_t B, const fmpz_lll_t fl,
const fmpz_t gs_B, int newd, flint_bitcnt_t prec)
{
if (gs_B == NULL)
return fmpz_lll_is_reduced(B, fl, prec);
if (fl->rt == Z_BASIS)
{
int res;
fmpz_mat_t BB;
_fmpz_mat_window_readonly_init_strip_initial_zero_rows(BB, B);
if (fmpz_lll_is_reduced_d_with_removal(BB, fl, gs_B, newd))
{
res = 1;
}
else if (fmpz_lll_is_reduced_mpfr_with_removal(BB, fl, gs_B, newd, prec))
{
res = 1;
}
else
{
res = fmpz_mat_is_reduced_with_removal(BB, fl->delta, fl->eta, gs_B, newd);
}
_fmpz_mat_window_readonly_clear(BB);
return res;
}
else
{
if (fmpz_lll_is_reduced_d_with_removal(B, fl, gs_B, newd))
return 1;
if (fmpz_lll_is_reduced_mpfr_with_removal(B, fl, gs_B, newd, prec))
return 1;
return fmpz_mat_is_reduced_gram_with_removal(B, fl->delta, fl->eta, gs_B, newd);
}
}