From: David Wells Date: Mon, 19 Oct 2015 02:27:59 +0000 (-0400) Subject: Use typename BlockMatrixType in templates. X-Git-Tag: v8.4.0-rc2~254^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=018646af85c5808b7deb871ad331eba727768212;p=dealii.git Use typename BlockMatrixType in templates. This replaces the use of 'BlockMatrix', which, while it is not a class name, looks a lot like one. --- diff --git a/include/deal.II/lac/block_linear_operator.h b/include/deal.II/lac/block_linear_operator.h index 5297cc68f2..567a0e788d 100644 --- a/include/deal.II/lac/block_linear_operator.h +++ b/include/deal.II/lac/block_linear_operator.h @@ -35,9 +35,9 @@ class BlockLinearOperator; template , typename Domain = Range, - typename BlockMatrix> + typename BlockMatrixType> BlockLinearOperator -block_operator(const BlockMatrix &matrix); +block_operator(const BlockMatrixType &matrix); template , @@ -66,9 +66,9 @@ block_diagonal_operator(const LinearOperator, typename Domain = Range, - typename BlockMatrix> + typename BlockMatrixType> BlockLinearOperator -block_diagonal_operator(const BlockMatrix &block_matrix); +block_diagonal_operator(const BlockMatrixType &block_matrix); template , typename Domain = Range> @@ -388,9 +388,9 @@ namespace internal */ template + typename BlockMatrixType> BlockLinearOperator -block_operator(const BlockMatrix &block_matrix) +block_operator(const BlockMatrixType &block_matrix) { typedef typename BlockLinearOperator::BlockType BlockType; @@ -502,9 +502,9 @@ block_operator(const std::array + typename BlockMatrixType> BlockLinearOperator -block_diagonal_operator(const BlockMatrix &block_matrix) +block_diagonal_operator(const BlockMatrixType &block_matrix) { typedef typename BlockLinearOperator::BlockType BlockType; diff --git a/include/deal.II/lac/block_matrix_base.h b/include/deal.II/lac/block_matrix_base.h index 080cb654b2..18cf56f80f 100644 --- a/include/deal.II/lac/block_matrix_base.h +++ b/include/deal.II/lac/block_matrix_base.h @@ -53,7 +53,7 @@ namespace BlockMatrixIterators * Base class for block matrix accessors, implementing the stepping through * a matrix. */ - template + template class AccessorBase { public: @@ -65,7 +65,7 @@ namespace BlockMatrixIterators /** * Typedef the value type of the matrix we point into. */ - typedef typename BlockMatrix::value_type value_type; + typedef typename BlockMatrixType::value_type value_type; /** * Initialize data fields to default values. @@ -105,17 +105,17 @@ namespace BlockMatrixIterators /** * Accessor classes in block matrices. */ - template + template class Accessor; /** * Block matrix accessor for non const matrices. */ - template - class Accessor + template + class Accessor : - public AccessorBase + public AccessorBase { public: /** @@ -126,12 +126,12 @@ namespace BlockMatrixIterators /** * Type of the matrix used in this accessor. */ - typedef BlockMatrix MatrixType; + typedef BlockMatrixType MatrixType; /** * Typedef the value type of the matrix we point into. */ - typedef typename BlockMatrix::value_type value_type; + typedef typename BlockMatrixType::value_type value_type; /** * Constructor. Since we use accessors only for read access, a const @@ -141,7 +141,7 @@ namespace BlockMatrixIterators * create the end pointer if @p row equals the total number of rows in the * matrix. */ - Accessor (BlockMatrix *m, + Accessor (BlockMatrixType *m, const size_type row, const size_type col); @@ -169,12 +169,12 @@ namespace BlockMatrixIterators /** * The matrix accessed. */ - BlockMatrix *matrix; + BlockMatrixType *matrix; /** * Iterator of the underlying matrix class. */ - typename BlockMatrix::BlockType::iterator base_iterator; + typename BlockMatrixType::BlockType::iterator base_iterator; /** * Move ahead one element. @@ -187,17 +187,17 @@ namespace BlockMatrixIterators bool operator == (const Accessor &a) const; template friend class MatrixIterator; - friend class Accessor; + friend class Accessor; }; /** * Block matrix accessor for constant matrices, implementing the stepping * through a matrix. */ - template - class Accessor + template + class Accessor : - public AccessorBase + public AccessorBase { public: /** @@ -208,12 +208,12 @@ namespace BlockMatrixIterators /** * Type of the matrix used in this accessor. */ - typedef const BlockMatrix MatrixType; + typedef const BlockMatrixType MatrixType; /** * Typedef the value type of the matrix we point into. */ - typedef typename BlockMatrix::value_type value_type; + typedef typename BlockMatrixType::value_type value_type; /** * Constructor. Since we use accessors only for read access, a const @@ -223,14 +223,14 @@ namespace BlockMatrixIterators * create the end pointer if @p row equals the total number of rows in the * matrix. */ - Accessor (const BlockMatrix *m, + Accessor (const BlockMatrixType *m, const size_type row, const size_type col); /** * Initialize const accessor from non const accessor. */ - Accessor(const Accessor &); + Accessor(const Accessor &); /** * Row number of the element represented by this object. @@ -250,12 +250,12 @@ namespace BlockMatrixIterators /** * The matrix accessed. */ - const BlockMatrix *matrix; + const BlockMatrixType *matrix; /** * Iterator of the underlying matrix class. */ - typename BlockMatrix::BlockType::const_iterator base_iterator; + typename BlockMatrixType::BlockType::const_iterator base_iterator; /** * Move ahead one element. @@ -1040,19 +1040,19 @@ private: namespace BlockMatrixIterators { - template + template inline - AccessorBase::AccessorBase() + AccessorBase::AccessorBase() : row_block(0), col_block(0) {} - template + template inline unsigned int - AccessorBase::block_row() const + AccessorBase::block_row() const { Assert (row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); @@ -1061,10 +1061,10 @@ namespace BlockMatrixIterators } - template + template inline unsigned int - AccessorBase::block_column() const + AccessorBase::block_column() const { Assert (col_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); @@ -1073,12 +1073,12 @@ namespace BlockMatrixIterators } - template + template inline - Accessor::Accessor ( - const BlockMatrix *matrix, - const size_type row, - const size_type col) + Accessor::Accessor ( + const BlockMatrixType *matrix, + const size_type row, + const size_type col) : matrix(matrix), base_iterator(matrix->block(0,0).begin()) @@ -1126,9 +1126,9 @@ namespace BlockMatrixIterators } -// template +// template // inline -// Accessor::Accessor (const Accessor& other) +// Accessor::Accessor (const Accessor& other) // : // matrix(other.matrix), // base_iterator(other.base_iterator) @@ -1138,9 +1138,9 @@ namespace BlockMatrixIterators // } - template + template inline - Accessor::Accessor (const Accessor &other) + Accessor::Accessor (const Accessor &other) : matrix(other.matrix), base_iterator(other.base_iterator) @@ -1150,10 +1150,10 @@ namespace BlockMatrixIterators } - template + template inline - typename Accessor::size_type - Accessor::row() const + typename Accessor::size_type + Accessor::row() const { Assert (this->row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); @@ -1163,10 +1163,10 @@ namespace BlockMatrixIterators } - template + template inline - typename Accessor::size_type - Accessor::column() const + typename Accessor::size_type + Accessor::column() const { Assert (this->col_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); @@ -1176,10 +1176,10 @@ namespace BlockMatrixIterators } - template + template inline - typename Accessor::value_type - Accessor::value () const + typename Accessor::value_type + Accessor::value () const { Assert (this->row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); @@ -1191,10 +1191,10 @@ namespace BlockMatrixIterators - template + template inline void - Accessor::advance () + Accessor::advance () { Assert (this->row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); @@ -1257,10 +1257,10 @@ namespace BlockMatrixIterators } - template + template inline bool - Accessor::operator == (const Accessor &a) const + Accessor::operator == (const Accessor &a) const { if (matrix != a.matrix) return false; @@ -1283,12 +1283,12 @@ namespace BlockMatrixIterators //----------------------------------------------------------------------// - template + template inline - Accessor::Accessor ( - BlockMatrix *matrix, - const size_type row, - const size_type col) + Accessor::Accessor ( + BlockMatrixType *matrix, + const size_type row, + const size_type col) : matrix(matrix), base_iterator(matrix->block(0,0).begin()) @@ -1335,10 +1335,10 @@ namespace BlockMatrixIterators } - template + template inline - typename Accessor::size_type - Accessor::row() const + typename Accessor::size_type + Accessor::row() const { Assert (this->row_block != numbers::invalid_size_type, ExcIteratorPastEnd()); @@ -1348,10 +1348,10 @@ namespace BlockMatrixIterators } - template + template inline - typename Accessor::size_type - Accessor::column() const + typename Accessor::size_type + Accessor::column() const { Assert (this->col_block != numbers::invalid_size_type, ExcIteratorPastEnd()); @@ -1361,10 +1361,10 @@ namespace BlockMatrixIterators } - template + template inline - typename Accessor::value_type - Accessor::value () const + typename Accessor::value_type + Accessor::value () const { Assert (this->row_block != numbers::invalid_size_type, ExcIteratorPastEnd()); @@ -1376,10 +1376,10 @@ namespace BlockMatrixIterators - template + template inline void - Accessor::set_value (typename Accessor::value_type newval) const + Accessor::set_value (typename Accessor::value_type newval) const { Assert (this->row_block != numbers::invalid_size_type, ExcIteratorPastEnd()); @@ -1391,10 +1391,10 @@ namespace BlockMatrixIterators - template + template inline void - Accessor::advance () + Accessor::advance () { Assert (this->row_block != numbers::invalid_size_type, ExcIteratorPastEnd()); @@ -1458,10 +1458,10 @@ namespace BlockMatrixIterators - template + template inline bool - Accessor::operator == (const Accessor &a) const + Accessor::operator == (const Accessor &a) const { if (matrix != a.matrix) return false;