Author: luc
Date: Sun Jun  7 19:12:18 2009
New Revision: 782434

URL: http://svn.apache.org/viewvc?rev=782434&view=rev
Log:
improved max errors computations: previously, NaN values induces the error 
update to be skipped, thus leading to artificially good results

Modified:
    
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemHandler.java

Modified: 
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemHandler.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemHandler.java?rev=782434&r1=782433&r2=782434&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemHandler.java
 (original)
+++ 
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemHandler.java
 Sun Jun  7 19:12:18 2009
@@ -97,9 +97,7 @@
       double[] theoreticalY  = problem.computeTheoreticalState(cT);
       for (int i = 0; i < interpolatedY.length; ++i) {
         double error = Math.abs(interpolatedY[i] - theoreticalY[i]);
-        if (error > lastError) {
-          lastError = error;
-        }
+        lastError = Math.max(error, lastError);
       }
       lastTime = cT;
     }
@@ -115,11 +113,8 @@
       // update the errors
       for (int i = 0; i < interpolatedY.length; ++i) {
         double error = errorScale[i] * Math.abs(interpolatedY[i] - 
theoreticalY[i]);
-        if (error > maxValueError) {
-          maxValueError = error;
-        }
+        maxValueError = Math.max(error, maxValueError);
       }
-
     }
   }
 


Reply via email to