diff --git a/dune/matrix-vector/componentwisematrixmap.hh b/dune/matrix-vector/componentwisematrixmap.hh index 80acaa7d9b8a349fdb6b55d5bc70a075d81219ea..62cdd2a5558b606b3afa6e8e2ee3c6dbfb2bed8a 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); }