linbox
|
Dense row-wise matrix container. More...
#include <dense-rows-matrix.h>
Public Member Functions | |
DenseRowsMatrix (size_t m, size_t n) | |
Constructor. | |
DenseRowsMatrix (const DenseRowsMatrix &A) | |
Copy constructor. | |
~DenseRowsMatrix () | |
Destructor. | |
size_t | rowdim () const |
Retreive row dimension of the matrix. | |
size_t | coldim () const |
Retreive column dimension of matrix. | |
Input and output | |
template<class Field > | |
std::istream & | read (std::istream &is, const Field &F) |
Read a matrix from the given input stream using field read/write. | |
std::istream & | read (std::istream &is) |
Read a matrix from the given input stream using standard operators. | |
template<class Field > | |
std::ostream & | write (std::ostream &os, const Field &F) const |
Write a matrix to the given output stream using field read/write. | |
std::ostream & | write (std::ostream &os) const |
Write a matrix to the given output stream using standard operators. | |
Access to matrix elements | |
void | setEntry (size_t i, size_t j, const Element &value) |
Set an individual entry Setting the entry to 0 will remove it from the matrix. | |
Element & | refEntry (size_t i, size_t j) |
Get a writeable reference to an entry in the matrix If there is no entry at the position (i, j), then a new entry with a value of zero is inserted and a reference to it is returned. | |
const Element & | getEntry (size_t i, size_t j) const |
Get a read-only individual entry from the matrix. | |
Element & | getEntry (Element &x, size_t i, size_t j) const |
Get an entry and store it in the given value This form is more in the Linbox style and is provided for interface compatibility with other parts of the library. | |
Raw iterator | |
The raw iterator is a method for accessing all nonzero entries in the matrix in some unspecified order. This can be used, e.g. to reduce all matrix entries modulo a prime before passing the matrix into an algorithm. | |
Iterator | Begin () |
Begin. | |
Iterator | End () |
End. | |
ConstIterator | Begin () const |
const Begin | |
ConstIterator | End () const |
const End | |
Index iterator | |
The index iterator gives the row, column indices of all matrix elements in the same order as the raw iterator above. Its value type is an STL pair with the row and column indices, starting at 0, in the first and second positions, respectively. | |
IndexedIterator | IndexedBegin () |
IndexedBegin. | |
IndexedIterator | IndexedEnd () |
IndexedEnd. | |
ConstIndexedIterator | IndexedBegin () const |
const IndexedBegin | |
ConstIndexedIterator | IndexedEnd () const |
const IndexedEnd | |
Row & | getRow (size_t i) |
Retrieve a row as a writeable reference. | |
DenseRowsMatrix & | transpose (DenseRowsMatrix &AT) const |
Construct the transpose of this matrix and place it in the DenseRowsMatrix given. |
Dense row-wise matrix container.
This class implements a dense matrix, storing the data as a vector of vectors of the given type, in the same manner as SparseMatrixBase. It provides only row iterators.
Vector | Row vector type |
DenseRowsMatrix | ( | size_t | m, |
size_t | n | ||
) |
Constructor.
Note: the copy constructor and operator= will work as intended because of STL's container design
m | row dimension |
n | column dimension |
|
inline |
Destructor.
|
inline |
Retreive row dimension of the matrix.
|
inline |
Retreive column dimension of matrix.
std::istream& read | ( | std::istream & | is, |
const Field & | F | ||
) |
Read a matrix from the given input stream using field read/write.
is | Input stream from which to read the matrix |
F | Field with which to read |
std::istream& read | ( | std::istream & | is | ) |
Read a matrix from the given input stream using standard operators.
is | Input stream from which to read the matrix |
std::ostream& write | ( | std::ostream & | os, |
const Field & | F | ||
) | const |
Write a matrix to the given output stream using field read/write.
os | Output stream to which to write the matrix |
F | Field with which to write |
std::ostream& write | ( | std::ostream & | os | ) | const |
Write a matrix to the given output stream using standard operators.
os | Output stream to which to write the matrix |
|
inline |
Set an individual entry Setting the entry to 0 will remove it from the matrix.
i | Row index of entry |
j | Column index of entry |
value | Value of the new entry |
|
inline |
Get a writeable reference to an entry in the matrix If there is no entry at the position (i, j), then a new entry with a value of zero is inserted and a reference to it is returned.
i | Row index of entry |
j | Column index of entry |
|
inline |
Get a read-only individual entry from the matrix.
i | Row index |
j | Column index |
|
inline |
Get an entry and store it in the given value This form is more in the Linbox style and is provided for interface compatibility with other parts of the library.
x | Element in which to store result |
i | Row index |
j | Column index |
|
inline |
Retrieve a row as a writeable reference.
i | Row index |
DenseRowsMatrix& transpose | ( | DenseRowsMatrix< _Row > & | AT | ) | const |
Construct the transpose of this matrix and place it in the DenseRowsMatrix given.
AT |