15 int ncols =
static_cast<int>(A->
n_rows());
16 int nrows =
static_cast<int>(A->
n_cols());
19 for (
int i = 0; i < ncols; i++)
20 for (
int j = 0; j < nrows; j++)
34 size_t ncols = A->NumRows();
35 size_t nrows = A->NumCols();
41 for (
size_t i = 0; i < ncols; i++)
42 for (
size_t j = 0; j < nrows; j++)
44 if ((*A)(i + 1, j + 1) != 0)
59static const int GS = 0;
63static const int FP = 16;
64static const int QP1 = 2 * 16;
65static const int QP = 3 * 16;
66static const int XD = 4 * 16;
75 int nrows =
static_cast<int>(M->
n_rows());
76 int ncols =
static_cast<int>(M->
n_cols());
81 double delta =
static_cast<double>(numer) /
static_cast<double>(denom);
83 if (
M2_gbTrace >= 10) printf(
"LLL: using strategy %d\n", strategy);
91 LLL(d, *A, numer, denom);
93 LLL(d, *A, *V, numer, denom);
100 LLL_FP(*A, *V, delta);
107 LLL_QP(*A, *V, delta);
113 LLL_XD(*A, *V, delta);
119 LLL_RR(*A, *V, delta);
126 BKZ_FP(*A, *V, delta);
132 BKZ_QP(*A, *V, delta);
138 BKZ_QP1(*A, *V, delta);
144 BKZ_XD(*A, *V, delta);
150 BKZ_RR(*A, *V, delta);
157 G_LLL_FP(*A, *V, delta);
164 G_LLL_QP(*A, *V, delta);
170 G_LLL_XD(*A, *V, delta);
176 G_LLL_RR(*A, *V, delta);
183 G_BKZ_FP(*A, *V, delta);
189 G_BKZ_QP(*A, *V, delta);
193 G_BKZ_QP1(*A, delta);
195 G_BKZ_QP1(*A, *V, delta);
201 G_BKZ_XD(*A, *V, delta);
207 G_BKZ_RR(*A, *V, delta);
212 ERROR(
"Strategy option to LLL not understood");
220 for (
int j = 0; j < ncols; j++)
221 for (
int i = 0; i < nrows; i++)
230 for (
int j = 0; j < ncols; j++)
231 for (
int i = 0; i < ncols; i++)
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
static MutableMatrix * zero_matrix(const Ring *R, size_t nrows, size_t ncols, bool dense)
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...
MutableMatrix — abstract base of every mutable matrix the engine hands across the boundary.
NTL::mat_ZZ * mutableMatrix_to_NTL_mat_ZZ(const MutableMatrix *M)
MutableMatrix * mutableMatrix_from_NTL_mat_ZZ(const NTL::mat_ZZ *A)
bool ntl_LLL(MutableMatrix *M, MutableMatrix *U, long numer, long denom, int strategy)
void mat_ZZ_get_entry(const NTL::mat_ZZ *A, long i, long j, mpz_t result)
void mat_ZZ_set_entry(NTL::mat_ZZ *A, long i, long j, mpz_srcptr a)
NTL::mat_ZZ * makeNTLMatrixZZ(int nrows, int ncols)
Engine bridge into NTL — type conversions and the NTL-backed LLL entry point.
mpz_srcptr get_mpz() const