linbox
BlasSubmatrix< _Matrix >::rebind< _Tp1, _Rep2 > Struct Template Reference

Public Types

typedef BlasMatrix< _Tp1, _Rep2 > other
 
typedef _Matrix::Field Field
 
typedef Field::Element Element
 Element type.
 
typedef _Matrix::Storage Storage
 
typedef _Matrix::RawStorage RawStorage
 
typedef BlasSubmatrix< _Matrix > Self_t
 Self type.
 
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
 
typedef Self_t subMatrixType
 
typedef BlasSubmatrix< const _Matrix > constSubMatrixType
 
typedef BlasSubmatrix< typename std::remove_const< _Matrix >::type > nonconstSubMatrixType
 
typedef Storage::subVectorType subVectorType
 
typedef Storage::constSubVectorType constSubVectorType
 
typedef subVectorType Row
 
typedef subVectorType Col
 
typedef constSubVectorType ConstRow
 
typedef constSubVectorType ConstCol
 

Public Member Functions

void operator() (other &Ap, const Self_t &A)
 
BlasSubmatrix< _Matrix > & copy (const _AnyMatrix &M)
 
BlasSubmatrix< _Matrix > & swap (_AnyMatrix &M)
 
 BlasSubmatrix (matrixType &M, size_t rowbeg, size_t colbeg, size_t Rowdim, size_t Coldim)
 Constructor from an existing BlasMatrix and dimensions.
 
 BlasSubmatrix (Self_t &SM, size_t rowbeg, size_t colbeg, size_t Rowdim, size_t Coldim)
 Constructor from an existing submatrix and dimensions.
 
 BlasSubmatrix (matrixType &M)
 Constructor from an existing BlasMatrix.
 
 BlasSubmatrix (const Field &F, pointer ptr, size_t Rowdim, size_t Coldim, size_t stride)
 Constructor from a raw pointer.
 
 BlasSubmatrix (const constSubMatrixType &M)
 Copy constructor (virtual copy)
 
 BlasSubmatrix (nonconstSubMatrixType &M)
 
 BlasSubmatrix (const nonconstSubMatrixType &M)
 
 BlasSubmatrix (Self_t &&M)=default
 Move constructor / Move operator.
 
Self_toperator= (Self_t &&M)=default
 
Self_toperator= (const Self_t &M)=delete
 
Self_tcopy (const _AnyMatrix &A)
 (copying data) -> works only if dimensions are the same
 
BlasSubmatrix< _Matrix > & copy (const _AnyMatrix &M)
 
Self_tswap (_AnyMatrix &A)
 (swaping local data to same dimension (sub)part of A) -> works only if both dimensions of A are larger
 
BlasSubmatrix< _Matrix > & swap (_AnyMatrix &M)
 
size_t rowdim () const
 Get the number of rows in the matrix.
 
size_t coldim () const
 Get the number of columns in the matrix.
 
size_t getStride () const
 Get the stride of the matrix.
 
const Fieldfield () const
 Get the field of the BlasSubMatrix.
 
pointer getPointer ()
  
 
const_pointer getPointer () const
 
const_pointer getConstPointer () const
 
std::istream & read (std::istream &file)
 Read the matrix from an input stream.
 
std::ostream & write (std::ostream &os, Tag::FileFormat f=Tag::FileFormat::Plain) 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.
 
Vector1 & apply (Vector1 &y, const Vector2 &x) const
 
std::vector< Element > & apply (std::vector< Element > &y, const std::vector< Element > &x) const
 
Vector1 & applyTranspose (Vector1 &y, const Vector2 &x) const
 
std::vector< Element > & applyTranspose (std::vector< Element > &y, const std::vector< Element > &x) const
 
void zero ()
 
void random ()
 
void random (RandIter &G)
 

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
 
const Field_field
 

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
 
using ConstRowIterator
 
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
 operator[].
 
using ConstColIterator
 operator[].
 
using IndexedIterator
 operator[].
 
using ConstIndexedIterator
 operator[].
 
ColIterator colBegin ()
 operator[].
 
ConstColIterator colBegin () const
 operator[].
 
ColIterator colEnd ()
 operator[].
 
ConstColIterator colEnd () const
 operator[].
 
Iterator Begin ()
 operator[].
 
ConstIterator Begin () const
 operator[].
 
Iterator End ()
 operator[].
 
ConstIterator End () const
 operator[].
 
IndexedIterator IndexedBegin ()
 operator[].
 
ConstIndexedIterator IndexedBegin () const
 operator[].
 
IndexedIterator IndexedEnd ()
 operator[].
 
ConstIndexedIterator IndexedEnd () const
 operator[].
 
subVectorType operator[] (size_t i)
 operator[].
 
constSubVectorType operator[] (size_t i) const
 operator[].
 

Member Typedef Documentation

◆ other

template<class _Matrix>
template<typename _Tp1, typename _Rep2>
typedef BlasMatrix<_Tp1,_Rep2> other

◆ Field

typedef _Matrix::Field Field

◆ Element

typedef Field::Element Element

Element type.

◆ Storage

typedef _Matrix::Storage Storage

◆ RawStorage

typedef _Matrix::RawStorage RawStorage

◆ Self_t

typedef BlasSubmatrix<_Matrix> Self_t

Self type.

◆ pointer

typedef MatrixEltPointer<_Matrix>::pointer pointer

pointer type to elements

◆ const_pointer

const pointer type to elements

◆ matrixType

typedef _Matrix matrixType

matrix type

◆ subMatrixType

◆ constSubMatrixType

typedef BlasSubmatrix<const _Matrix> constSubMatrixType

◆ nonconstSubMatrixType

typedef BlasSubmatrix<typename std::remove_const<_Matrix>::type> nonconstSubMatrixType

◆ subVectorType

typedef Storage::subVectorType subVectorType

◆ constSubVectorType

typedef Storage::constSubVectorType constSubVectorType

◆ Row

typedef subVectorType Row

◆ Col

typedef subVectorType Col

◆ ConstRow

◆ ConstCol

◆ RowIterator

using RowIterator

◆ ConstRowIterator

◆ ColIterator

using ColIterator

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ ConstColIterator

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedIterator

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ ConstIndexedIterator

operator[].

Retrieve a reference to a row

Parameters
iRow index

Member Function Documentation

◆ operator()()

template<class _Matrix>
template<typename _Tp1, typename _Rep2>
void operator() ( other & Ap,
const Self_t & A )
inline

◆ copy() [1/3]

BlasSubmatrix< _Matrix > & copy ( const _AnyMatrix & M)

◆ swap() [1/3]

BlasSubmatrix< _Matrix > & swap ( _AnyMatrix & M)

◆ BlasSubmatrix() [1/8]

BlasSubmatrix ( matrixType & M,
size_t rowbeg,
size_t colbeg,
size_t Rowdim,
size_t Coldim )

Constructor from an existing BlasMatrix and dimensions.

Parameters
MPointer to BlasMatrix of which to construct submatrix
rowbegStarting row
colbegStarting column
RowdimRow dimension
ColdimColumn dimension

◆ BlasSubmatrix() [2/8]

BlasSubmatrix ( Self_t & SM,
size_t rowbeg,
size_t colbeg,
size_t Rowdim,
size_t Coldim )

Constructor from an existing submatrix and dimensions.

Parameters
SMConstant reference to BlasSubmatrix from which to construct submatrix
rowbegStarting row
colbegStarting column
RowdimRow dimension
ColdimColumn dimension

◆ BlasSubmatrix() [3/8]

Constructor from an existing BlasMatrix.

Parameters
MPointer to BlasMatrix of which to construct submatrix

◆ BlasSubmatrix() [4/8]

BlasSubmatrix ( const Field & F,
pointer ptr,
size_t Rowdim,
size_t Coldim,
size_t stride )

Constructor from a raw pointer.

Parameters
MPointer to BlasMatrix of which to construct submatrix

◆ BlasSubmatrix() [5/8]

Copy constructor (virtual copy)

◆ BlasSubmatrix() [6/8]

◆ BlasSubmatrix() [7/8]

◆ BlasSubmatrix() [8/8]

BlasSubmatrix ( Self_t && M)
default

Move constructor / Move operator.

◆ operator=() [1/2]

Self_t & operator= ( Self_t && M)
default

◆ operator=() [2/2]

Self_t & operator= ( const Self_t & M)
delete

◆ copy() [2/3]

Self_t & copy ( const _AnyMatrix & A)

(copying data) -> works only if dimensions are the same

◆ copy() [3/3]

BlasSubmatrix< _Matrix > & copy ( const _AnyMatrix & M)

◆ swap() [2/3]

Self_t & swap ( _AnyMatrix & A)

(swaping local data to same dimension (sub)part of A) -> works only if both dimensions of A are larger

◆ swap() [3/3]

BlasSubmatrix< _Matrix > & swap ( _AnyMatrix & M)

◆ rowdim()

size_t rowdim ( ) const
inline

Get the number of rows in the matrix.

Returns
Number of rows in matrix

◆ coldim()

size_t coldim ( ) const
inline

Get the number of columns in the matrix.

Returns
Number of columns in matrix

◆ getStride()

size_t getStride ( ) const
inline

Get the stride of the matrix.

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

◆ field()

const Field & field ( ) const
inline

Get the field of the BlasSubMatrix.

Returns
Const reference to Field

◆ getPointer() [1/2]

pointer getPointer ( )
inline

 

Get pointer to the matrix data (read/write access will depend on the type of the template parameter _Matrix, i.e. const or not)

◆ getPointer() [2/2]

const_pointer getPointer ( ) const
inline

◆ getConstPointer()

const_pointer getConstPointer ( ) const
inline

◆ read()

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

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

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 )

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 )

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

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

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() [1/2]

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

◆ apply() [2/2]

std::vector< Element > & apply ( std::vector< Element > & y,
const std::vector< Element > & x ) const
inline

◆ applyTranspose() [1/2]

Vector1 & applyTranspose ( Vector1 & y,
const Vector2 & x ) const
inline
Bug

use Matrix domain

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

◆ applyTranspose() [2/2]

std::vector< Element > & applyTranspose ( std::vector< Element > & y,
const std::vector< Element > & x ) const
inline

◆ zero()

void zero ( )
inline

◆ random() [1/2]

void random ( )
inline

◆ random() [2/2]

void random ( RandIter & G)
inline

◆ rowBegin() [1/2]

RowIterator rowBegin ( )
inline

◆ rowBegin() [2/2]

ConstRowIterator rowBegin ( ) const
inline

◆ rowEnd() [1/2]

RowIterator rowEnd ( )
inline

◆ rowEnd() [2/2]

ConstRowIterator rowEnd ( ) const
inline

◆ colBegin() [1/2]

ColIterator colBegin ( )
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ colBegin() [2/2]

ConstColIterator colBegin ( ) const
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ colEnd() [1/2]

ColIterator colEnd ( )
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ colEnd() [2/2]

ConstColIterator colEnd ( ) const
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ Begin() [1/2]

Iterator Begin ( )
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ Begin() [2/2]

ConstIterator Begin ( ) const
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ End() [1/2]

Iterator End ( )
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ End() [2/2]

ConstIterator End ( ) const
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedBegin() [1/2]

IndexedIterator IndexedBegin ( )
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedBegin() [2/2]

ConstIndexedIterator IndexedBegin ( ) const
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedEnd() [1/2]

IndexedIterator IndexedEnd ( )
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ IndexedEnd() [2/2]

ConstIndexedIterator IndexedEnd ( ) const
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ operator[]() [1/2]

subVectorType operator[] ( size_t i)
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

◆ operator[]() [2/2]

constSubVectorType operator[] ( size_t i) const
inline

operator[].

Retrieve a reference to a row

Parameters
iRow index

Field Documentation

◆ _ptr

pointer _ptr
protected

pointer to the first elt of the submatrix

◆ _row

size_t _row
protected

row dimension of Submatrix

◆ _col

size_t _col
protected

col dimension of Submatrix

◆ _stride

size_t _stride
protected

stride of the original matrix

◆ _field

const Field& _field
protected

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