From: Wolfgang Bangerth Date: Fri, 27 Oct 2017 21:51:34 +0000 (-0600) Subject: Use appropriate data types. X-Git-Tag: v9.0.0-rc1~860^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20f4c52bb1506f900e41ed6744ca9f1d147c3b7d;p=dealii.git Use appropriate data types. --- diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 02a967252d..c2e0c59da7 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -18,6 +18,7 @@ #include +#include #include #include #include @@ -1693,9 +1694,9 @@ BlockVectorBase::mean_value () const value_type sum = 0.; // need to do static_cast as otherwise it won't work with value_type=complex for (size_type i=0; i(components[i].size()); + sum += components[i].mean_value() * (typename numbers::NumberTraits::real_type(components[i].size())); - return sum/static_cast(size()); + return sum/(typename numbers::NumberTraits::real_type(size())); }