Skip to content
Snippets Groups Projects
Commit 592ee042 authored by Max Kahnt's avatar Max Kahnt
Browse files

Parametrize SingleNonZeroColumn Matrix with const ref of block type.

parent eb34a032
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,11 @@ class ComponentWiseMatrixMap
public:
static const int rowFactor = COLS;
static const int colFactor = 1;
typedef typename Dune::BCRSMatrix<Dune::FieldMatrix<K, ROWS, 1> > Matrix;
typedef SingleNonZeroColumnMatrix<K, ROWS, COLS> block_type;
using Block = Dune::FieldMatrix<K, ROWS, 1>;
typedef typename Dune::BCRSMatrix<Block> Matrix;
typedef SingleNonZeroColumnMatrix<K, ROWS, COLS, const Block&> block_type;
block_type apply(const typename Matrix::block_type& a, int row, int col, int virtualRow, int virtualCol) const
block_type apply(const Block& a, int row, int col, int virtualRow, int virtualCol) const
{
return block_type(a, virtualRow);
}
......@@ -34,10 +35,11 @@ class TransposedComponentWiseMatrixMap
public:
static const int rowFactor = 1;
static const int colFactor = ORIGINALCOLS;
typedef typename Dune::BCRSMatrix<Dune::FieldMatrix<K, 1, ORIGINALROWS> > Matrix;
typedef SingleNonZeroRowMatrix<K, ORIGINALCOLS, ORIGINALROWS> block_type;
using OriginalBlock = Dune::FieldMatrix<K, 1, ORIGINALROWS>;
typedef typename Dune::BCRSMatrix<OriginalBlock> Matrix;
typedef SingleNonZeroRowMatrix<K, ORIGINALCOLS, ORIGINALROWS> block_type; // TODO give const ref block type when support (see column case)
block_type apply(const typename Matrix::block_type& a, int row, int col, int virtualRow, int virtualCol) const
block_type apply(const OriginalBlock& a, int row, int col, int virtualRow, int virtualCol) const
{
return block_type(a, virtualCol);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment