]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use operator= to set vectors to zero
authorMatthias Maier <tamiko@43-1.org>
Mon, 11 May 2015 21:49:56 +0000 (23:49 +0200)
committerMatthias Maier <tamiko@43-1.org>
Mon, 11 May 2015 21:49:56 +0000 (23:49 +0200)
include/deal.II/lac/linear_operator.h

index e465955f7a6c7f07fa16002e535c4ebf50663cad..d02f153fe81c52b91a72cd2dc6e7e742f98d2cd6 100644 (file)
@@ -382,11 +382,11 @@ operator*(typename Range::value_type  number,
 
 
   // the trivial case: number is zero
-  if (number == 0)
+  if (number == 0.)
     {
       return_op.vmult = [] (Range &v, const Domain &)
       {
-        v *= 0;
+        v = 0.;
       };
 
       return_op.vmult_add = [] (Range &, const Domain &)
@@ -395,7 +395,7 @@ operator*(typename Range::value_type  number,
 
       return_op.Tvmult = [](Domain &v, const Range &)
       {
-        v *= 0;
+        v = 0.;
       };
 
       return_op.Tvmult_add = [](Domain &, const Range &)
@@ -404,7 +404,6 @@ operator*(typename Range::value_type  number,
     }
   else
     {
-
       // ensure to have valid computation objects by catching number and op by
       // value
 

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.