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

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: