#include <matrix.h>
Public Member Functions | |
Matrix () | |
Matrix (int rows, int cols) | |
void | clear () |
bool | empty () const |
void | resize (int rows, int cols) |
void | set_rows (int rows) |
void | set_cols (int cols) |
template<class U > | |
void | fill (U value) |
void | swap (Matrix< T > &m) |
int | get_rows () const |
int | get_cols () const |
T & | operator() (int i, int j) |
const T & | operator() (int i, int j) const |
MatrixRow< T > | operator[] (int i) |
const MatrixRow< T > | operator[] (int i) const |
void | swap_rows (int r1, int r2) |
void | rotate_left (int first, int last) |
void | rotate_right (int first, int last) |
void | rotate (int first, int middle, int last) |
void | rotate_gram_left (int first, int last, int n_valid_rows) |
void | rotate_gram_right (int first, int last, int n_valid_rows) |
void | transpose () |
T | get_max () |
long | get_max_exp () |
void | print (ostream &os, int nrows=-1, int ncols=-1) const |
void | read (istream &is) |
ostream & | print_comma (ostream &os) const |
Static Public Member Functions | |
static int | set_print_mode (int new_print_mode) |
Protected Attributes | |
int | r |
int | c |
vector< NumVect< T > > | matrix |
Static Protected Attributes | |
static int | print_mode = MAT_PRINT_COMPACT |
Detailed Description
class Matrix< T >
Matrix is a two-dimensional container. Read and write operations on single elements are in constant time. The amortized complexity of resizing the matrix is proportional to the number of added/removed elements. All indices are 0-based.
Constructor & Destructor Documentation
◆ Matrix() [1/2]
◆ Matrix() [2/2]
Creates a matrix of dimensions rows x cols. All elements are initialized with the default constructor of T.
Member Function Documentation
◆ clear()
|
inline |
Sets number of rows and the number of columns to 0.
◆ empty()
|
inline |
Returns true if the matrix has 0 rows, false otherwise.
◆ fill()
Fills this matrix with a given value.
◆ get_cols()
|
inline |
Returns the number of columns
◆ get_max()
T Matrix< T >::get_max |
◆ get_max_exp()
long Matrix< T >::get_max_exp |
◆ get_rows()
|
inline |
Returns the number of rows
◆ operator()() [1/2]
|
inline |
Returns a reference to the element (i, j).
◆ operator()() [2/2]
|
inline |
Returns a constant reference to the element (i, j) on constant objects.
◆ operator[]() [1/2]
Returns a MatrixRow object pointing to the i-th row of this matrix.
◆ operator[]() [2/2]
Returns a MatrixRow object pointing to the i-th row of this matrix on constant objects.
◆ print()
void Matrix< T >::print | ( | ostream & | os, |
int | nrows = -1 , |
||
int | ncols = -1 |
||
) | const |
Prints this matrix. No end-of-line is printed after the last line.
- Parameters
-
os output stream nrows maximum number of rows to display (optional) ncols maximum number of columns to display (optional)
◆ print_comma()
ostream & Matrix< T >::print_comma | ( | ostream & | os | ) | const |
Print the matrix, sage format style
◆ read()
void Matrix< T >::read | ( | istream & | is | ) |
Reads this matrix from a stream.
◆ resize()
FPLLL_BEGIN_NAMESPACE void Matrix< T >::resize | ( | int | rows, |
int | cols | ||
) |
Sets the dimensions of this matrix, preserving as much as possible of the content. The value of new elements is undefined.
◆ rotate()
|
inline |
Rows permutation. (m[first],...,m[middle-1],m[middle],m[last]) becomes (m[middle],...,m[last],m[first],...,m[middle-1])
◆ rotate_gram_left()
void Matrix< T >::rotate_gram_left | ( | int | first, |
int | last, | ||
int | n_valid_rows | ||
) |
Transformation needed to update the lower triangular Gram matrix when rotate_left(first, last) is done on the basis of the lattice.
◆ rotate_gram_right()
void Matrix< T >::rotate_gram_right | ( | int | first, |
int | last, | ||
int | n_valid_rows | ||
) |
Transformation needed to update the lower triangular Gram matrix when rotate_right(first, last) is done on the basis of the lattice.
◆ rotate_left()
|
inline |
Rows permutation. (m[first],...,m[last]) becomes (m[first+1],...,m[last],m[first])
◆ rotate_right()
|
inline |
Rows permutation. (m[first],...,m[last]) becomes (m[last],m[first],...,m[last-1])
◆ set_cols()
|
inline |
Sets the number of columns. Content is not erased except for deleted columns. The value of new elements is undefined.
◆ set_print_mode()
|
inlinestatic |
Change the output format style of Matrix
◆ set_rows()
|
inline |
Sets the number of rows. Content is not erased except for deleted rows. The value of new elements is undefined.
◆ swap()
◆ swap_rows()
|
inline |
Rows swap.
◆ transpose()
void Matrix< T >::transpose |
Transpose.
Field Documentation
◆ c
|
protected |
◆ matrix
◆ print_mode
|
staticprotected |
◆ r
|
protected |
The documentation for this class was generated from the following files:
- fplll/nr/matrix.h
- fplll/nr/matrix.cpp