Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SparseMatrix Class Template Reference
[linbox/blackbox]

#include <sparse.h>

Inheritance diagram for SparseMatrix:

BlackboxInterface SparseMatrixBase List of all members.

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.


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)
 ~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


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:
F Field over which entries exist
m Row dimension
n Column dimension

SparseMatrix const Field &  F,
VectStream &  stream
[inline]
 

Constructor from a vector stream

Parameters:
F Field over which entries exist
stream Stream with which to generate row vectors

SparseMatrix MatrixStream< Field > &  ms  )  [inline]
 

Constructor from a MatrixStream

Parameters:
ms A matrix stream properly initialized

SparseMatrix const SparseMatrix< Field, Row > &  B  )  [inline]
 

Copy 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:
x input 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:
x input vector

size_t rowdim  )  const [inline]
 

Retreive row dimensions of Sparsemat matrix.

Returns:
integer number of rows of SparseMatrix0Base matrix.

Reimplemented from SparseMatrixBase.

size_t coldim  )  const [inline]
 

Retreive column dimensions of Sparsemat matrix.

Returns:
integer number of columns of SparseMatrix0Base matrix.

Reimplemented from SparseMatrixBase.

std::istream& read std::istream &  is,
FileFormatTag  format = FORMAT_DETECT
[inline]
 

Read the matrix from a stream in the given format

Parameters:
is Input stream from which to read the matrix
format Format of input matrix
Returns:
Reference to input stream

Reimplemented from SparseMatrixBase.

std::ostream& write std::ostream &  os,
FileFormatTag  format = FORMAT_PRETTY
const [inline]
 

Write the matrix to a stream in the given format

Parameters:
os Output stream to which to write the matrix
format Format of output
Returns:
Reference to output stream

Reimplemented from SparseMatrixBase.

const Field& field  )  const [inline]
 

Access to the base field


The documentation for this class was generated from the following file:
Generated on Thu Feb 8 22:32:58 2007 for linbox by doxygen 1.3.4