linbox
|
LinBox dense matrix template. More...
#include <dense.h>
Data Structures | |
class | ColIterator |
Col Iterator. More... | |
class | ConstColIterator |
Const Col Iterator. More... | |
class | ConstRawIndexedIterator |
Const Raw Indexed Iterator. More... | |
class | ConstRowIterator |
Const Row Iterator. More... | |
class | RawIndexedIterator |
Raw Indexed Iterator. More... | |
class | RowIterator |
Row Iterator. More... | |
Public Types | |
typedef _Element | Element |
Element type. | |
typedef RawVector< Element >::Dense | Rep |
No doc. | |
typedef DenseMatrixBase< _Element > | Self_t |
Self type. | |
Public Member Functions | |
DenseMatrixBase () | |
NULL constructor. | |
DenseMatrixBase (size_t m, size_t n) | |
Constructor. | |
DenseMatrixBase (std::vector< Element > &data, size_t m, size_t n) | |
Constructor. | |
template<class Field > | |
DenseMatrixBase (MatrixStream< Field > &ms) | |
Constructor from a matrix stream. | |
DenseMatrixBase (const DenseMatrixBase &Mat) | |
copy constructor. | |
DenseMatrixBase & | operator= (const DenseMatrixBase &Mat) |
destructor. | |
Element * | FullIterator () const |
Get a pointer on the storage of the elements. | |
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, const Element &val=Element()) |
Resize the matrix to the given dimensions. | |
template<class Field > | |
std::istream & | read (std::istream &file, const Field &F) |
Read the matrix from an input stream. | |
template<class Field > | |
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. | |
template<class Vector > | |
Vector & | columnDensity (Vector &v) const |
Compute column density. | |
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 () |
RawIndexedIterator | rawIndexedEnd () |
ConstRawIndexedIterator | rawIndexedBegin () const |
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 () |
RowIterator | rowEnd () |
ConstRowIterator | rowBegin () const |
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 () |
ColIterator | colEnd () |
ConstColIterator | colBegin () const |
ConstColIterator | colEnd () const |
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. | |
typedef Rep::iterator | RawIterator |
typedef Rep::const_iterator | ConstRawIterator |
RawIterator | rawBegin () |
RawIterator | rawEnd () |
ConstRawIterator | rawBegin () const |
ConstRawIterator | rawEnd () const |
LinBox dense matrix template.
This is a class of dense matrices templatized by the entry type, the Element
type of some field. The matrix is stored as a one dimensional STL std::vector
of the elements, by rows. The interface provides for iteration over rows and over columns.
The class LinBox::DenseMatrix
builds on this base.
Currently, only dense vectors are supported when doing matrix-vector applies.
DenseMatrixBase | ( | size_t | m, |
size_t | n | ||
) | [inline] |
Constructor.
m | row dimension |
n | column dimension |
DenseMatrixBase | ( | std::vector< Element > & | data, |
size_t | m, | ||
size_t | n | ||
) | [inline] |
Constructor.
data | vector to take data from (such that A[i,j] == data[i*n+j] ) |
m | row dimension |
n | column dimension |
DenseMatrixBase | ( | MatrixStream< Field > & | ms | ) |
Constructor from a matrix stream.
ms | matrix stream |
DenseMatrixBase | ( | const DenseMatrixBase< _Element > & | Mat | ) | [inline] |
copy constructor.
M | Dense matrix to be copied. |
DenseMatrixBase& operator= | ( | const DenseMatrixBase< _Element > & | Mat | ) | [inline] |
destructor.
copy operator.
M | matrix to be copied. |
Element* FullIterator | ( | ) | const [inline] |
Get a pointer on the storage of the elements.
size_t rowdim | ( | ) | const [inline] |
Get the number of rows in the matrix.
Reimplemented in DenseMatrix< _Field >, DenseMatrix< Field >, and DenseMatrix< Domain >.
size_t coldim | ( | ) | const [inline] |
Get the number of columns in the matrix.
Reimplemented in DenseMatrix< _Field >, DenseMatrix< Field >, and DenseMatrix< Domain >.
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 | ||
) |
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 |
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 |
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] |
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] |
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] |
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] |
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] |
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] |
Compute column density.
v |