linbox
1
|
Blackbox interface to dense matrix representation. More...
#include <dense.h>
Public Types | |
typedef DenseMatrixBase < typename _Field::Element > ::RawIterator | RawIterator |
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 Subvector< typename Rep::iterator, typename Rep::const_iterator > | Row |
typedef Subvector< typename Rep::const_iterator > | ConstRow |
typedef Subvector< Subiterator < typename Rep::iterator > > | Col |
typedef Subvector< Subiterator < typename Rep::const_iterator > > | ConstCol |
typedef Col | Column |
typedef ConstCol | ConstColumn |
Public Member Functions | |
DenseMatrix (const Field &F, size_t m, size_t n) | |
template<class RandIter > | |
DenseMatrix (const Field &F, size_t m, size_t n, const RandIter &iter) | |
template<class StreamVector > | |
DenseMatrix (const Field &F, VectorStream< StreamVector > &stream) | |
DenseMatrix (MatrixStream< Field > &ms) | |
DenseMatrix (const Field &F, DenseMatrixBase< Element > &M) | |
DenseMatrix (const DenseMatrix &M) | |
Copies { all} matrix data. | |
DenseMatrix< Field > & | operator= (const DenseMatrix< Field > &M) |
size_t | rowdim () const |
size_t | coldim () const |
const Field & | field () const |
std::istream & | read (std::istream &is) |
std::ostream & | write (std::ostream &os=std::cout) const |
template<class Vect1 , class Vect2 > | |
Vect1 & | apply (Vect1 &y, const Vect2 &x) const |
template<class Vect1 > | |
Vect1 & | applyIn (Vect1 &y) const |
template<class Vect1 , class Vect2 > | |
Vect1 & | applyTranspose (Vect1 &y, const Vect2 &x) const |
template<class Vect > | |
Vect & | applyTransposeIn (Vect &y) const |
![]() | |
DenseMatrixBase (size_t m, size_t n) | |
DenseMatrixBase (MatrixStream< Field > &ms) | |
Element * | FullIterator () const |
void | resize (size_t m, size_t n, const Element &val=Element()) |
std::istream & | read (std::istream &file, const Field &F) |
std::ostream & | write (std::ostream &os, const Field &F) const |
void | setEntry (size_t i, size_t j, const Element &a_ij) |
Element & | refEntry (size_t i, size_t j) |
const Element & | getEntry (size_t i, size_t j) const |
Element & | getEntry (Element &x, size_t i, size_t j) const |
RowIterator | rowBegin () |
ConstRowIterator | rowBegin () const |
RowIterator | rowEnd () |
ConstRowIterator | rowEnd () const |
ColIterator | colBegin () |
ConstColIterator | colBegin () const |
ColIterator | colEnd () |
ConstColIterator | colEnd () const |
RawIterator | rawBegin () |
ConstRawIterator | rawBegin () const |
RawIterator | rawEnd () |
ConstRawIterator | rawEnd () const |
RawIndexedIterator | rawIndexedBegin () |
ConstRawIndexedIterator | rawIndexedBegin () const |
RawIndexedIterator | rawIndexedEnd () |
ConstRawIndexedIterator | rawIndexedEnd () const |
Row | operator[] (size_t i) |
ConstRow | operator[] (size_t i) const |
Vector & | columnDensity (Vector &v) const |
Additional Inherited Members | |
std::vector< Element > | _rep |
size_t | _rows |
size_t | _cols |
Element * | _ptr |
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 |
|
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 |
|
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 |
|
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 |
|
inline |
Constructor from a MatrixStream
ms | A matrix stream properly initialized |
|
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. |
|
inline |
Assignment operator makes a complete copy.
|
inline |
Get the number of rows in the matrix
Reimplemented from DenseMatrixBase< _Field::Element >.
|
inline |
Get the number of columns in the matrix
Reimplemented from DenseMatrixBase< _Field::Element >.
|
inline |
Retrieve the field over which this matrix is defined
|
inline |
Read the matrix from an input stream
file | Input stream from which to read |
|
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 y = A * x. This version of apply allows use of arbitrary input and output vector types.
y | Output vector |
x | Input vector |
|
inline |
Generic in-place apply y = A * y. 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 y = A^T * x This version of applyTranspose allows use of arbitrary input and output vector types
y | Output vector |
x | Input vector |
|
inline |
Generic in-place transpose apply y = A^T * y 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 |