From: Denis Davydov Date: Tue, 13 Feb 2018 18:32:08 +0000 (+0100) Subject: return immediately if a==0 in p::d::Vector::add(a,V) X-Git-Tag: v9.0.0-rc1~440^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5893%2Fhead;p=dealii.git return immediately if a==0 in p::d::Vector::add(a,V) --- diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 6cb5794d83..ea7369deee 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -849,6 +849,10 @@ namespace LinearAlgebra AssertIsFinite(a); AssertDimension (local_size(), v.local_size()); + // nothing to do if a is zero + if (a == Number(0.)) + return; + internal::VectorOperations::Vectorization_add_av vector_add(values.get(), v.values.get(), a); internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner);