From: Denis Davydov Date: Thu, 27 Oct 2016 12:50:48 +0000 (+0200) Subject: add LinearAlgebra::distributed::Vector::add() with pointers X-Git-Tag: v8.5.0-rc1~541^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c776d28f43160c159ef34954a16361392315393b;p=dealii.git add LinearAlgebra::distributed::Vector::add() with pointers --- 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 &