linbox
|
Directly-represented matrix archetype. More...
#include <archetype.h>
Public Member Functions | |
MatrixArchetype () | |
Empty Constructor. | |
MatrixArchetype (size_t m, size_t n) | |
Constructor with size. More... | |
MatrixArchetype (const MatrixArchetype &M) | |
Copy constructor. | |
MatrixArchetype & | operator= (const MatrixArchetype &M) |
Operator =. | |
size_t | rowdim () const |
Get the number of rows in the matrix. More... | |
size_t | coldim () const |
Get the number of columns in the matrix. More... | |
void | resize (size_t m, size_t n) |
Resize the matrix to the given dimensions. More... | |
Input and output | |
template<class Field > | |
std::istream & | read (std::istream &file, const Field &F) |
Read the matrix from an input stream. More... | |
template<class Field > | |
std::ostream & | write (std::ostream &os, const Field &F) const |
Write the matrix to an output stream. More... | |
Access to matrix elements | |
typedef Col | Column |
Set the entry at the (i, j) position to a_ij. More... | |
typedef ConstCol | ConstColumn |
Set the entry at the (i, j) position to a_ij. More... | |
typedef const IndexedIterator | ConstIndexedIterator |
Set the entry at the (i, j) position to a_ij. More... | |
const Element & | setEntry (size_t i, size_t j, const Element &a_ij) |
Set the entry at the (i, j) position to a_ij. More... | |
Element & | refEntry (size_t i, size_t j) |
Get a writeable reference to the entry in the (i, j) position. More... | |
const Element & | getEntry (size_t i, size_t j) const |
Get a read-only reference to the entry in the (i, j) position. More... | |
Element & | getEntry (Element &x, size_t i, size_t j) const |
Copy the (i, j) entry into x, and return a reference to x. More... | |
RowIterator | rowBegin () |
rowBegin | |
RowIterator | rowEnd () |
rowEnd | |
ConstRowIterator | rowBegin () const |
const rowBegin | |
ConstRowIterator | rowEnd () const |
const rowEnd | |
ColIterator | colBegin () |
colBegin | |
ColIterator | colEnd () |
colEnd | |
ConstColIterator | colBegin () const |
const colBegin | |
ConstColIterator | colEnd () const |
const colEnd | |
Iterator | Begin () |
Set the entry at the (i, j) position to a_ij. More... | |
Iterator | End () |
Set the entry at the (i, j) position to a_ij. More... | |
ConstIterator | Begin () const |
Set the entry at the (i, j) position to a_ij. More... | |
ConstIterator | End () const |
Set the entry at the (i, j) position to a_ij. More... | |
IndexedIterator | IndexedBegin () |
Set the entry at the (i, j) position to a_ij. More... | |
IndexedIterator | IndexedEnd () |
Set the entry at the (i, j) position to a_ij. More... | |
ConstIndexedIterator | IndexedBegin () const |
Set the entry at the (i, j) position to a_ij. More... | |
ConstIndexedIterator | IndexedEnd () const |
Set the entry at the (i, j) position to a_ij. More... | |
Row | operator[] (size_t i) |
Retrieve a reference to a row. More... | |
ConstRow | operator[] (size_t i) const |
const version | |
Computing matrix information | |
std::vector< Element > | _rep |
Compute the column density, i.e. More... | |
size_t | _rows |
Compute the column density, i.e. More... | |
size_t | _cols |
Compute the column density, i.e. More... | |
template<class Vector > | |
Vector & | columnDensity (Vector &v) const |
Compute the column density, i.e. More... | |
MatrixArchetype & | transpose (MatrixArchetype &M) const |
Compute the transpose. | |
Directly-represented matrix archetype.
This archetype gives the common interface for matrices that have direct representations. The matrices are required to provide iterators to access and manipulate their entries, but not any matrix-matrix or matrix-vector arithmetic. That is, they are pure containers. As such, they are only parameterized on the element type, not on the field type.
typedef Col Column |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
typedef ConstCol ConstColumn |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
typedef const IndexedIterator ConstIndexedIterator |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
MatrixArchetype | ( | size_t | m, |
size_t | n | ||
) |
Constructor with size.
m | row dimension |
n | column dimension |
size_t rowdim | ( | ) | const |
Get the number of rows in the matrix.
size_t coldim | ( | ) | const |
Get the number of columns in the matrix.
void resize | ( | size_t | m, |
size_t | n | ||
) |
Resize the matrix to the given dimensions.
The state of the matrix's entries after a call to this method is undefined.
This interface is optional; a matrix can omit it if it makes no sense in the context.
m | Number of rows |
n | Number of columns |
std::istream& read | ( | std::istream & | file, |
const Field & | F | ||
) |
Read the matrix from an input stream.
file | Input stream from which to read |
F | Field over which to read |
std::ostream& write | ( | std::ostream & | os, |
const Field & | F | ||
) | const |
Write the matrix to an output stream.
os | Output stream to which to write |
F | Field over which to write |
const Element& setEntry | ( | size_t | i, |
size_t | j, | ||
const Element & | a_ij | ||
) |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
Element& refEntry | ( | size_t | i, |
size_t | j | ||
) |
Get a writeable reference to the entry in the (i, j) position.
i | Row index of entry |
j | Column index of entry |
const Element& getEntry | ( | size_t | i, |
size_t | j | ||
) | const |
Get a read-only reference to the entry in the (i, j) position.
i | Row index |
j | Column index |
Element& getEntry | ( | Element & | x, |
size_t | i, | ||
size_t | j | ||
) | const |
Copy the (i, j) entry into x, and return a reference to x.
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 |
Iterator Begin | ( | ) |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
Iterator End | ( | ) |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
ConstIterator Begin | ( | ) | const |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
ConstIterator End | ( | ) | const |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
IndexedIterator IndexedBegin | ( | ) |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
IndexedIterator IndexedEnd | ( | ) |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
ConstIndexedIterator IndexedBegin | ( | ) | const |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
ConstIndexedIterator IndexedEnd | ( | ) | const |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
Row operator[] | ( | size_t | i | ) |
Retrieve a reference to a row.
Since rows may also be indexed, this allows A[i][j] notation to be used.
This may be omitted by an implementation if no Row type is available
i | Row index |
Compute the column density, i.e.
the number of entries per column
|
protected |
Compute the column density, i.e.
the number of entries per column
|
protected |
Compute the column density, i.e.
the number of entries per column
|
protected |
Compute the column density, i.e.
the number of entries per column