127 row_op_first = row_op_last = -1;
152 virtual void move_row(
int old_r,
int new_r);
175 virtual void row_addmul_we(
int i,
int j,
const FT &x,
long expo_add);
178 virtual void row_add(
int i,
int j);
179 virtual void row_sub(
int i,
int j);
182 virtual inline FT &
get_gram(FT &f,
int i,
int j);
187 virtual void row_swap(
int i,
int j);
198 void to_canonical(vector<FT> &w,
const vector<FT> &v,
long start = 0);
210 void from_canonical(vector<FT> &v,
const vector<FT> &w,
long start = 0,
long dimension = -1);
221 void virtual babai(vector<ZT> &v,
int start = 0,
int dimension = -1,
bool gso =
false);
233 void virtual babai(vector<ZT> &w,
const vector<FT> &v,
int start = 0,
int dimension = -1,
239 virtual void size_increased();
241 virtual void discover_row();
245 virtual void update_bf(
int i);
247 virtual void invalidate_gram_row(
int i);
250 virtual void row_addmul_si(
int i,
int j,
long x);
252 virtual void row_addmul_si_2exp(
int i,
int j,
long x,
long expo);
253 virtual void row_addmul_2exp(
int i,
int j,
const ZT &x,
long expo);
256template <
class ZT,
class FT>
263 for (
size_t j = 0; j < tmpvec.size(); j++)
265 tmp.mul(tmpvec[j], tmpvec[j]);
266 sqnorm.add(sqnorm, tmp);
273 return b.get_max_exp();
278 return b[i].is_zero();
293 for (
int j = 0; j < get_cols_of_b(); j++)
295 b[i][j].neg(b[i][j]);
299 for (
int j = 0; j < get_rows_of_b(); j++)
303 g(i, j).neg(g(i, j));
307 g(j, i).neg(g(j, i));
315 FPLLL_DEBUG_CHECK(i >= 0 && i < n_known_rows && j >= 0 && j <= i && j < n_source_rows &&
316 !in_row_op_range(i));
323 if (gf(i, j).is_nan())
325 bf[i].dot_product(gf(i, j), bf[j], n_known_cols);
334 FPLLL_DEBUG_CHECK(i >= 0 && i < n_known_rows && j >= 0 && j <= i && j < n_source_rows &&
335 !in_row_op_range(i));
343 b[i].dot_product(z, b[j], n_known_cols);
354 for (
int i = old_d; i < d; i++)
356 for (
int j = 0; j < b.get_cols(); j++)
361 if (enable_transform)
364 for (
int i = old_d; i < d; i++)
365 for (
int j = 0; j < u.get_cols(); j++)
369 if (n_known_rows == old_d)
377 n_known_rows = min(n_known_rows, d);
378 n_source_rows = n_known_rows;
380 if (enable_transform)
Definition: gso_interface.h:60
vector< long > row_expo
Definition: gso_interface.h:167
int alloc_dim
Definition: gso_interface.h:558
virtual void row_addmul(int i, int j, const FT &x)
Definition: gso_interface.h:746
bool cols_locked
Definition: gso_interface.h:557
vector< int > gso_valid_cols
Definition: gso_interface.h:605
const bool enable_int_gram
Definition: gso_interface.h:480
Matrix< FT > mu
Definition: gso_interface.h:572
Matrix< FT > bf
Definition: gso_interface.h:545
FT & get_r(FT &f, int i, int j)
Definition: gso_interface.h:721
const bool enable_inverse_transform
Definition: gso_interface.h:493
bool update_gso()
Definition: gso_interface.h:764
int n_known_rows
Definition: gso_interface.h:554
void invalidate_gso_row(int i, int new_valid_cols=0)
Definition: gso_interface.cpp:26
int n_source_rows
Definition: gso_interface.h:555
bool update_gso_row(int i, int last_j)
Definition: gso_interface.cpp:131
Matrix< FT > gf
Definition: gso_interface.h:601
int n_known_cols
Definition: gso_interface.h:556
Matrix< ZT > * gptr
Definition: gso_interface.h:597
void remove_last_row()
Definition: gso_interface.h:753
void discover_all_rows()
Definition: gso_interface.h:758
const bool enable_row_expo
Definition: gso_interface.h:483
FT & get_mu(FT &f, int i, int j)
Definition: gso_interface.h:691
ZT ztmp1
Definition: gso_interface.h:611
Matrix< ZT > & u_inv_t
Definition: gso_interface.h:548
vector< int > init_row_size
Definition: gso_interface.h:551
const bool row_op_force_long
Definition: gso_interface.h:499
int d
Definition: gso_interface.h:114
vector< long > tmp_col_expo
Definition: gso_interface.h:615
Matrix< FT > r
Definition: gso_interface.h:586
void print_mu_r_g(ostream &os)
Definition: gso_interface.h:645
void symmetrize_g()
Definition: gso_interface.h:629
ZT & sym_g(int i, int j)
Definition: gso_interface.h:661
const bool enable_transform
Definition: gso_interface.h:486
Matrix< ZT > & u
Definition: gso_interface.h:547
ZT ztmp2
Definition: gso_interface.h:613
virtual void create_rows(int n_new_rows)
Definition: gso.h:348
virtual void babai(vector< ZT > &v, int start=0, int dimension=-1, bool gso=false)
Definition: gso.cpp:482
virtual FT & get_gram(FT &f, int i, int j)
Definition: gso.h:313
virtual void row_addmul_we(int i, int j, const FT &x, long expo_add)
Definition: gso.cpp:237
virtual int get_rows_of_b() const
Definition: gso.h:285
void to_canonical(vector< FT > &w, const vector< FT > &v, long start=0)
Definition: gso.cpp:406
void from_canonical(vector< FT > &v, const vector< FT > &w, long start=0, long dimension=-1)
Definition: gso.cpp:437
virtual void negate_row_of_b(int i)
Definition: gso.h:290
Matrix< ZT > & b
Definition: gso.h:135
virtual ZT & sqnorm_coordinates(ZT &sqnorm, vector< ZT > coordinates)
Definition: gso.h:257
virtual void row_add(int i, int j)
Definition: gso.cpp:84
virtual long get_max_exp_of_b()
Definition: gso.h:271
virtual int get_cols_of_b() const
Definition: gso.h:280
virtual void move_row(int old_r, int new_r)
Definition: gso.cpp:289
virtual void remove_last_rows(int n_removed_rows)
Definition: gso.h:373
MatGSO(Matrix< ZT > &arg_b, Matrix< ZT > &arg_u, Matrix< ZT > &arg_uinv_t, int flags)
Definition: gso.h:112
virtual void row_swap(int i, int j)
Definition: gso.cpp:264
virtual ZT & get_int_gram(ZT &z, int i, int j)
Definition: gso.h:332
virtual bool b_row_is_zero(int i)
Definition: gso.h:276
virtual void row_sub(int i, int j)
Definition: gso.cpp:107
Matrix< ZT > g
Definition: gso.h:139
int get_cols() const
Definition: matrix.h:156
int get_rows() const
Definition: matrix.h:154
#define FPLLL_END_NAMESPACE
Definition: defs.h:117
#define FPLLL_DEBUG_CHECK(x)
Definition: defs.h:109
#define FPLLL_BEGIN_NAMESPACE
Definition: defs.h:114
void vector_matrix_product(vector< ZT > &result, const vector< ZT > &x, const Matrix< ZT > &m)
Definition: util.h:41