]> https://gitweb.dealii.org/ - dealii.git/commitdiff
return immediately if a==0 in p::d::Vector::add(a,V) 5893/head
authorDenis Davydov <davydden@gmail.com>
Tue, 13 Feb 2018 18:32:08 +0000 (19:32 +0100)
committerDenis Davydov <davydden@gmail.com>
Tue, 13 Feb 2018 18:33:47 +0000 (19:33 +0100)
include/deal.II/lac/la_parallel_vector.templates.h

index 6cb5794d83a2f888b5e71627e55df4752033a02b..ea7369deeef4d382cf4aa9cac902468244fdafeb 100644 (file)
@@ -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<Number> vector_add(values.get(), v.values.get(), a);
       internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(),
                                                thread_loop_partitioner);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.