]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Consistently declare size_type in preconditioners derived from PreconditionRelaxation. 12749/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 8 Sep 2021 02:31:52 +0000 (20:31 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 8 Sep 2021 02:31:52 +0000 (20:31 -0600)
The base class declares a 'size_type' typedef, but only some of the derived classes
import it. Do so consistently, and do it by inheriting the type instead of
re-inventing the wheel.

include/deal.II/lac/precondition.h

index a1048a9636666e15a56c6d9df1e0e944db6fdc0f..fdfa87d49ccb6e7b1a8f71d134b94daa50050114 100644 (file)
@@ -497,6 +497,11 @@ template <typename MatrixType = SparseMatrix<double>>
 class PreconditionJacobi : public PreconditionRelaxation<MatrixType>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  using size_type = typename PreconditionRelaxation<MatrixType>::size_type;
+
   /**
    * An alias to the base class AdditionalData.
    */
@@ -583,6 +588,11 @@ template <typename MatrixType = SparseMatrix<double>>
 class PreconditionSOR : public PreconditionRelaxation<MatrixType>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  using size_type = typename PreconditionRelaxation<MatrixType>::size_type;
+
   /**
    * An alias to the base class AdditionalData.
    */
@@ -651,15 +661,15 @@ class PreconditionSSOR : public PreconditionRelaxation<MatrixType>
 {
 public:
   /**
-   * An alias to the base class AdditionalData.
+   * Declare type for container size.
    */
-  using AdditionalData =
-    typename PreconditionRelaxation<MatrixType>::AdditionalData;
+  using size_type = typename PreconditionRelaxation<MatrixType>::size_type;
 
   /**
-   * Declare type for container size.
+   * An alias to the base class AdditionalData.
    */
-  using size_type = typename MatrixType::size_type;
+  using AdditionalData =
+    typename PreconditionRelaxation<MatrixType>::AdditionalData;
 
   /**
    * An alias to the base class.
@@ -752,7 +762,7 @@ public:
   /**
    * Declare type for container size.
    */
-  using size_type = typename MatrixType::size_type;
+  using size_type = typename PreconditionRelaxation<MatrixType>::size_type;
 
   /**
    * Parameters for PreconditionPSOR.

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.