15 ERROR(
"fplll is not available (configure M2 with fplll!)");
21 fplll::LLLMethod method = fplll::LM_WRAPPER;
22 fplll::FloatType floatType = fplll::FT_DEFAULT;
24 int flags = fplll::LLL_DEFAULT;
26 int ncols =
static_cast<int>(M->
n_rows());
27 int nrows =
static_cast<int>(M->
n_cols());
29 fplll::ZZ_mat<mpz_t> mat(nrows, ncols);
31 for (
int i = 0; i < nrows; i++)
32 for (
int j = 0; j < ncols; j++)
37 mpz_set(mat[i][j].get_data(), a.
get_mpz());
42 lll_reduction(mat, delta, eta, method, floatType, precision, flags);
46 case fplll::RED_SUCCESS:
48 case fplll::RED_BABAI_FAILURE:
49 ERROR(
"Error in fpLLL");
51 case fplll::RED_LLL_FAILURE:
52 ERROR(
"infinite loop in LLL");
55 ERROR(
"unknown error in fpLLL");
63 for (
int j = 0; j < ncols; j++)
64 for (
int i = 0; i < nrows; i++)
66 mpz_set(a, mat[i][j].get_data());
virtual size_t n_rows() const =0
virtual size_t n_cols() const =0
virtual bool get_entry(size_t r, size_t c, ring_elem &result) const =0
virtual bool set_entry(size_t r, size_t c, const ring_elem a)=0
Abstract base class for mutable matrices over an arbitrary engine Ring, the in-place counterpart of t...
bool fp_LLL(MutableMatrix *M, MutableMatrix *U, int strategy)
Engine-side wrapper around the external fplll lattice-reduction library.
VALGRIND_MAKE_MEM_DEFINED & result(result)
Umbrella header that ties together MutableMat declarations, implementations, and the SLP variant.
mpz_srcptr get_mpz() const