Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
MappedMatrix< Map > Class Template Reference

A sparse matrix built by entry-wise transformation. More...

#include <dune/fufem/mappedmatrix.hh>

Classes

class  RealRowIterator
 Iterator access to matrix rows More...
 

Public Types

using size_type = typename Matrix::size_type
 
typedef MappedMatrixRow< Map > row_type
 
typedef Map::block_type block_type
 
typedef MappedMatrixColIterator< Map > ConstColIterator
 
using const_iterator = RealRowIterator< const row_type >
 The const iterator over the matrix rows.
 

Public Member Functions

 MappedMatrix (const Map &map, const Matrix &matrix)
 
auto begin () const
 Get const iterator to first row.
 
auto end () const
 Get const iterator to one beyond last row.
 
size_type N () const
 Number of matrix rows.
 
size_type M () const
 Number of matrix columns.
 
const row_type operator[] (int row) const
 
template<class X , class Y >
void mv (const X &x, Y &y) const
 

Protected Attributes

const Map * map_
 
const Matrix * matrix_
 

Friends

template<typename M >
class MatrixDimension
 

Detailed Description

template<class Map>
class MappedMatrix< Map >

A sparse matrix built by entry-wise transformation.

MappedMatrix represents a sparse matrix that is obtained by transforming each entry of some given matrix. The transformed entries are not stored but computed on the fly when dereferencing the corresponding iterators. The given map transforms each entry into rowFactor x colFactor entries that may also have a different block type.

Template Parameters
MapType of transformation map

The type Map must implement the following interface

class MatrixMap
{
public:
static const int rowFactor; // number of rows will be this times larger
static const int colFactor; // number of columns will be this times larger
typedef [...] Matrix; // type of matrix to be transformed
typedef [...] block_type; // type of entries for transformed matrix
// entry transformation
// transform (virtualRow,virtualCol)-th copy of (row,col)-th entry A original matrix
block_type apply(const typename Matrix::block_type& A, int row, int col, int virtualRow, int virtualCol) const;
};
static Type apply(T &t)
Map::block_type block_type
Definition mappedmatrix.hh:212

Example use cases: With rowFactor=colFactor=1 one can e.g. map each entry of the original matrix to its local matrix norm. Conversely one can map scalar entries to a local matrices. With rowFactor,colFactor>1 one can e.g. duplicate rows or columns.

Member Typedef Documentation

◆ block_type

template<class Map >
typedef Map::block_type MappedMatrix< Map >::block_type

◆ const_iterator

template<class Map >
using MappedMatrix< Map >::const_iterator = RealRowIterator<const row_type>

The const iterator over the matrix rows.

◆ ConstColIterator

template<class Map >
typedef MappedMatrixColIterator<Map> MappedMatrix< Map >::ConstColIterator

◆ row_type

template<class Map >
typedef MappedMatrixRow<Map> MappedMatrix< Map >::row_type

◆ size_type

template<class Map >
using MappedMatrix< Map >::size_type = typename Matrix::size_type

Constructor & Destructor Documentation

◆ MappedMatrix()

template<class Map >
MappedMatrix< Map >::MappedMatrix ( const Map &  map,
const Matrix &  matrix 
)
inline

Member Function Documentation

◆ begin()

template<class Map >
auto MappedMatrix< Map >::begin ( ) const
inline

Get const iterator to first row.

◆ end()

template<class Map >
auto MappedMatrix< Map >::end ( ) const
inline

Get const iterator to one beyond last row.

◆ M()

template<class Map >
size_type MappedMatrix< Map >::M ( ) const
inline

Number of matrix columns.

◆ mv()

template<class Map >
template<class X , class Y >
void MappedMatrix< Map >::mv ( const X &  x,
Y &  y 
) const
inline

◆ N()

template<class Map >
size_type MappedMatrix< Map >::N ( ) const
inline

Number of matrix rows.

◆ operator[]()

template<class Map >
const row_type MappedMatrix< Map >::operator[] ( int  row) const
inline

Friends And Related Symbol Documentation

◆ MatrixDimension

template<class Map >
template<typename M >
friend class MatrixDimension
friend

Member Data Documentation

◆ map_

template<class Map >
const Map* MappedMatrix< Map >::map_
protected

◆ matrix_

template<class Map >
const Matrix* MappedMatrix< Map >::matrix_
protected

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