You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2009/06/02 22:45:53 UTC

svn commit: r781159 - /commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/AdamsIntegratorTest.java

Author: luc
Date: Tue Jun  2 20:45:53 2009
New Revision: 781159

URL: http://svn.apache.org/viewvc?rev=781159&view=rev
Log:
reenabled tests
removed a development test that was committed by error

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

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/AdamsIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/AdamsIntegratorTest.java?rev=781159&r1=781158&r2=781159&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/AdamsIntegratorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/AdamsIntegratorTest.java Tue Jun  2 20:45:53 2009
@@ -31,13 +31,11 @@
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.events.EventHandler;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class AdamsIntegratorTest {
 
     @Test(expected=IntegratorException.class)
-    @Ignore
     public void dimensionCheckBashforth() throws DerivativeException, IntegratorException {
         TestProblem1 pb = new TestProblem1();
         new AdamsIntegrator(3, false, 0.01).integrate(pb,
@@ -49,7 +47,7 @@
     public void decreasingStepsBashforth() throws DerivativeException, IntegratorException {
 
         TestProblemAbstract[] problems = TestProblemFactory.getProblems();
-        for (int k = 3; k < problems.length; ++k) {
+        for (int k = 0; k < problems.length; ++k) {
 
             double previousError = Double.NaN;
             for (int i = 6; i < 10; ++i) {
@@ -84,7 +82,6 @@
     }
 
     @Test
-    @Ignore
     public void smallStepBashforth() throws DerivativeException, IntegratorException {
 
         TestProblem1 pb  = new TestProblem1();
@@ -105,7 +102,6 @@
     }
 
     @Test
-    @Ignore
     public void bigStepBashforth() throws DerivativeException, IntegratorException {
 
         TestProblem1 pb  = new TestProblem1();
@@ -125,7 +121,6 @@
     }
 
     @Test
-    @Ignore
     public void backwardBashforth() throws DerivativeException, IntegratorException {
 
         TestProblem5 pb = new TestProblem5();
@@ -144,7 +139,6 @@
     }
 
     @Test
-    @Ignore
     public void polynomialBashforth() throws DerivativeException, IntegratorException {
         TestProblem6 pb = new TestProblem6();
         double step = Math.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.02;
@@ -167,7 +161,6 @@
     }
 
     @Test
-    @Ignore
     public void serializationBashforth()
         throws IntegratorException, DerivativeException,
                IOException, ClassNotFoundException {
@@ -194,7 +187,6 @@
     }
 
     @Test(expected=IntegratorException.class)
-    @Ignore
     public void dimensionCheckMoulton()
         throws DerivativeException, IntegratorException {
         TestProblem1 pb = new TestProblem1();
@@ -204,7 +196,6 @@
     }
 
     @Test
-    @Ignore
     public void decreasingStepsMoulton()
         throws DerivativeException, IntegratorException {
 
@@ -244,7 +235,6 @@
     }
 
     @Test
-    @Ignore
     public void smallStepMoulton()
         throws DerivativeException, IntegratorException {
 
@@ -266,7 +256,6 @@
     }
 
     @Test
-    @Ignore
     public void bigStepMoulton()
         throws DerivativeException, IntegratorException {
 
@@ -285,7 +274,6 @@
     }
 
     @Test
-    @Ignore
     public void backwardMoulton()
         throws DerivativeException, IntegratorException {
 
@@ -305,7 +293,6 @@
     }
 
     @Test
-    @Ignore
     public void polynomialMoulton()
         throws DerivativeException, IntegratorException {
         TestProblem6 pb = new TestProblem6();
@@ -324,40 +311,4 @@
 
     }
 
-    @Test
-    @Ignore
-    public void comparison()
-        throws DerivativeException, IntegratorException {
-        TestProblem3 pb = new TestProblem3(0.9);
-        double range = Math.abs(pb.getFinalTime() - pb.getInitialTime());
-        FirstOrderIntegrator dp853 =
-            new DormandPrince853Integrator(0, range, 1.0e-8, 1.0e-8);
-        ContinuousOutputModel model1 = new ContinuousOutputModel();
-        dp853.addStepHandler(model1);
-        dp853.integrate(pb, pb.getInitialTime(), pb.getInitialState(),
-                            pb.getFinalTime(), new double[pb.getDimension()]);
-        AdamsIntegrator ab8 = new AdamsIntegrator(8, false, range / 100.0);
-        ab8.setStarterIntegrator(dp853);
-        ContinuousOutputModel model2 = new ContinuousOutputModel();
-        ab8.addStepHandler(model2);
-        ab8.integrate(pb, pb.getInitialTime(), pb.getInitialState(),
-                            pb.getFinalTime(), new double[pb.getDimension()]);
-        AdamsIntegrator am8 = new AdamsIntegrator(8, true, range / 100.0);
-        am8.setStarterIntegrator(dp853);
-        ContinuousOutputModel model3 = new ContinuousOutputModel();
-        am8.addStepHandler(model3);
-        am8.integrate(pb, pb.getInitialTime(), pb.getInitialState(),
-                            pb.getFinalTime(), new double[pb.getDimension()]);
-        for (double t = pb.getInitialTime(); t < pb.getFinalTime(); t += 1.0e-3 * range) {
-            model1.setInterpolatedTime(t);
-            model2.setInterpolatedTime(t);
-            model3.setInterpolatedTime(t);
-            System.out.println(t + " " +
-                               pb.computeTheoreticalState(t)[0] + " " +
-                               (model1.getInterpolatedState()[0]-pb.computeTheoreticalState(t)[0]) + " " +
-                               (model2.getInterpolatedState()[0]-pb.computeTheoreticalState(t)[0]) + " " +
-                               (model3.getInterpolatedState()[0]-pb.computeTheoreticalState(t)[0]));
-        }
-    }
-
 }