31template <
class T>
class Matrix;
44 int size()
const {
return row.size(); }
46 void print(ostream &os)
const { os << row; }
48 bool is_zero(
int from = 0)
const {
return row.is_zero(from); }
49 int size_nz()
const {
return row.size_nz(); }
50 void fill(
long value) { row.fill(value); }
62 row.addmul_2exp(v.row, x, expo, tmp);
66 row.addmul_2exp(v.row, x, expo, tmp);
72 row.addmul_si_2exp(v.row, x, expo, tmp);
76 row.addmul_si_2exp(v.row, x, expo, n, tmp);
136 void resize(
int rows,
int cols);
144 template <
class U>
void fill(U value);
208 void print(ostream &os,
int nrows = -1,
int ncols = -1)
const;
210 void read(istream &is);
264 for (
int i = 0; i < d; i++)
271 for (
int i = 0; i < d; i++)
340template <
class ZTto,
class ZTfrom>
FP_mat()
Definition: matrix.h:349
FP_mat(int rows, int cols)
Definition: matrix.h:352
FP_NR< FT > T
Definition: matrix.h:347
void dot_product(T &result, const MatrixRow< T > &v0, int beg, int n) const
Definition: matrix.h:82
void addmul(const MatrixRow< T > &v, T x)
Definition: matrix.h:57
int size_nz() const
Definition: matrix.h:49
void dot_product(T &result, const MatrixRow< T > &v0) const
Definition: matrix.h:94
void print(ostream &os) const
Definition: matrix.h:46
void addmul_2exp(const MatrixRow< T > &v, const T &x, long expo, T &tmp)
Definition: matrix.h:60
void addmul(const MatrixRow< T > &v, T x, int b, int n)
Definition: matrix.h:59
void fill(long value)
Definition: matrix.h:50
void dot_product(T &result, const MatrixRow< T > &v0, int n) const
Definition: matrix.h:88
void addmul_si_2exp(const MatrixRow< T > &v, long x, long expo, T &tmp)
Definition: matrix.h:70
void addmul_si(const MatrixRow< T > &v, long x)
Definition: matrix.h:68
int size() const
Definition: matrix.h:44
void sub(const MatrixRow< T > &v, int n)
Definition: matrix.h:54
bool is_zero(int from=0) const
Definition: matrix.h:48
void addmul_2exp(const MatrixRow< T > &v, const T &x, long expo, int, T &tmp)
Definition: matrix.h:64
T & operator[](int i)
Definition: matrix.h:39
void mul(const MatrixRow< T > &v, int b, int n, T x)
Definition: matrix.h:55
void addmul_si_2exp(const MatrixRow< T > &v, long x, long expo, int n, T &tmp)
Definition: matrix.h:74
void sub(const MatrixRow< T > &v)
Definition: matrix.h:53
void div(const MatrixRow< T > &v, int b, int n, T x)
Definition: matrix.h:56
void add(const MatrixRow< T > &v, int n)
Definition: matrix.h:52
void addmul(const MatrixRow< T > &v, T x, int n)
Definition: matrix.h:58
void addmul_si(const MatrixRow< T > &v, long x, int n)
Definition: matrix.h:69
void add(const MatrixRow< T > &v)
Definition: matrix.h:51
const T & operator[](int i) const
Definition: matrix.h:42
int r
Definition: matrix.h:222
ostream & print_comma(ostream &os) const
Definition: matrix.cpp:205
void rotate_left(int first, int last)
Definition: matrix.h:186
const T & operator()(int i, int j) const
Definition: matrix.h:164
void rotate_gram_left(int first, int last, int n_valid_rows)
Definition: matrix.cpp:65
vector< NumVect< T > > matrix
Definition: matrix.h:223
int get_cols() const
Definition: matrix.h:156
Matrix(int rows, int cols)
Definition: matrix.h:124
int c
Definition: matrix.h:222
void rotate(int first, int middle, int last)
Definition: matrix.h:193
MatrixRow< T > operator[](int i)
Definition: matrix.h:170
void transpose()
Definition: matrix.cpp:95
static int print_mode
Definition: matrix.h:225
void swap(Matrix< T > &m)
Definition: matrix.h:146
int get_rows() const
Definition: matrix.h:154
void resize(int rows, int cols)
Definition: matrix.cpp:26
void print(ostream &os, int nrows=-1, int ncols=-1) const
Definition: matrix.cpp:136
const MatrixRow< T > operator[](int i) const
Definition: matrix.h:177
static int set_print_mode(int new_print_mode)
Definition: matrix.h:214
void set_cols(int cols)
Definition: matrix.h:142
long get_max_exp()
Definition: matrix.cpp:127
void rotate_gram_right(int first, int last, int n_valid_rows)
Definition: matrix.cpp:80
Matrix()
Definition: matrix.h:121
void set_rows(int rows)
Definition: matrix.h:139
void fill(U value)
Definition: matrix.cpp:54
void swap_rows(int r1, int r2)
Definition: matrix.h:183
void clear()
Definition: matrix.h:127
T get_max()
Definition: matrix.cpp:114
void rotate_right(int first, int last)
Definition: matrix.h:189
void read(istream &is)
Definition: matrix.cpp:163
T & operator()(int i, int j)
Definition: matrix.h:158
bool empty() const
Definition: matrix.h:133
Definition: numvect.h:130
void gen_zero(int d, int n)
Definition: matrix.h:261
void gen_simdioph(int bits, int bits2)
Definition: matrix.cpp:252
void gen_trg2(FP_NR< mpfr_t > *w)
Definition: matrix.cpp:602
void gen_uniform(int bits)
Definition: matrix.cpp:276
void gen_ntrulike2_withq(int q)
Definition: matrix.cpp:482
void gen_ntrulike2(int bits)
Definition: matrix.cpp:426
void gen_trg(double alpha)
Definition: matrix.cpp:567
ZZ_mat()
Definition: matrix.h:255
void gen_qary(int k, Z_NR< ZT > &q)
Definition: matrix.cpp:538
void gen_qary_prime(int k, int bits)
Definition: matrix.h:317
ZZ_mat(int rows, int cols)
Definition: matrix.h:258
void gen_identity(int d)
Definition: matrix.h:268
void gen_ntrulike_withq(int q)
Definition: matrix.cpp:358
void gen_intrel(int bits)
Definition: matrix.cpp:229
void gen_qary(int k, int bits)
Definition: matrix.h:303
Z_NR< ZT > T
Definition: matrix.h:246
void gen_ntrulike(int bits)
Definition: matrix.cpp:288
void gen_qary_withq(int k, int q)
Definition: matrix.h:310
void nextprime(const Z_NR< Z > &nbr)
#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
MatPrintMode
Definition: matrix.h:26
@ MAT_PRINT_REGULAR
Definition: matrix.h:28
@ MAT_PRINT_COMPACT
Definition: matrix.h:27
istream & operator>>(istream &is, Matrix< T > &m)
Definition: matrix.h:236
ostream & operator<<(ostream &os, const MatrixRow< T > &row)
Definition: matrix.h:107
bool convert(ZZ_mat< ZTto > &Ato, const ZZ_mat< ZTfrom > &Afrom, int buffer=0)
Definition: matrix.cpp:632
void dot_product(T &result, const NumVect< T > &v1, const NumVect< T > &v2, int beg, int n)
Definition: numvect.h:386
void rotate_right_by_swap(vector< T > &v, int first, int last)
Definition: numvect.h:67
void rotate_by_swap(vector< T > &v, int first, int middle, int last)
Definition: numvect.h:41
void rotate_left_by_swap(vector< T > &v, int first, int last)
Definition: numvect.h:57