linbox  1
Public Types | Public Member Functions
DenseMatrix< _Field > Class Template Reference

Blackbox interface to dense matrix representation. More...

#include <dense.h>

Inheritance diagram for DenseMatrix< _Field >:
BlackboxInterface DenseMatrixBase< _Field::Element >

List of all members.

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.

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

Detailed Description

template<class _Field>
class LinBox::DenseMatrix< _Field >

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.

Parameters:
_Fielda LinBox field class

Constructor & Destructor Documentation

DenseMatrix ( const Field &  F,
size_t  m,
size_t  n 
) [inline]

Constructor of a m by n matrix with initial entries which are the default constructor value of the field's element type.

Parameters:
Fthe field of entries; passed so that arithmetic may be done on elements.
mrow dimension
ncolumn dimension
DenseMatrix ( const Field &  F,
size_t  m,
size_t  n,
const RandIter &  iter 
) [inline]

Constructor of a m by n matrix with entries created by a random iterator.

Parameters:
Fthe field of entries; passed so that arithmetic may be done on elements.
mrow dimension
ncolumn dimension iter, random iterator
DenseMatrix ( const Field &  F,
VectorStream< StreamVector > &  stream 
) [inline]

Constructor using a finite vector stream (stream of the rows).

Parameters:
FThe field of entries; passed so that arithmetic may be done on elements.
streamA vector stream to use as a source of vectors for this matrix
DenseMatrix ( MatrixStream< Field > &  ms) [inline]

Constructor from a MatrixStream

Parameters:
msA matrix stream properly initialized
DenseMatrix ( const Field &  F,
DenseMatrixBase< Element > &  M 
) [inline]

Constructor from a DenseMatrixBase. Copies all matrix data.

Parameters:
FField over which this matrix' arithmetic will be.
MThis will contain a complete copy of DenseMatrixBase} M.

Member Function Documentation

DenseMatrix<Field>& operator= ( const DenseMatrix< Field > &  M) [inline]

Assignment operator makes a complete copy.

size_t rowdim ( ) const [inline]

Get the number of rows in the matrix

Returns:
Number of rows in matrix

Reimplemented from DenseMatrixBase< _Field::Element >.

size_t coldim ( ) const [inline]

Get the number of columns in the matrix

Returns:
Number of columns in matrix

Reimplemented from DenseMatrixBase< _Field::Element >.

const Field& field ( ) const [inline]

Retrieve the field over which this matrix is defined

Returns:
Reference to the underlying field
std::istream& read ( std::istream &  is) [inline]

Read the matrix from an input stream

Parameters:
fileInput stream from which to read
std::ostream& write ( std::ostream &  os = std::cout) const [inline]

Write the matrix to an output stream

Parameters:
osOutput 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.

Parameters:
yOutput vector
xInput vector
Returns:
Reference to output vector
Vect1& applyIn ( Vect1 &  y) const [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.

Parameters:
yInput vector
Returns:
Reference to output 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

Parameters:
yOutput vector
xInput vector
Returns:
Reference to output vector
Vect& applyTransposeIn ( Vect &  y) const [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.

Parameters:
yInput vector
Returns:
Reference to output vector

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