]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Allow for some comparisons to be wrong up to rounding error.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 May 1999 13:15:13 +0000 (13:15 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 May 1999 13:15:13 +0000 (13:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@1341 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/histogram.cc

index 66a2bdbb3c88385232c24bae789b447acb900672..5b7251b035f30ffdbc8407e8c16b89eb6331669a 100644 (file)
@@ -48,7 +48,7 @@ void Histogram::evaluate (const vector<Vector<number> > &values,
   
                                   // first find minimum and maximum value
                                   // in the indicators
-  number min_value, max_value;
+  number min_value=0, max_value=0;
   switch (interval_spacing)
     {
       case linear:
@@ -95,12 +95,13 @@ void Histogram::evaluate (const vector<Vector<number> > &values,
       default:
            Assert (false, ExcInternalError());
     };
-  
-  Assert (max_value >= min_value, ExcInvalidData());
 
                                   // move right bound arbitrarily if
-                                  // necessary
-  if (max_value == min_value)
+                                  // necessary. sometimes in logarithmic
+                                  // mode, max_value may be larger than
+                                  // min_value, but only up to rounding
+                                  // precision.
+  if (max_value <= min_value)
     max_value = min_value+1;
   
 

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.