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

DenseMatrixBase Class Template Reference
[linbox/matrix]

#include <dense.h>

List of all members.


Detailed Description

template<class _Element>
class LinBox::DenseMatrixBase< _Element >

Blackbox dense matrix template. This is a class of dense matrices templatized by the entry type, the Element type of some field. The matrix is stored as a one dimensional STL vector of the elements, by rows. The interface provides for iteration over rows and over columns.

The class LinBox::Dense builds on this base.

Currently, only dense vectors are supported when doing matrix-vector applies.


Column of rows iterator

The column of rows iterator traverses the rows of the matrix in ascending order. Dereferencing the iterator yields a row vector in dense format

typedef Subvector< typename
Rep::iterator, typename Rep::const_iterator > 
Row
typedef Subvector< typename
Rep::const_iterator > 
ConstRow
RowIterator rowBegin ()
RowIterator rowEnd ()
ConstRowIterator rowBegin () const
ConstRowIterator rowEnd () const

Row of columns iterator

The row of columns iterator traverses the columns of the matrix in ascending order. Dereferencing the iterator yields a column vector in dense format

typedef Subvector< Subiterator<
typename Rep::iterator > > 
Col
typedef Subvector< Subiterator<
typename Rep::const_iterator > > 
ConstCol
typedef Col Column
typedef ConstCol ConstColumn
typedef Rep::iterator RawIterator
typedef Rep::const_iterator ConstRawIterator
ColIterator colBegin ()
ColIterator colEnd ()
ConstColIterator colBegin () const
ConstColIterator colEnd () const
RawIterator rawBegin ()
RawIterator rawEnd ()
ConstRawIterator rawBegin () const
ConstRawIterator rawEnd () const
RawIndexedIterator rawIndexedBegin ()
RawIndexedIterator rawIndexedEnd ()
ConstRawIndexedIterator rawIndexedBegin () const
ConstRawIndexedIterator rawIndexedEnd () const
Row operator[] (size_t i)
ConstRow operator[] (size_t i) const
template<class Vector> Vector & columnDensity (Vector &v) const
std::vector< Element > _rep
size_t _rows
size_t _cols
Element * _ptr

Public Types

typedef _Element Element
typedef RawVector< Element
>::Dense 
Rep
typedef DenseMatrixBase< _Element > Self_t

Public Methods

 DenseMatrixBase ()
 DenseMatrixBase (size_t m, size_t n)
 DenseMatrixBase (const DenseMatrixBase &M)
DenseMatrixBase & operator= (const DenseMatrixBase &M)
Element * FullIterator () const
size_t rowdim () const
size_t coldim () const
void resize (size_t m, size_t n, const Element &val=Element())
template<class Field> std::istream & read (std::istream &file, const Field &F)
template<class Field> 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


Member Typedef Documentation

typedef Subvector<Subiterator<typename Rep::iterator> > Col
 

typedef Col Column
 

typedef Subvector<Subiterator<typename Rep::const_iterator> > ConstCol
 

typedef ConstCol ConstColumn
 

typedef Rep::const_iterator ConstRawIterator
 

typedef Subvector<typename Rep::const_iterator> ConstRow
 

typedef _Element Element
 

Reimplemented in DenseMatrix, DenseMatrix< Field >, DenseMatrix< UnparametricField< Ring > >, and DenseMatrix< Domain >.

typedef Rep::iterator 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 RawVector<Element>::Dense Rep
 

typedef Subvector<typename Rep::iterator, typename Rep::const_iterator> Row
 

typedef DenseMatrixBase<_Element> Self_t
 

Reimplemented in DenseMatrix, DenseMatrix< Field >, DenseMatrix< UnparametricField< Ring > >, and DenseMatrix< Domain >.


Constructor & Destructor Documentation

DenseMatrixBase (    )  [inline]
 

DenseMatrixBase (  size_t    m,
size_t    n
)  [inline]
 

Constructor.

Parameters:
m  row dimension
n  column dimension

DenseMatrixBase (  const DenseMatrixBase< _Element > &    M )  [inline]
 


Member Function Documentation

ConstColIterator colBegin (    ) 
 

ColIterator colBegin (    ) 
 

size_t coldim (    )  const [inline]
 

Get the number of columns in the matrix

Returns:
Number of columns in matrix

Reimplemented in DenseMatrix, DenseMatrix< Field >, DenseMatrix< UnparametricField< Ring > >, and DenseMatrix< Domain >.

ConstColIterator colEnd (    ) 
 

ColIterator colEnd (    ) 
 

Vector& columnDensity (  Vector &    v )  const [inline]
 

Compute column density

Element* FullIterator (    )  const [inline]
 

Get a pointer on the storage of the elements

Returns:
a pointer on Elements /todo What is this?

Element& getEntry (  Element &    x,
size_t    i,
size_t    j
)  const [inline]
 

Copy the (i, j) entry into x, and return a reference to x. This form is more in the Linbox style and is provided for interface compatibility with other parts of the library

Parameters:
x  Element in which to store result
i  Row index
j  Column index
Returns:
Reference to x

const Element& getEntry (  size_t    i,
size_t    j
)  const [inline]
 

Get a read-only reference to the entry in the (i, j) position.

Parameters:
i  Row index
j  Column index
Returns:
Const reference to matrix entry

DenseMatrixBase& operator= (  const DenseMatrixBase< _Element > &    M )  [inline]
 

ConstRow operator[] (  size_t    i )  const [inline]
 

Row operator[] (  size_t    i )  [inline]
 

Retrieve a reference to a row. Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters:
i  Row index

ConstRawIterator rawBegin (    ) 
 

RawIterator rawBegin (    ) 
 

ConstRawIterator rawEnd (    ) 
 

RawIterator rawEnd (    ) 
 

ConstRawIndexedIterator rawIndexedBegin (    ) 
 

RawIndexedIterator rawIndexedBegin (    ) 
 

ConstRawIndexedIterator rawIndexedEnd (    ) 
 

RawIndexedIterator rawIndexedEnd (    ) 
 

std::istream& read (  std::istream &    file,
const Field &    F
) 
 

Read the matrix from an input stream

Parameters:
file  Input stream from which to read
F  Field over which to read

Element& refEntry (  size_t    i,
size_t    j
)  [inline]
 

Get a writeable reference to the entry in the (i, j) position.

Parameters:
i  Row index of entry
j  Column index of entry
Returns:
Reference to matrix entry

void resize (  size_t    m,
size_t    n,
const Element &    val = Element()
)  [inline]
 

Resize the matrix to the given dimensions The state of the matrix's entries after a call to this method is undefined

Parameters:
m  Number of rows
n  Number of columns

ConstRowIterator rowBegin (    ) 
 

RowIterator rowBegin (    ) 
 

size_t rowdim (    )  const [inline]
 

Get the number of rows in the matrix

Returns:
Number of rows in matrix

Reimplemented in DenseMatrix, DenseMatrix< Field >, DenseMatrix< UnparametricField< Ring > >, and DenseMatrix< Domain >.

ConstRowIterator rowEnd (    ) 
 

RowIterator rowEnd (    ) 
 

void setEntry (  size_t    i,
size_t    j,
const Element &    a_ij
)  [inline]
 

Set the entry at the (i, j) position to a_ij.

Parameters:
i  Row number, 0...rowdim () - 1
j  Column number 0...coldim () - 1
a_ij  Element to set

std::ostream& write (  std::ostream &    os,
const Field &    F
)  const
 

Write the matrix to an output stream

Parameters:
os  Output stream to which to write
F  Field over which to write


Member Data Documentation

size_t _cols [protected]
 

Element* _ptr [protected]
 

std::vector<Element> _rep [protected]
 

size_t _rows [protected]
 


Generated on Mon Jun 20 09:16:53 2005 for linbox by doxygen1.2.18