linbox  1
Public Member Functions
SparseMatrix< _Field, _Row > Class Template Reference

vector of sparse rows. More...

#include <sparse.h>

Inheritance diagram for SparseMatrix< _Field, _Row >:
BlackboxInterface SparseMatrixBase< _Field::Element, _Row >

List of all members.

Public Member Functions

 SparseMatrix (const Field &F, size_t m=0, size_t n=0)
template<class VectStream >
 SparseMatrix (const Field &F, VectStream &stream)
 SparseMatrix (MatrixStream< Field > &ms)
 SparseMatrix (const SparseMatrix< Field, Row > &B)
template<class VectorType >
 SparseMatrix (const SparseMatrix< Field, VectorType > &B)
 ~SparseMatrix ()
template<class OutVector , class InVector >
OutVector & apply (OutVector &y, const InVector &x) const
template<class OutVector , class InVector >
OutVector & applyTranspose (OutVector &y, const InVector &x) const
size_t rowdim () const
size_t coldim () const
std::istream & read (std::istream &is, FileFormatTag format=FORMAT_DETECT)
std::ostream & write (std::ostream &os, FileFormatTag format=FORMAT_PRETTY) const
const Field & field () const
- Public Member Functions inherited from SparseMatrixBase< _Field::Element, _Row >
 SparseMatrixBase (size_t m, size_t n)
 SparseMatrixBase (MatrixStream< Field > &ms)
 SparseMatrixBase (const SparseMatrixBase< Element, Row, Trait > &A)
 SparseMatrixBase (const SparseMatrixBase< Element, VectorType, Trait > &A)
 ~SparseMatrixBase ()
size_t size () const
std::istream & read (std::istream &is, const Field &F, FileFormatTag format=FORMAT_DETECT)
std::ostream & write (std::ostream &os, const Field &F, FileFormatTag format=FORMAT_PRETTY) const
void setEntry (size_t i, size_t j, const Element &value)
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
RawIterator rawBegin ()
ConstRawIterator rawBegin () const
RawIterator rawEnd ()
ConstRawIterator rawEnd () const
RowIterator rowBegin ()
ConstRowIterator rowBegin () const
RowIterator rowEnd ()
ConstRowIterator rowEnd () const
RawIndexedIterator rawIndexedBegin ()
ConstRawIndexedIterator rawIndexedBegin () const
RawIndexedIterator rawIndexedEnd ()
ConstRawIndexedIterator rawIndexedEnd () const
Row & getRow (size_t i)
Row & operator[] (size_t i)
ConstRow & operator[] (size_t i) const
Vector & columnDensity (Vector &v) const
SparseMatrixBasetranspose (SparseMatrixBase &AT) const

Additional Inherited Members

typedef Rep::iterator RowIterator
typedef Rep::const_iterator ConstRowIterator
Rep _A
size_t _m
size_t _n

Detailed Description

template<class _Field, class _Row = typename LinBox::Vector<_Field>::Sparse>
class LinBox::SparseMatrix< _Field, _Row >

vector of sparse rows.

This is a generic black box for a sparse matrix. It inherits LinBox::SparseMatrixBase, which implements all of the underlying accessors and iterators.


Constructor & Destructor Documentation

SparseMatrix ( const Field &  F,
size_t  m = 0,
size_t  n = 0 
)
inline

Constructor. Builds a zero m x n matrix Note: the copy constructor and operator= will work as intended because of STL's container design

Parameters:
FField over which entries exist
mRow dimension
nColumn dimension
SparseMatrix ( const Field &  F,
VectStream &  stream 
)
inline

Constructor from a vector stream

Parameters:
FField over which entries exist
streamStream with which to generate row vectors
SparseMatrix ( MatrixStream< Field > &  ms)
inline

Constructor from a MatrixStream

Parameters:
msA matrix stream properly initialized
SparseMatrix ( const SparseMatrix< Field, Row > &  B)
inline

Copy constructor

SparseMatrix ( const SparseMatrix< Field, VectorType > &  B)
inline

Row type Converter constructor

~SparseMatrix ( )
inline

Destructor.


Member Function Documentation

OutVector& apply ( OutVector &  y,
const InVector &  x 
) const
inline

Matrix-vector product y = A x.

Returns:
reference to output vector y
Parameters:
xinput vector
OutVector& applyTranspose ( OutVector &  y,
const InVector &  x 
) const
inline

Transpose matrix-vector product y = A^T x.

Returns:
reference to output vector y
Parameters:
xinput vector
size_t rowdim ( ) const
inline

Retreive row dimensions of Sparsemat matrix.

Returns:
integer number of rows of SparseMatrix0Base matrix.

Reimplemented from SparseMatrixBase< _Field::Element, _Row >.

size_t coldim ( ) const
inline

Retreive column dimensions of Sparsemat matrix.

Returns:
integer number of columns of SparseMatrix0Base matrix.

Reimplemented from SparseMatrixBase< _Field::Element, _Row >.

std::istream& read ( std::istream &  is,
FileFormatTag  format = FORMAT_DETECT 
)
inline

Read the matrix from a stream in the given format

Parameters:
isInput stream from which to read the matrix
formatFormat of input matrix
Returns:
Reference to input stream

Reimplemented from SparseMatrixBase< _Field::Element, _Row >.

std::ostream& write ( std::ostream &  os,
FileFormatTag  format = FORMAT_PRETTY 
) const
inline

Write the matrix to a stream in the given format

Parameters:
osOutput stream to which to write the matrix
formatFormat of output
Returns:
Reference to output stream

Reimplemented from SparseMatrixBase< _Field::Element, _Row >.

const Field& field ( ) const
inline

Access to the base field


The documentation for this class was generated from the following file: