linbox
Data Structures | Public Types | Public Member Functions
DenseSubmatrix< _Element > Class Template Reference

Submatrix of a dense matrix More...

#include <dense-submatrix.h>

Inheritance diagram for DenseSubmatrix< _Element >:

Data Structures

class  ConstRawIndexedIterator
 Raw Indexed Iterator (const version). More...
class  ConstRawIterator
 Raw Iterators (const version). More...
class  RawIndexedIterator
 Raw Indexed Iterator. More...
class  RawIterator
 Raw Iterators. More...

Public Types

typedef _Element Element
 Element type.
typedef DenseSubmatrix< _Element > Self_t
 Self type.
typedef'd Row Iterators.

The row iterator gives the rows of the matrix in ascending order.

Dereferencing the iterator yields a row vector in dense format

typedef DenseMatrixBase
< Element >::RowIterator 
RowIterator
typedef DenseMatrixBase
< Element >::ConstRowIterator 
ConstRowIterator
typedef DenseMatrixBase
< Element >::Row 
Row
typedef DenseMatrixBase
< Element >::ConstRow 
ConstRow
typedef'd Column Iterators.

The columns iterator gives the columns of the matrix in ascending order.

Dereferencing the iterator yields a column vector in dense format

typedef DenseMatrixBase
< Element >::ColIterator 
ColIterator
typedef DenseMatrixBase
< Element >::ConstColIterator 
ConstColIterator
typedef DenseMatrixBase
< Element >::Col 
Col
typedef DenseMatrixBase
< Element >::Column 
Column
typedef DenseMatrixBase
< Element >::ConstCol 
ConstCol

Public Member Functions

 DenseSubmatrix ()
 NULL constructor.
 DenseSubmatrix (DenseMatrixBase< Element > &M, size_t row, size_t col, size_t rowdim, size_t coldim)
 Constructor from an existing DenseMatrixBase and dimensions.
 DenseSubmatrix (DenseMatrixBase< Element > &M)
 Constructor from an existing DenseMatrixBase.
 DenseSubmatrix (const DenseSubmatrix< Element > &SM, size_t row, size_t col, size_t rowdim, size_t coldim)
 Constructor from an existing submatrix and dimensions.
 DenseSubmatrix (const DenseSubmatrix< Element > &SM)
 Copy constructor.
DenseSubmatrixoperator= (const DenseSubmatrix< Element > &SM)
 Assignment operator.
size_t rowdim () const
 Get the number of rows in the matrix.
size_t coldim () const
 Get the number of columns in the matrix.
template<class Field >
std::istream & read (std::istream &file, const Field &field)
 Read the matrix from an input stream.
template<class Field >
std::ostream & write (std::ostream &os, const Field &field, bool mapleFormat=false) const
 Write the matrix to an output stream.
std::ostream & write (std::ostream &os, bool mapleFormat=false) const
 Write the matrix to an output stream.
void setEntry (size_t i, size_t j, const Element &a_ij)
 Set the entry at (i, j).
ElementrefEntry (size_t i, size_t j)
 Get a writeable reference to an entry in the matrix.
const ElementgetEntry (size_t i, size_t j) const
 Get a read-only individual entry from the matrix.
ElementgetEntry (Element &x, size_t i, size_t j) const
 Get an entry and store it in the given value.
RowIterator rowBegin ()
 iterator to the begining of a row
RowIterator rowEnd ()
 iterator to the end of a row
ConstRowIterator rowBegin () const
 const iterator to the begining of a row
ConstRowIterator rowEnd () const
 const iterator to the end of a row
DenseSubmatrix< Elementtranspose (DenseMatrixBase< Element > &tM)
 Creates a transposed matrix of *this.
DenseSubmatrix< Element > & transpose (DenseSubmatrix< Element > &tA)
 Creates a transposed matrix of *this.

Detailed Description

template<class _Element>
class LinBox::DenseSubmatrix< _Element >

Submatrix of a dense matrix

This matrix type conforms to the same interface as DenseMatrixBase, except that you cannot resize it. It represents a submatrix of a dense matrix. Upon construction, one can freely manipulate the entries in the DenseSubmatrix, and the corresponding entries in the underlying DenseMatrixBase will be modified.


Constructor & Destructor Documentation

DenseSubmatrix ( ) [inline]

NULL constructor.

DenseSubmatrix ( DenseMatrixBase< Element > &  M,
size_t  row,
size_t  col,
size_t  rowdim,
size_t  coldim 
)

Constructor from an existing DenseMatrixBase and dimensions.

Parameters:
MPointer to DenseMatrixBase of which to construct submatrix
rowStarting row
colStarting column
rowdimRow dimension
coldimColumn dimension

Constructor from an existing DenseMatrixBase.

Parameters:
MPointer to DenseMatrixBase of which to construct submatrix
DenseSubmatrix ( const DenseSubmatrix< Element > &  SM,
size_t  row,
size_t  col,
size_t  rowdim,
size_t  coldim 
)

Constructor from an existing submatrix and dimensions.

Parameters:
SMConstant reference to DenseSubmatrix from which to construct submatrix
rowStarting row
colStarting column
rowdimRow dimension
coldimColumn dimension

Copy constructor.

Parameters:
SMSubmatrix to copy

Member Function Documentation

DenseSubmatrix< _Element > & operator= ( const DenseSubmatrix< Element > &  SM)

Assignment operator.

Assign the given submatrix to this one

Parameters:
SMSubmatrix to assign
Returns:
Reference to this submatrix
size_t rowdim ( ) const [inline]

Get the number of rows in the matrix.

Returns:
Number of rows in matrix

Reimplemented in BlasBlackbox< _Field >, BlasBlackbox< Modular< double > >, and BlasBlackbox< Domain >.

size_t coldim ( ) const [inline]

Get the number of columns in the matrix.

Returns:
Number of columns in matrix

Reimplemented in BlasBlackbox< _Field >, BlasBlackbox< Modular< double > >, and BlasBlackbox< Domain >.

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

Read the matrix from an input stream.

Parameters:
fileInput stream from which to read
field
std::ostream & write ( std::ostream &  os,
const Field &  field,
bool  mapleFormat = false 
) const

Write the matrix to an output stream.

Parameters:
osOutput stream to which to write
field
mapleFormatwrite in Maple(r) format ?
std::ostream & write ( std::ostream &  os,
bool  mapleFormat = false 
) const

Write the matrix to an output stream.

This a raw version of write(os,F) (no field is given).

Parameters:
osOutput stream to which to write
mapleFormatwrite in Maple(r) format ?
void setEntry ( size_t  i,
size_t  j,
const Element a_ij 
) [inline]

Set the entry at (i, j).

Parameters:
iRow number, 0...rowdim () - 1
jColumn number 0...coldim () - 1
a_ijElement to set
Element& refEntry ( size_t  i,
size_t  j 
) [inline]

Get a writeable reference to an entry in the matrix.

Parameters:
iRow index of entry
jColumn index of entry
Returns:
Reference to matrix entry
const Element& getEntry ( size_t  i,
size_t  j 
) const [inline]

Get a read-only individual entry from the matrix.

Parameters:
iRow index
jColumn index
Returns:
Const reference to matrix entry
Element& getEntry ( Element x,
size_t  i,
size_t  j 
) const [inline]

Get an entry and store it in the given value.

This form is more in the Linbox style and is provided for interface compatibility with other parts of the library

Parameters:
xElement in which to store result
iRow index
jColumn index
Returns:
Reference to x
DenseSubmatrix<Element> transpose ( DenseMatrixBase< Element > &  tM) [inline]

Creates a transposed matrix of *this.

Parameters:
[in]tM
Returns:
the transposed matrix of this.
DenseSubmatrix<Element>& transpose ( DenseSubmatrix< Element > &  tA) [inline]

Creates a transposed matrix of *this.

Returns:
the transposed matrix of this.

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