From: David Wells Date: Tue, 3 Jan 2017 17:06:29 +0000 (-0500) Subject: Pass some function arguments by reference. X-Git-Tag: v8.5.0-rc1~295^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad1e9f23e64c5aa705a37be449350a9aec32feac;p=dealii.git Pass some function arguments by reference. This was caught by cppcheck. --- diff --git a/include/deal.II/lac/trilinos_precondition.h b/include/deal.II/lac/trilinos_precondition.h index 5f4b67250c..e3a6110359 100644 --- a/include/deal.II/lac/trilinos_precondition.h +++ b/include/deal.II/lac/trilinos_precondition.h @@ -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. diff --git a/source/lac/trilinos_precondition.cc b/source/lac/trilinos_precondition.cc index b15fe1e265..8cd96849a2 100644 --- a/source/lac/trilinos_precondition.cc +++ b/source/lac/trilinos_precondition.cc @@ -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),