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

TransposeMatrix Class Template Reference

#include <transpose.h>

List of all members.


Detailed Description

template<class Matrix, class Trait = typename MatrixTraits<Matrix>::MatrixCategory>
class LinBox::TransposeMatrix< Matrix, Trait >

Matrix transpose

This class takes a matrix meeting the @ref{DenseMatrixBase} archetype and switches the row and column iterators, giving the transpose of the original matrix. It is generic with respect to the matrix given.

If the matrix given has limited iterators, then its transpose will have limited iterators as well. In particular, if the matrix given has only row iterators, then the transpose object will have only column iterators, and vice versa.

This class differs from @ref{Transpose} in that it constructs a full matrix representation, with row and/or column iterators. It does not include any logic for matrix-vector products, and does not meet the @ref{BlackboxArchetype} interface. Nor does it make such assumptions about the matrix given.

This class gives a constant matrix as output. It provides no iterators for modification of the data in the matrix.

The input/output functionality of this class passes requests directly through to the underlying matrix. In particular, the output will be the transpose of the matrix expected and the input will expect the transpose of the matrix given. Thus, it is not recommended to use TransposeMatrix for reading and writing matrices, except for testing purposes.


Public Types

typedef Matrix::Element Element
typedef Matrix::ColIterator RowIterator
typedef Matrix::RowIterator ColIterator
typedef Matrix::RawIterator RawIterator
typedef Matrix::RawIndexedIterator RawIndexedIterator
typedef Matrix::ConstColIterator ConstRowIterator
typedef Matrix::ConstRowIterator ConstColIterator
typedef Matrix::ConstRawIterator ConstRawIterator
typedef Matrix::ConstRawIndexedIterator ConstRawIndexedIterator
typedef Matrix::Row Column
typedef Matrix::Row Col
typedef Matrix::Col Row

Public Methods

 TransposeMatrix (Matrix &A)
 TransposeMatrix (const TransposeMatrix &M)
size_t rowdim () const
size_t coldim () const
Matrix I/O
template<class Field> std::ostream & write (std::ostream &stream, const Field &F) const
Access to matrix elements
Matrix I O void setEntry (size_t i, size_t j, const Element &a_ij)
ElementrefEntry (size_t i, size_t j)
const ElementgetEntry (size_t i, size_t j) const
ElementgetEntry (Element &x, size_t i, size_t j) const
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

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

ColIterator colBegin ()
ColIterator colEnd ()
ConstColIterator colBegin () const
ConstColIterator colEnd () const
Raw iterator
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.

RawIterator rawBegin ()
RawIterator rawEnd ()
ConstRawIterator rawBegin () const
ConstRawIterator rawEnd () const
Raw Indexed iterator
Like the raw iterator, the indexed iterator is a method for accessing all entries in the matrix in some unspecified order. At each position of the the indexed iterator, it also provides the row and column indices of the currently referenced entry. This is provided through it's rowIndex() and colIndex() functions.

RawIndexedIterator rawIndexedBegin ()
RawIndexedIterator rawIndexedEnd ()
ConstRawIndexedIterator rawIndexedBegin () const
ConstRawIndexedIterator rawIndexedEnd () const

Protected Attributes

Matrix & _A


Member Typedef Documentation

typedef Matrix::Row Col
 

typedef Matrix::RowIterator ColIterator
 

typedef Matrix::Row Column
 

typedef Matrix::ConstRowIterator ConstColIterator
 

typedef Matrix::ConstRawIndexedIterator ConstRawIndexedIterator
 

typedef Matrix::ConstRawIterator ConstRawIterator
 

typedef Matrix::ConstColIterator ConstRowIterator
 

typedef Matrix::Element Element
 

typedef Matrix::RawIndexedIterator RawIndexedIterator
 

typedef Matrix::RawIterator RawIterator
 

typedef Matrix::Col Row
 

typedef Matrix::ColIterator RowIterator
 


Constructor & Destructor Documentation

TransposeMatrix Matrix &    A [inline]
 

Constructor.

Parameters:
A  Underlying matrix of which to construct the transpose

TransposeMatrix const TransposeMatrix< Matrix, Trait > &    M [inline]
 

Copy constructor


Member Function Documentation

ConstColIterator colBegin   const [inline]
 

ColIterator colBegin   [inline]
 

size_t coldim   const [inline]
 

Get the number of columns in the matrix

Returns:
Number of columns in matrix

ConstColIterator colEnd   const [inline]
 

ColIterator colEnd   [inline]
 

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

ConstRawIterator rawBegin   const [inline]
 

RawIterator rawBegin   [inline]
 

ConstRawIterator rawEnd   const [inline]
 

RawIterator rawEnd   [inline]
 

ConstRawIndexedIterator rawIndexedBegin   const [inline]
 

RawIndexedIterator rawIndexedBegin   [inline]
 

ConstRawIndexedIterator rawIndexedEnd   const [inline]
 

RawIndexedIterator rawIndexedEnd   [inline]
 

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

ConstRowIterator rowBegin   const [inline]
 

RowIterator rowBegin   [inline]
 

size_t rowdim   const [inline]
 

Get the number of rows in the matrix

Returns:
Number of rows in matrix

ConstRowIterator rowEnd   const [inline]
 

RowIterator rowEnd   [inline]
 

Matrix I O 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 &    stream,
const Field   F
const [inline]
 

Write a matrix to an output stream

Parameters:
stream  Stream to which to write the matrix
Returns:
Reference to stream


Member Data Documentation

Matrix& _A [protected]
 


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