]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make some variables const (references) 5730/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 13 Jan 2018 18:39:08 +0000 (19:39 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 13 Jan 2018 21:38:03 +0000 (22:38 +0100)
include/deal.II/lac/full_matrix.templates.h
include/deal.II/lac/scalapack.h
source/grid/grid_tools.cc
source/lac/scalapack.cc

index e7dd78f5f8fbca035d8482522e8d6ab321441294..25588acc4c60132ecacdd4bec95563d283b29714 100644 (file)
@@ -1315,7 +1315,7 @@ FullMatrix<number>::invert (const FullMatrix<number2> &M)
     {
       // avoid overwriting source
       // by destination matrix:
-      FullMatrix<number2> M2 = M;
+      const FullMatrix<number2> M2 = M;
       invert(M2);
     }
   else
@@ -1486,7 +1486,7 @@ FullMatrix<number>::cholesky (const FullMatrix<number2> &A)
     {
       // avoid overwriting source
       // by destination matrix:
-      FullMatrix<number2> A2 = A;
+      const FullMatrix<number2> A2 = A;
       cholesky(A2);
     }
   else
index 2a1002e944d8ea81ac53689feb1eb961446b33a0..631eadf748333d198bb3b9407804ddf70565356f 100644 (file)
@@ -117,7 +117,7 @@ public:
    */
   ScaLAPACKMatrix(const size_type n_rows,
                   const size_type n_columns,
-                  const std::shared_ptr<const Utilities::MPI::ProcessGrid> process_grid,
+                  const std::shared_ptr<const Utilities::MPI::ProcessGrid> &process_grid,
                   const size_type row_block_size = 32,
                   const size_type column_block_size = 32,
                   const LAPACKSupport::Property property = LAPACKSupport::Property::general);
index ecf5684ada805566133179dfa7831a81c78cae06..c8cb2bd8a701d93196d318f328ad6307f4597502 100644 (file)
@@ -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;
index 7308231001525177ccf6f9f9c668bf14708a389b..208f912d2b7e8bcf2c49ce4c6c423cbaf39a73e0 100644 (file)
@@ -27,7 +27,7 @@ DEAL_II_NAMESPACE_OPEN
 template <typename NumberType>
 ScaLAPACKMatrix<NumberType>::ScaLAPACKMatrix(const size_type n_rows_,
                                              const size_type n_columns_,
-                                             const std::shared_ptr<const Utilities::MPI::ProcessGrid> process_grid,
+                                             const std::shared_ptr<const Utilities::MPI::ProcessGrid> &process_grid,
                                              const size_type row_block_size_,
                                              const size_type column_block_size_,
                                              const LAPACKSupport::Property property)

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.