linbox  1
Public Types | Public Member Functions | Protected Attributes
DenseSubmatrix< _Element > Class Template Reference

#include <dense-submatrix.h>

Inherited by BlasMatrix< _Element >.

List of all members.

Public Types

typedef DenseMatrixBase
< Element >::RowIterator 
RowIterator
 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 >::ColIterator 
ColIterator
 The columns iterator gives the columns of the matrix in ascending order. Dereferencing the iterator yields a column vector in dense format.

Public Member Functions

 DenseSubmatrix (DenseMatrixBase< Element > &M, size_t row, size_t col, size_t rowdim, size_t coldim)
 DenseSubmatrix (DenseMatrixBase< Element > &M)
 DenseSubmatrix (const DenseSubmatrix< Element > &SM, size_t row, size_t col, size_t rowdim, size_t coldim)
 DenseSubmatrix (const DenseSubmatrix< Element > &SM)
DenseSubmatrixoperator= (const DenseSubmatrix< Element > &SM)
size_t rowdim () const
size_t coldim () const
template<class Field >
std::istream & read (std::istream &file, const Field &field)
template<class Field >
std::ostream & write (std::ostream &os, const Field &field, bool mapleFormat=false) 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)

Protected Attributes

DenseMatrixBase< Element > * _M

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 ( 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
DenseSubmatrix ( DenseMatrixBase< Element > &  M)

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
DenseSubmatrix ( const DenseSubmatrix< Element > &  SM)

Copy constructor

Parameters:
_MSubmatrix to copy

Member Function Documentation

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

Assignment operator Assign the given submatrix to this one

Parameters:
_MSubmatrix 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 >, 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 >, 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
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 
) [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

Member Data Documentation

DenseMatrixBase<Element>* _M [protected]

Retrieve a reference to a row

Parameters:
iRow index

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