From 592ee0423ab993c5ea171f122c9f23d3481021dd Mon Sep 17 00:00:00 2001 From: Max Kahnt <max.kahnt@fu-berlin.de> Date: Mon, 15 Dec 2014 16:09:20 +0100 Subject: [PATCH] Parametrize SingleNonZeroColumn Matrix with const ref of block type. --- dune/matrix-vector/componentwisematrixmap.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dune/matrix-vector/componentwisematrixmap.hh b/dune/matrix-vector/componentwisematrixmap.hh index 80acaa7..62cdd2a 100644 --- a/dune/matrix-vector/componentwisematrixmap.hh +++ b/dune/matrix-vector/componentwisematrixmap.hh @@ -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); } -- GitLab