From ef8c60e799f423a8dc5163a75351fdf831f73b34 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Wed, 15 Aug 2018 15:07:52 +0000 Subject: [PATCH] Consistently use const std::shared_ptr & for the import functions --- include/deal.II/lac/read_write_vector.h | 30 +++++++++---------- .../deal.II/lac/read_write_vector.templates.h | 16 +++++----- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/include/deal.II/lac/read_write_vector.h b/include/deal.II/lac/read_write_vector.h index 1c26196c03..8cc7b82630 100644 --- a/include/deal.II/lac/read_write_vector.h +++ b/include/deal.II/lac/read_write_vector.h @@ -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 communication_pattern = - std::shared_ptr()); + import(const TrilinosWrappers::MPI::Vector &trilinos_vec, + VectorOperation::values operation, + const std::shared_ptr + &communication_pattern = + std::shared_ptr()); # 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 communication_pattern = - std::shared_ptr()); + import(const EpetraWrappers::Vector &epetra_vec, + VectorOperation::values operation, + const std::shared_ptr + &communication_pattern = + std::shared_ptr()); # endif #endif @@ -358,11 +358,11 @@ namespace LinearAlgebra * replace the current elements. The last parameter is not used. */ void - import( - const CUDAWrappers::Vector & cuda_vec, - VectorOperation::values operation, - std::shared_ptr communication_pattern = - std::shared_ptr()); + import(const CUDAWrappers::Vector &cuda_vec, + VectorOperation::values operation, + const std::shared_ptr + &communication_pattern = + std::shared_ptr()); #endif /** diff --git a/include/deal.II/lac/read_write_vector.templates.h b/include/deal.II/lac/read_write_vector.templates.h index 0b6f003b21..664d468040 100644 --- a/include/deal.II/lac/read_write_vector.templates.h +++ b/include/deal.II/lac/read_write_vector.templates.h @@ -531,9 +531,10 @@ namespace LinearAlgebra template void ReadWriteVector::import( - const TrilinosWrappers::MPI::Vector & trilinos_vec, - VectorOperation::values operation, - std::shared_ptr communication_pattern) + const TrilinosWrappers::MPI::Vector &trilinos_vec, + VectorOperation::values operation, + const std::shared_ptr + &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 void ReadWriteVector::import( - const LinearAlgebra::EpetraWrappers::Vector & trilinos_vec, - VectorOperation::values operation, - std::shared_ptr communication_pattern) + const LinearAlgebra::EpetraWrappers::Vector &trilinos_vec, + VectorOperation::values operation, + const std::shared_ptr + &communication_pattern) { import(trilinos_vec.trilinos_vector(), trilinos_vec.locally_owned_elements(), @@ -574,7 +576,7 @@ namespace LinearAlgebra ReadWriteVector::import( const LinearAlgebra::CUDAWrappers::Vector &cuda_vec, VectorOperation::values operation, - std::shared_ptr) + const std::shared_ptr &) { const unsigned int n_elements = stored_elements.n_elements(); if (operation == VectorOperation::insert) -- 2.39.5