From 4986265a79d395df79ea15cee2141b87d2b4ef21 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 13 Jan 2018 19:39:08 +0100 Subject: [PATCH] Make some variables const (references) --- include/deal.II/lac/full_matrix.templates.h | 4 ++-- include/deal.II/lac/scalapack.h | 2 +- source/grid/grid_tools.cc | 2 +- source/lac/scalapack.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/deal.II/lac/full_matrix.templates.h b/include/deal.II/lac/full_matrix.templates.h index e7dd78f5f8..25588acc4c 100644 --- a/include/deal.II/lac/full_matrix.templates.h +++ b/include/deal.II/lac/full_matrix.templates.h @@ -1315,7 +1315,7 @@ FullMatrix::invert (const FullMatrix &M) { // avoid overwriting source // by destination matrix: - FullMatrix M2 = M; + const FullMatrix M2 = M; invert(M2); } else @@ -1486,7 +1486,7 @@ FullMatrix::cholesky (const FullMatrix &A) { // avoid overwriting source // by destination matrix: - FullMatrix A2 = A; + const FullMatrix A2 = A; cholesky(A2); } else diff --git a/include/deal.II/lac/scalapack.h b/include/deal.II/lac/scalapack.h index 2a1002e944..631eadf748 100644 --- a/include/deal.II/lac/scalapack.h +++ b/include/deal.II/lac/scalapack.h @@ -117,7 +117,7 @@ public: */ ScaLAPACKMatrix(const size_type n_rows, const size_type n_columns, - const std::shared_ptr process_grid, + const std::shared_ptr &process_grid, const size_type row_block_size = 32, const size_type column_block_size = 32, const LAPACKSupport::Property property = LAPACKSupport::Property::general); diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index ecf5684ada..c8cb2bd8a7 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -2279,7 +2279,7 @@ next_cell: } // Creating a Bounding Box for all cells on the chosen refinement_level - for (typename MeshType::cell_iterator cell: mesh.cell_iterators_on_level(refinement_level)) + for (const typename MeshType::cell_iterator &cell: mesh.cell_iterators_on_level(refinement_level)) { bool has_predicate = false; BoundingBox < spacedim > bbox; diff --git a/source/lac/scalapack.cc b/source/lac/scalapack.cc index 7308231001..208f912d2b 100644 --- a/source/lac/scalapack.cc +++ b/source/lac/scalapack.cc @@ -27,7 +27,7 @@ DEAL_II_NAMESPACE_OPEN template ScaLAPACKMatrix::ScaLAPACKMatrix(const size_type n_rows_, const size_type n_columns_, - const std::shared_ptr process_grid, + const std::shared_ptr &process_grid, const size_type row_block_size_, const size_type column_block_size_, const LAPACKSupport::Property property) -- 2.39.5