]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Cast one argument to make sure the compiler can resolve which overload
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Jan 2012 18:35:07 +0000 (18:35 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Jan 2012 18:35:07 +0000 (18:35 +0000)
of std::pow to take.

git-svn-id: https://svn.dealii.org/trunk@24937 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/parallel_vector.h

index 6c42c96712c6d005f828ea91c32b96002bac0a75..326a2cb47ca4a43c0bc02cfa5221d453cd8d5389 100644 (file)
@@ -1251,11 +1251,12 @@ namespace parallel
     typename Vector<Number>::real_type
     Vector<Number>::lp_norm (const real_type p) const
     {
-      Number local_result = (partitioner->local_size()>0 ?
-                            std::pow(vector_view.lp_norm(p),p)
-                            : 0);
-      return std::pow(Utilities::MPI::sum(local_result,
-                                         partitioner->get_communicator()), 1.0/p);
+      const Number local_result = (partitioner->local_size()>0 ?
+                                  std::pow(vector_view.lp_norm(p),p)
+                                  : 0);
+      return std::pow (Utilities::MPI::sum(local_result,
+                                          partitioner->get_communicator()),
+                      static_cast<Number>(1.0/p));
     }
 
 
@@ -1265,9 +1266,9 @@ namespace parallel
     typename Vector<Number>::real_type
     Vector<Number>::linfty_norm () const
     {
-      Number local_result = (partitioner->local_size()>0 ?
-                            vector_view.linfty_norm()
-                            : 0);
+      const Number local_result = (partitioner->local_size()>0 ?
+                                  vector_view.linfty_norm()
+                                  : 0);
       return Utilities::MPI::max (local_result, partitioner->get_communicator());
     }
 

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.