]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use the right datatype for the sum variable when accumulating the
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Dec 2002 16:07:40 +0000 (16:07 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Dec 2002 16:07:40 +0000 (16:07 +0000)
elements of a vector.

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

deal.II/lac/include/lac/sparse_matrix.templates.h

index c55a03baf7332f21579709a36a608fc6d705af3a..db7d609be0e1563ebf90f4cf1e9e812ae547dc0c 100644 (file)
@@ -498,7 +498,7 @@ SparseMatrix<number>::matrix_norm_square (const Vector<somenumber>& v) const
                                       // accumulate the partial results
       return std::accumulate (partial_sums.begin(),
                              partial_sums.end(),
-                             0.);
+                             static_cast<somenumber>(0.));
     }
   else
     {
@@ -612,7 +612,7 @@ SparseMatrix<number>::matrix_scalar_product (const Vector<somenumber>& u,
                                       // accumulate the partial results
       return std::accumulate (partial_sums.begin(),
                              partial_sums.end(),
-                             0.);
+                             static_cast<somenumber>(0.));
     }
   else
     {
@@ -771,7 +771,7 @@ SparseMatrix<number>::residual (Vector<somenumber>       &dst,
                                       // accumulate the partial results
       return std::sqrt(std::accumulate (partial_norms.begin(),
                                        partial_norms.end(),
-                                       0.));
+                                       static_cast<somenumber>(0.)));
     }
   else
     {

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.