]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Consistently use const std::shared_ptr & for the import functions
authorBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 15 Aug 2018 15:07:52 +0000 (15:07 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 17 Aug 2018 19:45:50 +0000 (19:45 +0000)
include/deal.II/lac/read_write_vector.h
include/deal.II/lac/read_write_vector.templates.h

index 1c26196c03253b6333b3a59695b645ec6b3e8d41..8cc7b8263047c54eb692610069896c1c737a9236 100644 (file)
@@ -326,11 +326,11 @@ namespace LinearAlgebra
      * @note: The @p trilinos_vec is not allowed to have ghost entries.
      */
     void
-    import(
-      const TrilinosWrappers::MPI::Vector &           trilinos_vec,
-      VectorOperation::values                         operation,
-      std::shared_ptr<const CommunicationPatternBase> communication_pattern =
-        std::shared_ptr<const CommunicationPatternBase>());
+    import(const TrilinosWrappers::MPI::Vector &trilinos_vec,
+           VectorOperation::values              operation,
+           const std::shared_ptr<const CommunicationPatternBase>
+             &communication_pattern =
+               std::shared_ptr<const CommunicationPatternBase>());
 
 #  ifdef DEAL_II_WITH_MPI
     /**
@@ -342,11 +342,11 @@ namespace LinearAlgebra
      * performance.
      */
     void
-    import(
-      const EpetraWrappers::Vector &                  epetra_vec,
-      VectorOperation::values                         operation,
-      std::shared_ptr<const CommunicationPatternBase> communication_pattern =
-        std::shared_ptr<const CommunicationPatternBase>());
+    import(const EpetraWrappers::Vector &epetra_vec,
+           VectorOperation::values       operation,
+           const std::shared_ptr<const CommunicationPatternBase>
+             &communication_pattern =
+               std::shared_ptr<const CommunicationPatternBase>());
 #  endif
 #endif
 
@@ -358,11 +358,11 @@ namespace LinearAlgebra
      * replace the current elements. The last parameter is not used.
      */
     void
-    import(
-      const CUDAWrappers::Vector<Number> &            cuda_vec,
-      VectorOperation::values                         operation,
-      std::shared_ptr<const CommunicationPatternBase> communication_pattern =
-        std::shared_ptr<const CommunicationPatternBase>());
+    import(const CUDAWrappers::Vector<Number> &cuda_vec,
+           VectorOperation::values             operation,
+           const std::shared_ptr<const CommunicationPatternBase>
+             &communication_pattern =
+               std::shared_ptr<const CommunicationPatternBase>());
 #endif
 
     /**
index 0b6f003b21360bc76f39f642ebc80728c29dbbfa..664d468040cbc46f863d8d498a78a8604ef5991d 100644 (file)
@@ -531,9 +531,10 @@ namespace LinearAlgebra
   template <typename Number>
   void
   ReadWriteVector<Number>::import(
-    const TrilinosWrappers::MPI::Vector &           trilinos_vec,
-    VectorOperation::values                         operation,
-    std::shared_ptr<const CommunicationPatternBase> communication_pattern)
+    const TrilinosWrappers::MPI::Vector &trilinos_vec,
+    VectorOperation::values              operation,
+    const std::shared_ptr<const CommunicationPatternBase>
+      &communication_pattern)
   {
     // While the import does work with Trilinos 12.8.x, it fails with 12.4.x. To
     // be safe, we disable it here. Note that it would be a useful case, as
@@ -554,9 +555,10 @@ namespace LinearAlgebra
   template <typename Number>
   void
   ReadWriteVector<Number>::import(
-    const LinearAlgebra::EpetraWrappers::Vector &   trilinos_vec,
-    VectorOperation::values                         operation,
-    std::shared_ptr<const CommunicationPatternBase> communication_pattern)
+    const LinearAlgebra::EpetraWrappers::Vector &trilinos_vec,
+    VectorOperation::values                      operation,
+    const std::shared_ptr<const CommunicationPatternBase>
+      &communication_pattern)
   {
     import(trilinos_vec.trilinos_vector(),
            trilinos_vec.locally_owned_elements(),
@@ -574,7 +576,7 @@ namespace LinearAlgebra
   ReadWriteVector<Number>::import(
     const LinearAlgebra::CUDAWrappers::Vector<Number> &cuda_vec,
     VectorOperation::values                            operation,
-    std::shared_ptr<const CommunicationPatternBase>)
+    const std::shared_ptr<const CommunicationPatternBase> &)
   {
     const unsigned int n_elements = stored_elements.n_elements();
     if (operation == VectorOperation::insert)

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.