From c776d28f43160c159ef34954a16361392315393b Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 27 Oct 2016 14:50:48 +0200 Subject: [PATCH] add LinearAlgebra::distributed::Vector::add() with pointers --- include/deal.II/lac/la_parallel_vector.h | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/deal.II/lac/la_parallel_vector.h b/include/deal.II/lac/la_parallel_vector.h index 6c1c2a1582..22723a5c15 100644 --- a/include/deal.II/lac/la_parallel_vector.h +++ b/include/deal.II/lac/la_parallel_vector.h @@ -694,6 +694,15 @@ namespace LinearAlgebra void add (const std::vector &indices, const ::dealii::Vector &values); + /** + * Take an address where n_elements are stored contiguously and add them + * into the vector. + */ + template + void add (const size_type n_elements, + const size_type *indices, + const OtherNumber *values); + /** * Scaling and simple vector addition, i.e. *this = * s*(*this)+V. @@ -1391,6 +1400,24 @@ namespace LinearAlgebra + template + template + inline + void + Vector::add (const size_type n_elements, + const size_type *indices, + const OtherNumber *values) + { + for (size_type i=0; ioperator()(*indices) += *values; + } + } + + + template inline const MPI_Comm & -- 2.39.5