From: bangerth Date: Thu, 26 Jan 2012 18:35:07 +0000 (+0000) Subject: Cast one argument to make sure the compiler can resolve which overload X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6421c4257585ec305ed53a5fddf2c1fcb61c7322;p=dealii-svn.git Cast one argument to make sure the compiler can resolve which overload of std::pow to take. git-svn-id: https://svn.dealii.org/trunk@24937 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h index 6c42c96712..326a2cb47c 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.h +++ b/deal.II/include/deal.II/lac/parallel_vector.h @@ -1251,11 +1251,12 @@ namespace parallel typename Vector::real_type Vector::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(1.0/p)); } @@ -1265,9 +1266,9 @@ namespace parallel typename Vector::real_type Vector::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()); }