]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Pass some function arguments by reference.
authorDavid Wells <wellsd2@rpi.edu>
Tue, 3 Jan 2017 17:06:29 +0000 (12:06 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Wed, 4 Jan 2017 00:54:48 +0000 (19:54 -0500)
This was caught by cppcheck.

include/deal.II/lac/trilinos_precondition.h
source/lac/trilinos_precondition.cc

index 5f4b67250c67c16f21a508a0bd67ef34a45e1a2f..e3a6110359cd48591e45c6e0f7ab5d83de49d3ec 100644 (file)
@@ -507,11 +507,11 @@ namespace TrilinosWrappers
        * subdivision of the rows, set the damping parameter to one, and do not
        * modify the diagonal.
        */
-      AdditionalData (const unsigned int block_size = 1,
-                      const std::string  block_creation_type = "linear",
-                      const double       omega = 1,
-                      const double       min_diagonal = 0,
-                      const unsigned int n_sweeps = 1);
+      AdditionalData (const unsigned int  block_size          = 1,
+                      const std::string  &block_creation_type = "linear",
+                      const double        omega               = 1,
+                      const double        min_diagonal        = 0,
+                      const unsigned int  n_sweeps            = 1);
 
       /**
        * This specifies the size of blocks.
@@ -612,12 +612,12 @@ namespace TrilinosWrappers
        * run a BlockJacobi preconditioner, where each block is inverted
        * approximately by a block SOR).
        */
-      AdditionalData (const unsigned int block_size = 1,
-                      const std::string  block_creation_type = "linear",
-                      const double       omega = 1,
-                      const double       min_diagonal = 0,
-                      const unsigned int overlap = 0,
-                      const unsigned int n_sweeps = 1);
+      AdditionalData (const unsigned int  block_size          = 1,
+                      const std::string  &block_creation_type = "linear",
+                      const double        omega               = 1,
+                      const double        min_diagonal        = 0,
+                      const unsigned int  overlap             = 0,
+                      const unsigned int  n_sweeps            = 1);
 
       /**
        * This specifies the size of blocks.
@@ -725,12 +725,12 @@ namespace TrilinosWrappers
        * run a BlockJacobi preconditioner, where each block is inverted
        * approximately by a block SOR).
        */
-      AdditionalData (const unsigned int block_size = 1,
-                      const std::string  block_creation_type = "linear",
-                      const double       omega = 1,
-                      const double       min_diagonal = 0,
-                      const unsigned int overlap = 0,
-                      const unsigned int n_sweeps = 1);
+      AdditionalData (const unsigned int  block_size          = 1,
+                      const std::string  &block_creation_type = "linear",
+                      const double        omega               = 1,
+                      const double        min_diagonal        = 0,
+                      const unsigned int  overlap             = 0,
+                      const unsigned int  n_sweeps            = 1);
 
       /**
        * This specifies the size of blocks.
index b15fe1e26520ec79eeaca243ae369df325c0d297..8cd96849a2cea820829b3046783e939129577220 100644 (file)
@@ -231,11 +231,11 @@ namespace TrilinosWrappers
   /* ----------------------- PreconditionBlockJacobi ---------------------- */
 
   PreconditionBlockJacobi::AdditionalData::
-  AdditionalData (const unsigned int block_size,
-                  const std::string  block_creation_type,
-                  const double omega,
-                  const double min_diagonal,
-                  const unsigned int n_sweeps)
+  AdditionalData (const unsigned int  block_size,
+                  const std::string  &block_creation_type,
+                  const double        omega,
+                  const double        min_diagonal,
+                  const unsigned int  n_sweeps)
     :
     block_size(block_size),
     block_creation_type(block_creation_type),
@@ -290,12 +290,12 @@ namespace TrilinosWrappers
   /* ----------------------- PreconditionBlockSSOR ------------------------ */
 
   PreconditionBlockSSOR::AdditionalData::
-  AdditionalData (const unsigned int block_size,
-                  const std::string  block_creation_type,
-                  const double       omega,
-                  const double       min_diagonal,
-                  const unsigned int overlap,
-                  const unsigned int n_sweeps)
+  AdditionalData (const unsigned int  block_size,
+                  const std::string  &block_creation_type,
+                  const double        omega,
+                  const double        min_diagonal,
+                  const unsigned int  overlap,
+                  const unsigned int  n_sweeps)
     :
     block_size(block_size),
     block_creation_type(block_creation_type),
@@ -351,12 +351,12 @@ namespace TrilinosWrappers
   /* ------------------------ PreconditionBlockSOR ------------------------ */
 
   PreconditionBlockSOR::AdditionalData::
-  AdditionalData (const unsigned int block_size,
-                  const std::string  block_creation_type,
-                  const double       omega,
-                  const double       min_diagonal,
-                  const unsigned int overlap,
-                  const unsigned int n_sweeps)
+  AdditionalData (const unsigned int  block_size,
+                  const std::string  &block_creation_type,
+                  const double        omega,
+                  const double        min_diagonal,
+                  const unsigned int  overlap,
+                  const unsigned int  n_sweeps)
     :
     block_size(block_size),
     block_creation_type(block_creation_type),

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.