linbox
|
Blackbox interface to dense matrix representation. More...
#include <dense.h>
Public Types | |
typedef Field::Element | Element |
Element type. | |
typedef DenseMatrix< _Field > | Self_t |
Self type. | |
typedef RawVector< Element >::Dense | Rep |
No doc. | |
Public Member Functions | |
DenseMatrix (const Field &F, size_t m, size_t n) | |
Constructor of a m by n matrix with initial entries which are the default constructor value of the field's element type. | |
template<class RandIter > | |
DenseMatrix (const Field &F, size_t m, size_t n, const RandIter &iter) | |
Constructor of a m by n matrix with entries created by a random iterator. | |
template<class StreamVector > | |
DenseMatrix (const Field &F, VectorStream< StreamVector > &stream) | |
Constructor using a finite vector stream (stream of the rows). | |
DenseMatrix (MatrixStream< Field > &ms) | |
Constructor from a MatrixStream. | |
DenseMatrix (const Field &F, DenseMatrixBase< Element > &Mat) | |
Constructor from a DenseMatrixBase. | |
DenseMatrix (const DenseMatrix &Mat) | |
Copies all matrix data. | |
DenseMatrix< Field > & | operator= (const DenseMatrix< Field > &Mat) |
Assignment operator makes a complete copy. | |
size_t | rowdim () const |
Get the number of rows in the matrix. | |
size_t | coldim () const |
Get the number of columns in the matrix. | |
const Field & | field () const |
Retrieve the field over which this matrix is defined. | |
Element * | FullIterator () const |
Get a pointer on the storage of the elements. | |
void | resize (size_t m, size_t n, const Element &val=Element()) |
Resize the matrix to the given dimensions. | |
std::istream & | read (std::istream &file, const Field &F) |
Read the matrix from an input stream. | |
std::ostream & | write (std::ostream &os, const Field &F, bool mapleFormat=true) const |
Write the matrix to an output stream. | |
std::ostream & | write (std::ostream &os, bool mapleFormat=true) const |
Write brutally the matrix to an output stream. | |
void | setEntry (size_t i, size_t j, const Element &a_ij) |
Set the entry at the (i, j) position to a_ij. | |
Element & | refEntry (size_t i, size_t j) |
Get a writeable reference to the entry in the (i, j) position. | |
const Element & | getEntry (size_t i, size_t j) const |
Get a read-only reference to the entry in the (i, j) position. | |
Element & | getEntry (Element &x, size_t i, size_t j) const |
Copy the (i, j) entry into x, and return a reference to x. | |
Vector & | columnDensity (Vector &v) const |
Compute column density. | |
std::istream & | read (std::istream &is) |
Read the matrix from an input stream. | |
std::ostream & | write (std::ostream &os=std::cout) const |
Write the matrix to an output stream. | |
template<class Vect1 , class Vect2 > | |
Vect1 & | apply (Vect1 &y, const Vect2 &x) const |
Generic matrix-vector apply. | |
template<class Vect1 > | |
Vect1 & | applyIn (Vect1 &y) const |
Generic in-place apply. | |
template<class Vect1 , class Vect2 > | |
Vect1 & | applyTranspose (Vect1 &y, const Vect2 &x) const |
Generic matrix-vector transpose apply. | |
template<class Vect > | |
Vect & | applyTransposeIn (Vect &y) const |
Generic in-place transpose apply. | |
~DenseMatrix () | |
destructor | |
Raw iterator | |
The raw iterator is a method for accessing all 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. | |
RawIterator | rawBegin () |
ConstRawIterator | rawBegin () const |
RawIterator | rawEnd () |
ConstRawIterator | rawEnd () const |
Raw Indexed iterator | |
Like the raw iterator, the indexed iterator is a method for accessing all entries in the matrix in some unspecified order. At each position of the the indexed iterator, it also provides the row and column indices of the currently referenced entry. This is provided through it's | |
RawIndexedIterator | rawIndexedBegin () |
ConstRawIndexedIterator | rawIndexedBegin () const |
RawIndexedIterator | rawIndexedEnd () |
ConstRawIndexedIterator | rawIndexedEnd () const |
Row | operator[] (size_t i) |
Retrieve a reference to a row. | |
ConstRow | operator[] (size_t i) const |
Retrieve a reference to a row. | |
Column of rows iterator | |
The column of rows iterator traverses the rows of the matrix in ascending order. Dereferencing the iterator yields a row vector in dense format | |
typedef Subvector< typename Rep::iterator, typename Rep::const_iterator > | Row |
typedef Subvector< typename Rep::const_iterator > | ConstRow |
RowIterator | rowBegin () |
ConstRowIterator | rowBegin () const |
RowIterator | rowEnd () |
ConstRowIterator | rowEnd () const |
Row of columns iterator | |
The row of columns iterator traverses the columns of the matrix in ascending order. Dereferencing the iterator yields a column vector in dense format | |
typedef Subvector< Subiterator < typename Rep::iterator > > | Col |
typedef Subvector< Subiterator < typename Rep::const_iterator > > | ConstCol |
typedef Col | Column |
typedef ConstCol | ConstColumn |
ColIterator | colBegin () |
ConstColIterator | colBegin () const |
ColIterator | colEnd () |
ConstColIterator | colEnd () const |
Blackbox interface to dense matrix representation.
This is a class of dense matrices templatized by the field in which the elements reside. The matrix is stored as a one dimensional STL vector of the elements, in row major order. The interface provides for iteration over rows and over columns.
The class conforms to the archetype for blackboxes and for the dense matrix container .
Currently, only dense vectors are supported when doing matrix-vector applies.
_Field | a LinBox field class |
DenseMatrix | ( | const Field & | F, |
size_t | m, | ||
size_t | n | ||
) | [inline] |
Constructor of a m by n matrix with initial entries which are the default constructor value of the field's element type.
F | the field of entries; passed so that arithmetic may be done on elements. |
m | row dimension |
n | column dimension |
DenseMatrix | ( | const Field & | F, |
size_t | m, | ||
size_t | n, | ||
const RandIter & | iter | ||
) | [inline] |
Constructor of a m by n matrix with entries created by a random iterator.
F | the field of entries; passed so that arithmetic may be done on elements. |
m | row dimension |
n | column dimension |
iter | random iterator |
DenseMatrix | ( | const Field & | F, |
VectorStream< StreamVector > & | stream | ||
) | [inline] |
Constructor using a finite vector stream (stream of the rows).
F | The field of entries; passed so that arithmetic may be done on elements. |
stream | A vector stream to use as a source of vectors for this matrix |
DenseMatrix | ( | MatrixStream< Field > & | ms | ) | [inline] |
Constructor from a MatrixStream.
ms | A matrix stream properly initialized |
DenseMatrix | ( | const Field & | F, |
DenseMatrixBase< Element > & | Mat | ||
) | [inline] |
Constructor from a DenseMatrixBase.
Copies all matrix data.
F | Field over which this matrix' arithmetic will be. |
M | This will contain a complete copy of DenseMatrixBase M. |
size_t rowdim | ( | ) | const [inline] |
Get the number of rows in the matrix.
Reimplemented from DenseMatrixBase< _Field::Element >.
size_t coldim | ( | ) | const [inline] |
Get the number of columns in the matrix.
Reimplemented from DenseMatrixBase< _Field::Element >.
const Field& field | ( | ) | const [inline] |
Retrieve the field over which this matrix is defined.
std::istream& read | ( | std::istream & | is | ) | [inline] |
Read the matrix from an input stream.
is | Input stream from which to read |
std::ostream& write | ( | std::ostream & | os = std::cout | ) | const [inline] |
Write the matrix to an output stream.
os | Output stream to which to write |
Vect1 & apply | ( | Vect1 & | y, |
const Vect2 & | x | ||
) | const |
Generic matrix-vector apply.
This version of apply allows use of arbitrary input and output vector types.
[out] | y | Output vector |
[in] | x | Input vector |
Vect1& applyIn | ( | Vect1 & | y | ) | const [inline] |
Generic in-place apply.
. This version of in-place apply allows use of an arbitrary vector type. Because it performs allocation and copying, it is not recommended for general use.
y | Input vector |
Vect1 & applyTranspose | ( | Vect1 & | y, |
const Vect2 & | x | ||
) | const |
Generic matrix-vector transpose apply.
. This version of applyTranspose allows use of arbitrary input and output vector types
y | Output vector |
x | Input vector |
Vect& applyTransposeIn | ( | Vect & | y | ) | const [inline] |
Generic in-place transpose apply.
. This version of in-place transpose apply allows use of an arbitrary vector type. Because it performs allocation and copying, it is not recommended for general use.
y | Input vector |
Element* FullIterator | ( | ) | const [inline, inherited] |
Get a pointer on the storage of the elements.
Resize the matrix to the given dimensions.
The state of the matrix's entries after a call to this method is undefined
m | Number of rows |
n | Number of columns |
val |
std::istream& read | ( | std::istream & | file, |
const Field & | F | ||
) | [inherited] |
Read the matrix from an input stream.
The stream is in SMS or DENSE format
file | Input stream from which to read |
F | Field over which to read |
std::ostream& write | ( | std::ostream & | os, |
const Field & | F, | ||
bool | mapleFormat = true |
||
) | const [inherited] |
Write the matrix to an output stream.
os | Output stream to which to write |
F | Field over which to write |
mapleFormat | write in Maple format ? |
std::ostream& write | ( | std::ostream & | os, |
bool | mapleFormat = true |
||
) | const [inherited] |
Write brutally the matrix to an output stream.
This a raw version of write(os,F)
(no field is given).
os | Output stream to which to write |
mapleFormat | write in maple format ? |
void setEntry | ( | size_t | i, |
size_t | j, | ||
const Element & | a_ij | ||
) | [inline, inherited] |
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 | ||
) | [inline, inherited] |
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 [inline, inherited] |
Get a read-only reference to the entry in the (i, j) position.
i | Row index |
j | Column index |
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 |
Row operator[] | ( | size_t | i | ) | [inline, inherited] |
Retrieve a reference to a row.
Since rows may also be indexed, this allows A[i][j] notation to be used.
i | Row index |
ConstRow operator[] | ( | size_t | i | ) | const [inline, inherited] |
Retrieve a reference to a row.
Since rows may also be indexed, this allows A[i][j] notation to be used.
i | Row index |
Vector& columnDensity | ( | Vector & | v | ) | const [inline, inherited] |
Compute column density.
v |