From ccae62d6072bd780cffe2c64b076856e30d962de Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 13 Feb 2018 19:32:08 +0100 Subject: [PATCH] return immediately if a==0 in p::d::Vector::add(a,V) --- include/deal.II/lac/la_parallel_vector.templates.h | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.39.5