linbox
Data Structures | Public Types | Public Member Functions | Protected Attributes
Submatrix< BlasMatrix< _Field >, VectorCategories::DenseVectorTag > Class Template Reference

Specialization for BlasMatrix. More...

#include <submatrix.h>

Inherits BlasSubmatrix< _Matrix >.

Data Structures

struct  rebind
 Generic matrix-vector apply y = A * x. More...
 

Public Types

typedef MatrixEltPointer< _Matrix >::pointer pointer
 pointer type to elements
 
typedef MatrixEltPointer< const_Matrix >::pointer const_pointer
 const pointer type to elements
 
typedef _Matrix matrixType
 matrix type
 

Public Member Functions

 Submatrix (const BlasMatrix< Field > *Mat, size_t row, size_t col, size_t Rowdim, size_t Coldim)
 Constructor from an existing BlasMatrix and dimensions. More...
 
 Submatrix (const BlasMatrix< Field > &Mat, size_t row, size_t col, size_t Rowdim, size_t Coldim)
 Constructor from an existing BlasMatrix and dimensions. More...
 
 Submatrix (const Submatrix< BlasMatrix< Field > > *SM, size_t row, size_t col, size_t Rowdim, size_t Coldim)
 Constructor from an existing submatrix and dimensions. More...
 
 Submatrix (const Submatrix< BlasMatrix< Field > > &SM, size_t row, size_t col, size_t Rowdim, size_t Coldim)
 Constructor from an existing submatrix and dimensions. More...
 
size_t rowfirst () const
 get the field
 
template<class _AnyMatrix >
Self_tcopy (const _AnyMatrix &A)
 (copying data) -> works only if dimensions are the same
 
size_t rowdim () const
 Get the number of rows in the matrix. More...
 
size_t coldim () const
 Get the number of columns in the matrix. More...
 
size_t getStride () const
 Get the stride of the matrix. More...
 
const Field & field () const
 Get the field of the BlasSubMatrix. More...
 
pointer getPointer ()
  
 
std::istream & read (std::istream &file)
 Read the matrix from an input stream. More...
 
std::ostream & write (std::ostream &os, Tag::FileFormat f=Tag::FileFormat::Plain) const
 Write the matrix to an output stream. More...
 
void setEntry (size_t i, size_t j, const Element &a_ij)
 Set the entry at (i, j). More...
 
Element & refEntry (size_t i, size_t j)
 Get a writeable reference to an entry in the matrix. More...
 
const Element & getEntry (size_t i, size_t j) const
 Get a read-only individual entry from the matrix. More...
 
Element & getEntry (Element &x, size_t i, size_t j) const
 Get an entry and store it in the given value. More...
 
template<class Vector1 , class Vector2 >
Vector1 & apply (Vector1 &y, const Vector2 &x) const
 
template<class Vector1 , class Vector2 >
Vector1 & applyTranspose (Vector1 &y, const Vector2 &x) const
 

Protected Attributes

pointer _ptr
 pointer to the first elt of the submatrix
 
size_t _row
 row dimension of Submatrix
 
size_t _col
 col dimension of Submatrix
 
size_t _stride
 stride of the original matrix
 

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

using RowIterator = BlasMatrixIterator< Field, Storage, subVectorType >
 
using ConstRowIterator = BlasMatrixIterator< Field, Storage, constSubVectorType >
 
RowIterator rowBegin ()
 
ConstRowIterator rowBegin () const
 
RowIterator rowEnd ()
 
ConstRowIterator rowEnd () const
 

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

using ColIterator = BlasMatrixIterator< Field, Storage, subVectorType >
 operator[]. More...
 
using ConstColIterator = BlasMatrixIterator< Field, Storage, constSubVectorType >
 operator[]. More...
 
using IndexedIterator = BlasMatrixIndexedIterator< Field, pointer, Element >
 operator[]. More...
 
using ConstIndexedIterator = BlasMatrixIndexedIterator< Field, const_pointer, const Element >
 operator[]. More...
 
ColIterator colBegin ()
 operator[]. More...
 
ConstColIterator colBegin () const
 operator[]. More...
 
ColIterator colEnd ()
 operator[]. More...
 
ConstColIterator colEnd () const
 operator[]. More...
 
Iterator Begin ()
 operator[]. More...
 
ConstIterator Begin () const
 operator[]. More...
 
Iterator End ()
 operator[]. More...
 
ConstIterator End () const
 operator[]. More...
 
IndexedIterator IndexedBegin ()
 operator[]. More...
 
ConstIndexedIterator IndexedBegin () const
 operator[]. More...
 
IndexedIterator IndexedEnd ()
 operator[]. More...
 
ConstIndexedIterator IndexedEnd () const
 operator[]. More...
 
subVectorType operator[] (size_t i)
 operator[]. More...
 
constSubVectorType operator[] (size_t i) const
 operator[]. More...
 

Detailed Description

template<class _Field>
class LinBox::Submatrix< BlasMatrix< _Field >, VectorCategories::DenseVectorTag >

Specialization for BlasMatrix.

Member Typedef Documentation

◆ ColIterator

using ColIterator = BlasMatrixIterator<Field, Storage, subVectorType>
inherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ ConstColIterator

using ConstColIterator = BlasMatrixIterator<Field, Storage, constSubVectorType>
inherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedIterator

using IndexedIterator = BlasMatrixIndexedIterator<Field, pointer, Element>
inherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ ConstIndexedIterator

using ConstIndexedIterator = BlasMatrixIndexedIterator<Field, const_pointer, const Element>
inherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

Constructor & Destructor Documentation

◆ Submatrix() [1/4]

Submatrix ( const BlasMatrix< Field > *  Mat,
size_t  row,
size_t  col,
size_t  Rowdim,
size_t  Coldim 
)
inline

Constructor from an existing BlasMatrix and dimensions.

Parameters
MatPointer to BlasMatrix of which to construct submatrix
rowStarting row
colStarting column
RowdimRow dimension
ColdimColumn dimension

◆ Submatrix() [2/4]

Submatrix ( const BlasMatrix< Field > &  Mat,
size_t  row,
size_t  col,
size_t  Rowdim,
size_t  Coldim 
)
inline

Constructor from an existing BlasMatrix and dimensions.

Parameters
Matreference to BlasMatrix of which to construct submatrix
rowStarting row
colStarting column
RowdimRow dimension
ColdimColumn dimension

◆ Submatrix() [3/4]

Submatrix ( const Submatrix< BlasMatrix< Field > > *  SM,
size_t  row,
size_t  col,
size_t  Rowdim,
size_t  Coldim 
)
inline

Constructor from an existing submatrix and dimensions.

Parameters
SMpointer to Submatrix from which to construct submatrix
rowStarting row
colStarting column
RowdimRow dimension
ColdimColumn dimension

◆ Submatrix() [4/4]

Submatrix ( const Submatrix< BlasMatrix< Field > > &  SM,
size_t  row,
size_t  col,
size_t  Rowdim,
size_t  Coldim 
)
inline

Constructor from an existing submatrix and dimensions.

Parameters
SMreference to Submatrix from which to construct submatrix
rowStarting row
colStarting column
RowdimRow dimension
ColdimColumn dimension

Member Function Documentation

◆ rowdim()

size_t rowdim ( ) const
inlineinherited

Get the number of rows in the matrix.

Returns
Number of rows in matrix

◆ coldim()

size_t coldim ( ) const
inlineinherited

Get the number of columns in the matrix.

Returns
Number of columns in matrix

◆ getStride()

size_t getStride ( ) const
inlineinherited

Get the stride of the matrix.

Returns
stride of submatrix (number of cols of dense base matrix)

◆ field()

const Field & field ( ) const
inlineinherited

Get the field of the BlasSubMatrix.

Returns
Const reference to Field

◆ read()

std::istream & read ( std::istream &  file)
inherited

Read the matrix from an input stream.

Parameters
fileInput stream from which to read
Bug:
reading a submatrix should not be allowed !!

◆ write()

std::ostream & write ( std::ostream &  os,
Tag::FileFormat  f = Tag::FileFormat::Plain 
) const
inherited

Write the matrix to an output stream.

Parameters
osOutput stream to which to write
fwrite in some format (Tag::FileFormat::Format). Default is MM's.

◆ setEntry()

void setEntry ( size_t  i,
size_t  j,
const Element &  a_ij 
)
inherited

Set the entry at (i, j).

Parameters
iRow number, 0...rowdim () - 1
jColumn number 0...coldim () - 1
a_ijElement to set

◆ refEntry()

BlasSubmatrix< _Matrix >::Element & refEntry ( size_t  i,
size_t  j 
)
inherited

Get a writeable reference to an entry in the matrix.

Parameters
iRow index of entry
jColumn index of entry
Returns
Reference to matrix entry

◆ getEntry() [1/2]

const BlasSubmatrix< _Matrix >::Element & getEntry ( size_t  i,
size_t  j 
) const
inherited

Get a read-only individual entry from the matrix.

Parameters
iRow index
jColumn index
Returns
Const reference to matrix entry

◆ getEntry() [2/2]

BlasSubmatrix< _Matrix >::Element & getEntry ( Element &  x,
size_t  i,
size_t  j 
) const
inherited

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

◆ apply()

Vector1 & apply ( Vector1 &  y,
const Vector2 &  x 
) const
inlineinherited
Bug:
every vector we use here should have a stride/be blas vectors so it's not really templated by Vector1 Vector2 in general

◆ applyTranspose()

Vector1 & applyTranspose ( Vector1 &  y,
const Vector2 &  x 
) const
inlineinherited
Bug:

use Matrix domain

since removal of ApplyDomain this does not handle the case where Field if Givaro::Extension needed for charpoly computation

◆ colBegin() [1/2]

ColIterator colBegin ( )
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ colBegin() [2/2]

ConstColIterator colBegin ( ) const
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ colEnd() [1/2]

ColIterator colEnd ( )
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ colEnd() [2/2]

ConstColIterator colEnd ( ) const
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ Begin() [1/2]

Iterator Begin ( )
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ Begin() [2/2]

ConstIterator Begin ( ) const
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ End() [1/2]

Iterator End ( )
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ End() [2/2]

ConstIterator End ( ) const
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedBegin() [1/2]

IndexedIterator IndexedBegin ( )
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedBegin() [2/2]

ConstIndexedIterator IndexedBegin ( ) const
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedEnd() [1/2]

IndexedIterator IndexedEnd ( )
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedEnd() [2/2]

ConstIndexedIterator IndexedEnd ( ) const
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ operator[]() [1/2]

subVectorType operator[] ( size_t  i)
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ operator[]() [2/2]

constSubVectorType operator[] ( size_t  i) const
inlineinherited

operator[].

Retrieve a reference to a row

Parameters
iRow index

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