commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1037327 [6/7] - in /commons/proper/math/branches/MATH_2_X/src: main/java/org/apache/commons/math/ main/java/org/apache/commons/math/analysis/ main/java/org/apache/commons/math/analysis/integration/ main/java/org/apache/commons/math/analysi...
Date Sat, 20 Nov 2010 20:57:42 GMT
Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -20,7 +20,7 @@ package org.apache.commons.math.ode.nons
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem1;
@@ -33,7 +33,7 @@ import org.junit.Test;
 public class AdamsMoultonIntegratorTest {
 
     @Test(expected=IntegratorException.class)
-    public void dimensionCheck() throws DerivativeException, IntegratorException {
+    public void dimensionCheck() throws MathUserException, IntegratorException {
         TestProblem1 pb = new TestProblem1();
         FirstOrderIntegrator integ =
             new AdamsMoultonIntegrator(2, 0.0, 1.0, 1.0e-10, 1.0e-10);
@@ -43,7 +43,7 @@ public class AdamsMoultonIntegratorTest 
     }
 
     @Test(expected=IntegratorException.class)
-    public void testMinStep() throws DerivativeException, IntegratorException {
+    public void testMinStep() throws MathUserException, IntegratorException {
 
           TestProblem1 pb = new TestProblem1();
           double minStep = 0.1 * (pb.getFinalTime() - pb.getInitialTime());
@@ -64,7 +64,7 @@ public class AdamsMoultonIntegratorTest 
 
     @Test
     public void testIncreasingTolerance()
-        throws DerivativeException, IntegratorException {
+        throws MathUserException, IntegratorException {
 
         int previousCalls = Integer.MAX_VALUE;
         for (int i = -12; i < -2; ++i) {
@@ -99,8 +99,8 @@ public class AdamsMoultonIntegratorTest 
 
     }
 
-    @Test(expected = DerivativeException.class)
-    public void exceedMaxEvaluations() throws DerivativeException, IntegratorException {
+    @Test(expected = MathUserException.class)
+    public void exceedMaxEvaluations() throws MathUserException, IntegratorException {
 
         TestProblem1 pb  = new TestProblem1();
         double range = pb.getFinalTime() - pb.getInitialTime();
@@ -116,7 +116,7 @@ public class AdamsMoultonIntegratorTest 
     }
 
     @Test
-    public void backward() throws DerivativeException, IntegratorException {
+    public void backward() throws MathUserException, IntegratorException {
 
         TestProblem5 pb = new TestProblem5();
         double range = FastMath.abs(pb.getFinalTime() - pb.getInitialTime());
@@ -134,7 +134,7 @@ public class AdamsMoultonIntegratorTest 
     }
 
     @Test
-    public void polynomial() throws DerivativeException, IntegratorException {
+    public void polynomial() throws MathUserException, IntegratorException {
         TestProblem6 pb = new TestProblem6();
         double range = FastMath.abs(pb.getFinalTime() - pb.getInitialTime());
 

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaIntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaIntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaIntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nons
 
 import junit.framework.*;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
@@ -42,7 +42,7 @@ public class ClassicalRungeKuttaIntegrat
     super(name);
   }
 
-  public void testMissedEndEvent() throws IntegratorException, DerivativeException {
+  public void testMissedEndEvent() throws IntegratorException, MathUserException {
       final double   t0     = 1878250320.0000029;
       final double   tEvent = 1878250379.9999986;
       final double[] k      = { 1.0e-4, 1.0e-5, 1.0e-6 };
@@ -102,7 +102,7 @@ public class ClassicalRungeKuttaIntegrat
                                                         0.0, new double[pb.getDimension()+10],
                                                         1.0, new double[pb.getDimension()]);
         fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -112,7 +112,7 @@ public class ClassicalRungeKuttaIntegrat
                                                           0.0, new double[pb.getDimension()],
                                                           1.0, new double[pb.getDimension()+10]);
           fail("an exception should have been thrown");
-      } catch(DerivativeException de) {
+      } catch(MathUserException de) {
         fail("wrong exception caught");
       } catch(IntegratorException ie) {
       }
@@ -122,14 +122,14 @@ public class ClassicalRungeKuttaIntegrat
                                                         0.0, new double[pb.getDimension()],
                                                         0.0, new double[pb.getDimension()]);
         fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
   }
 
   public void testDecreasingSteps()
-    throws DerivativeException, IntegratorException  {
+    throws MathUserException, IntegratorException  {
 
     TestProblemAbstract[] problems = TestProblemFactory.getProblems();
     for (int k = 0; k < problems.length; ++k) {
@@ -170,7 +170,7 @@ public class ClassicalRungeKuttaIntegrat
   }
 
   public void testSmallStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -188,7 +188,7 @@ public class ClassicalRungeKuttaIntegrat
   }
 
   public void testBigStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
@@ -206,7 +206,7 @@ public class ClassicalRungeKuttaIntegrat
   }
 
   public void testBackward()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem5 pb = new TestProblem5();
     double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -224,7 +224,7 @@ public class ClassicalRungeKuttaIntegrat
   }
 
   public void testKepler()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.0003;
@@ -248,7 +248,7 @@ public class ClassicalRungeKuttaIntegrat
       maxError = 0;
     }
     public void handleStep(StepInterpolator interpolator,
-                           boolean isLast) throws DerivativeException {
+                           boolean isLast) throws MathUserException {
 
       double[] interpolatedY = interpolator.getInterpolatedState ();
       double[] theoreticalY  = pb.computeTheoreticalState(interpolator.getCurrentTime());
@@ -270,7 +270,7 @@ public class ClassicalRungeKuttaIntegrat
   }
 
   public void testStepSize()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
       final double step = 1.23456;
       FirstOrderIntegrator integ = new ClassicalRungeKuttaIntegrator(step);
       integ.addStepHandler(new StepHandler() {

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -26,8 +26,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
 import org.apache.commons.math.ode.sampling.StepHandler;
@@ -38,7 +38,7 @@ public class ClassicalRungeKuttaStepInte
 
   @Test
   public void derivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
     ClassicalRungeKuttaIntegrator integ = new ClassicalRungeKuttaIntegrator(step);
@@ -47,7 +47,7 @@ public class ClassicalRungeKuttaStepInte
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem3 pb = new TestProblem3(0.9);

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54IntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54IntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54IntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54IntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem1;
@@ -51,7 +51,7 @@ public class DormandPrince54IntegratorTe
                            0.0, new double[pb.getDimension()+10],
                            1.0, new double[pb.getDimension()+10]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -75,7 +75,7 @@ public class DormandPrince54IntegratorTe
                       pb.getInitialTime(), pb.getInitialState(),
                       pb.getFinalTime(), new double[pb.getDimension()]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -83,7 +83,7 @@ public class DormandPrince54IntegratorTe
   }
 
   public void testSmallLastStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblemAbstract pb = new TestProblem5();
     double minStep = 1.25;
@@ -108,7 +108,7 @@ public class DormandPrince54IntegratorTe
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double minStep = 0;
@@ -162,7 +162,7 @@ public class DormandPrince54IntegratorTe
   }
 
   public void testIncreasingTolerance()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     int previousCalls = Integer.MAX_VALUE;
     for (int i = -12; i < -2; ++i) {
@@ -203,7 +203,7 @@ public class DormandPrince54IntegratorTe
   }
 
   public void testEvents()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem4 pb = new TestProblem4();
     double minStep = 0;
@@ -235,7 +235,7 @@ public class DormandPrince54IntegratorTe
   }
 
   public void testKepler()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double minStep = 0;
@@ -257,7 +257,7 @@ public class DormandPrince54IntegratorTe
   }
 
   public void testVariableSteps()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double minStep = 0;
@@ -288,7 +288,7 @@ public class DormandPrince54IntegratorTe
     }
     public void handleStep(StepInterpolator interpolator,
                            boolean isLast)
-    throws DerivativeException {
+    throws MathUserException {
 
       ++nbSteps;
       for (int a = 1; a < 10; ++a) {

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -27,8 +27,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
 import org.apache.commons.math.ode.sampling.StepHandler;
@@ -41,7 +41,7 @@ public class DormandPrince54StepInterpol
 
   @Test
   public void derivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3(0.1);
     double minStep = 0;
     double maxStep = pb.getFinalTime() - pb.getInitialTime();
@@ -55,7 +55,7 @@ public class DormandPrince54StepInterpol
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem3 pb = new TestProblem3(0.9);
@@ -106,7 +106,7 @@ public class DormandPrince54StepInterpol
 
   @Test
   public void checkClone()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
       TestProblem3 pb = new TestProblem3(0.9);
       double minStep = 0;
       double maxStep = pb.getFinalTime() - pb.getInitialTime();
@@ -117,7 +117,7 @@ public class DormandPrince54StepInterpol
                                                                       scalRelativeTolerance);
       integ.addStepHandler(new StepHandler() {
         public void handleStep(StepInterpolator interpolator, boolean isLast)
-          throws DerivativeException {
+          throws MathUserException {
               StepInterpolator cloned = interpolator.copy();
               double tA = cloned.getPreviousTime();
               double tB = cloned.getCurrentTime();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853IntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853IntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853IntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853IntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
@@ -42,7 +42,7 @@ public class DormandPrince853IntegratorT
     super(name);
   }
 
-  public void testMissedEndEvent() throws IntegratorException, DerivativeException {
+  public void testMissedEndEvent() throws IntegratorException, MathUserException {
       final double   t0     = 1878250320.0000029;
       final double   tEvent = 1878250379.9999986;
       final double[] k  = { 1.0e-4, 1.0e-5, 1.0e-6 };
@@ -107,7 +107,7 @@ public class DormandPrince853IntegratorT
                            0.0, new double[pb.getDimension()+10],
                            1.0, new double[pb.getDimension()+10]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -122,7 +122,7 @@ public class DormandPrince853IntegratorT
                            0.0, new double[pb.getDimension()],
                            0.0, new double[pb.getDimension()]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -146,7 +146,7 @@ public class DormandPrince853IntegratorT
                       pb.getInitialTime(), pb.getInitialState(),
                       pb.getFinalTime(), new double[pb.getDimension()]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -154,7 +154,7 @@ public class DormandPrince853IntegratorT
   }
 
   public void testIncreasingTolerance()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     int previousCalls = Integer.MAX_VALUE;
     for (int i = -12; i < -2; ++i) {
@@ -189,7 +189,7 @@ public class DormandPrince853IntegratorT
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double minStep = 0;
@@ -212,7 +212,7 @@ public class DormandPrince853IntegratorT
   }
 
   public void testEvents()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem4 pb = new TestProblem4();
     double minStep = 0;
@@ -244,7 +244,7 @@ public class DormandPrince853IntegratorT
   }
 
   public void testKepler()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double minStep = 0;
@@ -266,7 +266,7 @@ public class DormandPrince853IntegratorT
   }
 
   public void testVariableSteps()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double minStep = 0;
@@ -286,7 +286,7 @@ public class DormandPrince853IntegratorT
   }
 
   public void testNoDenseOutput()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
     TestProblem1 pb1 = new TestProblem1();
     TestProblem1 pb2 = pb1.copy();
     double minStep = 0.1 * (pb1.getFinalTime() - pb1.getInitialTime());
@@ -316,7 +316,7 @@ public class DormandPrince853IntegratorT
   }
 
   public void testUnstableDerivative()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     final StepProblem stepProblem = new StepProblem(0.0, 1.0, 2.0);
     FirstOrderIntegrator integ =
       new DormandPrince853Integrator(0.1, 10, 1.0e-12, 0.0);
@@ -340,7 +340,7 @@ public class DormandPrince853IntegratorT
     }
     public void handleStep(StepInterpolator interpolator,
                            boolean isLast)
-    throws DerivativeException {
+    throws MathUserException {
 
       ++nbSteps;
       for (int a = 1; a < 10; ++a) {
@@ -417,7 +417,7 @@ public class DormandPrince853IntegratorT
     }
     public void handleStep(StepInterpolator interpolator,
                            boolean isLast)
-    throws DerivativeException {
+    throws MathUserException {
       double prev = interpolator.getPreviousTime();
       double curr = interpolator.getCurrentTime();
       interpolator.setInterpolatedTime(0.5*(prev + curr));

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -27,8 +27,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
 import org.apache.commons.math.ode.sampling.StepHandler;
@@ -41,7 +41,7 @@ public class DormandPrince853StepInterpo
 
   @Test
   public void derivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3(0.1);
     double minStep = 0;
     double maxStep = pb.getFinalTime() - pb.getInitialTime();
@@ -55,7 +55,7 @@ public class DormandPrince853StepInterpo
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem3 pb = new TestProblem3(0.9);
@@ -106,7 +106,7 @@ public class DormandPrince853StepInterpo
 
   @Test
   public void checklone()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3(0.9);
     double minStep = 0;
     double maxStep = pb.getFinalTime() - pb.getInitialTime();
@@ -117,7 +117,7 @@ public class DormandPrince853StepInterpo
                                                                       scalRelativeTolerance);
     integ.addStepHandler(new StepHandler() {
         public void handleStep(StepInterpolator interpolator, boolean isLast)
-        throws DerivativeException {
+        throws MathUserException {
             StepInterpolator cloned = interpolator.copy();
             double tA = cloned.getPreviousTime();
             double tB = cloned.getCurrentTime();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerIntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerIntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerIntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nons
 
 import junit.framework.*;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
@@ -48,14 +48,14 @@ public class EulerIntegratorTest
                                           0.0, new double[pb.getDimension()+10],
                                           1.0, new double[pb.getDimension()+10]);
         fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
   }
 
   public void testDecreasingSteps()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblemAbstract[] problems = TestProblemFactory.getProblems();
     for (int k = 0; k < problems.length; ++k) {
@@ -95,7 +95,7 @@ public class EulerIntegratorTest
   }
 
   public void testSmallStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb  = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -115,7 +115,7 @@ public class EulerIntegratorTest
   }
 
   public void testBigStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb  = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
@@ -134,7 +134,7 @@ public class EulerIntegratorTest
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -152,7 +152,7 @@ public class EulerIntegratorTest
   }
 
   public void testStepSize()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
       final double step = 1.23456;
       FirstOrderIntegrator integ = new EulerIntegrator(step);
       integ.addStepHandler(new StepHandler() {

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -26,8 +26,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem1;
 import org.apache.commons.math.ode.TestProblem3;
@@ -39,7 +39,7 @@ import org.junit.Test;
 public class EulerStepInterpolatorTest {
 
   @Test
-  public void noReset() throws DerivativeException {
+  public void noReset() throws MathUserException {
 
     double[]   y    =   { 0.0, 1.0, -2.0 };
     double[][] yDot = { { 1.0, 2.0, -2.0 } };
@@ -58,7 +58,7 @@ public class EulerStepInterpolatorTest {
 
   @Test
   public void interpolationAtBounds()
-    throws DerivativeException {
+    throws MathUserException {
 
     double   t0 = 0;
     double[] y0 = {0.0, 1.0, -2.0};
@@ -95,7 +95,7 @@ public class EulerStepInterpolatorTest {
 
   @Test
   public void interpolationInside()
-  throws DerivativeException {
+  throws MathUserException {
 
     double[]   y    =   { 1.0, 3.0, -4.0 };
     double[][] yDot = { { 1.0, 2.0, -2.0 } };
@@ -121,7 +121,7 @@ public class EulerStepInterpolatorTest {
 
   @Test
   public void derivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
     EulerIntegrator integ = new EulerIntegrator(step);
@@ -130,7 +130,7 @@ public class EulerStepInterpolatorTest {
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem1 pb = new TestProblem1();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillIntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillIntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillIntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nons
 
 import junit.framework.*;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
@@ -49,14 +49,14 @@ public class GillIntegratorTest
                                          0.0, new double[pb.getDimension()+10],
                                          1.0, new double[pb.getDimension()+10]);
         fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
   }
 
   public void testDecreasingSteps()
-    throws DerivativeException, IntegratorException  {
+    throws MathUserException, IntegratorException  {
 
     TestProblemAbstract[] problems = TestProblemFactory.getProblems();
     for (int k = 0; k < problems.length; ++k) {
@@ -96,7 +96,7 @@ public class GillIntegratorTest
   }
 
   public void testSmallStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -115,7 +115,7 @@ public class GillIntegratorTest
   }
 
   public void testBigStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
@@ -133,7 +133,7 @@ public class GillIntegratorTest
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -151,7 +151,7 @@ public class GillIntegratorTest
   }
 
   public void testKepler()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.0003;
@@ -164,7 +164,7 @@ public class GillIntegratorTest
   }
 
   public void testUnstableDerivative()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     final StepProblem stepProblem = new StepProblem(0.0, 1.0, 2.0);
     FirstOrderIntegrator integ = new GillIntegrator(0.3);
     integ.addEventHandler(stepProblem, 1.0, 1.0e-12, 1000);
@@ -185,7 +185,7 @@ public class GillIntegratorTest
       maxError = 0;
     }
     public void handleStep(StepInterpolator interpolator,
-                           boolean isLast) throws DerivativeException {
+                           boolean isLast) throws MathUserException {
 
       double[] interpolatedY = interpolator.getInterpolatedState();
       double[] theoreticalY  = pb.computeTheoreticalState(interpolator.getCurrentTime());
@@ -207,7 +207,7 @@ public class GillIntegratorTest
   }
 
   public void testStepSize()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
       final double step = 1.23456;
       FirstOrderIntegrator integ = new GillIntegrator(step);
       integ.addStepHandler(new StepHandler() {

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -26,8 +26,8 @@ import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
 import java.io.IOException;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
 import org.apache.commons.math.ode.nonstiff.GillIntegrator;
@@ -39,7 +39,7 @@ public class GillStepInterpolatorTest {
 
   @Test
   public void testDerivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
     GillIntegrator integ = new GillIntegrator(step);
@@ -48,7 +48,7 @@ public class GillStepInterpolatorTest {
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem3 pb = new TestProblem3(0.9);

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem1;
@@ -50,7 +50,7 @@ public class GraggBulirschStoerIntegrato
                            0.0, new double[pb.getDimension()+10],
                            1.0, new double[pb.getDimension()+10]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -65,7 +65,7 @@ public class GraggBulirschStoerIntegrato
                            0.0, new double[pb.getDimension()],
                            0.0, new double[pb.getDimension()]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -89,7 +89,7 @@ public class GraggBulirschStoerIntegrato
                       pb.getInitialTime(), pb.getInitialState(),
                       pb.getFinalTime(), new double[pb.getDimension()]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -97,7 +97,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double minStep = 0;
@@ -120,7 +120,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   public void testIncreasingTolerance()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     int previousCalls = Integer.MAX_VALUE;
     for (int i = -12; i < -4; ++i) {
@@ -157,7 +157,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   public void testIntegratorControls()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
 
     TestProblem3 pb = new TestProblem3(0.999);
     GraggBulirschStoerIntegrator integ =
@@ -186,7 +186,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   private double getMaxError(FirstOrderIntegrator integrator, TestProblemAbstract pb)
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
       TestProblemHandler handler = new TestProblemHandler(pb, integrator);
       integrator.addStepHandler(handler);
       integrator.integrate(pb,
@@ -196,7 +196,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   public void testEvents()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem4 pb = new TestProblem4();
     double minStep = 0;
@@ -228,7 +228,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   public void testKepler()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb = new TestProblem3(0.9);
     double minStep        = 0;
@@ -250,7 +250,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   public void testVariableSteps()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb = new TestProblem3(0.9);
     double minStep        = 0;
@@ -269,7 +269,7 @@ public class GraggBulirschStoerIntegrato
   }
 
   public void testUnstableDerivative()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
     final StepProblem stepProblem = new StepProblem(0.0, 1.0, 2.0);
     FirstOrderIntegrator integ =
       new GraggBulirschStoerIntegrator(0.1, 10, 1.0e-12, 0.0);
@@ -293,7 +293,7 @@ public class GraggBulirschStoerIntegrato
     }
     public void handleStep(StepInterpolator interpolator,
                            boolean isLast)
-    throws DerivativeException {
+    throws MathUserException {
 
       ++nbSteps;
       for (int a = 1; a < 100; ++a) {

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -27,8 +27,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
 import org.apache.commons.math.ode.sampling.StepHandler;
@@ -41,7 +41,7 @@ public class GraggBulirschStoerStepInter
 
   @Test
   public void derivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3(0.9);
     double minStep   = 0;
     double maxStep   = pb.getFinalTime() - pb.getInitialTime();
@@ -56,7 +56,7 @@ public class GraggBulirschStoerStepInter
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem3 pb  = new TestProblem3(0.9);
@@ -108,7 +108,7 @@ public class GraggBulirschStoerStepInter
 
   @Test
   public void checklone()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3(0.9);
     double minStep = 0;
     double maxStep = pb.getFinalTime() - pb.getInitialTime();
@@ -119,7 +119,7 @@ public class GraggBulirschStoerStepInter
                                                                           scalRelativeTolerance);
     integ.addStepHandler(new StepHandler() {
         public void handleStep(StepInterpolator interpolator, boolean isLast)
-        throws DerivativeException {
+        throws MathUserException {
             StepInterpolator cloned = interpolator.copy();
             double tA = cloned.getPreviousTime();
             double tB = cloned.getCurrentTime();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -20,8 +20,8 @@ package org.apache.commons.math.ode.nons
 import junit.framework.TestCase;
 
 import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
@@ -50,11 +50,11 @@ public class HighamHall54IntegratorTest
           new FirstOrderDifferentialEquations() {
             private static final long serialVersionUID = -1157081786301178032L;
             public void computeDerivatives(double t, double[] y, double[] dot)
-            throws DerivativeException {
+            throws MathUserException {
             if (t < -0.5) {
-                throw new DerivativeException(LocalizedFormats.SIMPLE_MESSAGE, "oops");
+                throw new MathUserException(LocalizedFormats.SIMPLE_MESSAGE, "oops");
             } else {
-                throw new DerivativeException(new RuntimeException("oops"));
+                throw new MathUserException(new RuntimeException("oops"));
            }
           }
           public int getDimension() {
@@ -65,14 +65,14 @@ public class HighamHall54IntegratorTest
       try  {
         integrator.integrate(equations, -1.0, new double[1], 0.0, new double[1]);
         fail("an exception should have been thrown");
-      } catch(DerivativeException de) {
+      } catch(MathUserException de) {
         // expected behavior
       }
 
       try  {
         integrator.integrate(equations, 0.0, new double[1], 1.0, new double[1]);
         fail("an exception should have been thrown");
-      } catch(DerivativeException de) {
+      } catch(MathUserException de) {
         // expected behavior
       }
 
@@ -96,7 +96,7 @@ public class HighamHall54IntegratorTest
                       pb.getInitialTime(), pb.getInitialState(),
                       pb.getFinalTime(), new double[pb.getDimension()]);
       fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
@@ -104,7 +104,7 @@ public class HighamHall54IntegratorTest
   }
 
   public void testIncreasingTolerance()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     int previousCalls = Integer.MAX_VALUE;
     for (int i = -12; i < -2; ++i) {
@@ -139,7 +139,7 @@ public class HighamHall54IntegratorTest
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double minStep = 0;
@@ -162,7 +162,7 @@ public class HighamHall54IntegratorTest
   }
 
   public void testEvents()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem4 pb = new TestProblem4();
     double minStep = 0;
@@ -333,7 +333,7 @@ public class HighamHall54IntegratorTest
   }
 
   public void testKepler()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double minStep = 0;
@@ -365,7 +365,7 @@ public class HighamHall54IntegratorTest
       maxError = 0;
     }
     public void handleStep(StepInterpolator interpolator,
-                           boolean isLast) throws DerivativeException {
+                           boolean isLast) throws MathUserException {
 
       ++nbSteps;
       double[] interpolatedY = interpolator.getInterpolatedState();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -27,8 +27,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
 import org.apache.commons.math.ode.sampling.StepHandler;
@@ -41,7 +41,7 @@ public class HighamHall54StepInterpolato
 
   @Test
   public void derivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3(0.1);
     double minStep = 0;
     double maxStep = pb.getFinalTime() - pb.getInitialTime();
@@ -55,7 +55,7 @@ public class HighamHall54StepInterpolato
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem3 pb = new TestProblem3(0.9);
@@ -106,7 +106,7 @@ public class HighamHall54StepInterpolato
 
   @Test
   public void checkClone()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3(0.9);
     double minStep = 0;
     double maxStep = pb.getFinalTime() - pb.getInitialTime();
@@ -117,7 +117,7 @@ public class HighamHall54StepInterpolato
                                                               scalRelativeTolerance);
     integ.addStepHandler(new StepHandler() {
         public void handleStep(StepInterpolator interpolator, boolean isLast)
-        throws DerivativeException {
+        throws MathUserException {
             StepInterpolator cloned = interpolator.copy();
             double tA = cloned.getPreviousTime();
             double tB = cloned.getCurrentTime();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nons
 
 import junit.framework.*;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
@@ -48,14 +48,14 @@ public class MidpointIntegratorTest
                                              0.0, new double[pb.getDimension()+10],
                                              1.0, new double[pb.getDimension()+10]);
         fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
   }
 
   public void testDecreasingSteps()
-    throws DerivativeException, IntegratorException  {
+    throws MathUserException, IntegratorException  {
 
     TestProblemAbstract[] problems = TestProblemFactory.getProblems();
     for (int k = 0; k < problems.length; ++k) {
@@ -95,7 +95,7 @@ public class MidpointIntegratorTest
   }
 
   public void testSmallStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb  = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -115,7 +115,7 @@ public class MidpointIntegratorTest
   }
 
   public void testBigStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb  = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
@@ -134,7 +134,7 @@ public class MidpointIntegratorTest
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -152,7 +152,7 @@ public class MidpointIntegratorTest
   }
 
   public void testStepSize()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
       final double step = 1.23456;
       FirstOrderIntegrator integ = new MidpointIntegrator(step);
       integ.addStepHandler(new StepHandler() {

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -26,8 +26,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem1;
 import org.apache.commons.math.ode.TestProblem3;
@@ -39,7 +39,7 @@ public class MidpointStepInterpolatorTes
 
   @Test
   public void testDerivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
     MidpointIntegrator integ = new MidpointIntegrator(step);
@@ -48,7 +48,7 @@ public class MidpointStepInterpolatorTes
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem1 pb = new TestProblem1();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java Sat Nov 20 20:57:37 2010
@@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nons
 
 import junit.framework.*;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
@@ -49,14 +49,14 @@ public class ThreeEighthesIntegratorTest
                                                   0.0, new double[pb.getDimension()+10],
                                                   1.0, new double[pb.getDimension()+10]);
         fail("an exception should have been thrown");
-    } catch(DerivativeException de) {
+    } catch(MathUserException de) {
       fail("wrong exception caught");
     } catch(IntegratorException ie) {
     }
   }
 
   public void testDecreasingSteps()
-    throws DerivativeException, IntegratorException  {
+    throws MathUserException, IntegratorException  {
 
     TestProblemAbstract[] problems = TestProblemFactory.getProblems();
     for (int k = 0; k < problems.length; ++k) {
@@ -96,7 +96,7 @@ public class ThreeEighthesIntegratorTest
   }
 
  public void testSmallStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -115,7 +115,7 @@ public class ThreeEighthesIntegratorTest
   }
 
   public void testBigStep()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     TestProblem1 pb = new TestProblem1();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
@@ -133,7 +133,7 @@ public class ThreeEighthesIntegratorTest
   }
 
   public void testBackward()
-      throws DerivativeException, IntegratorException {
+      throws MathUserException, IntegratorException {
 
       TestProblem5 pb = new TestProblem5();
       double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
@@ -151,7 +151,7 @@ public class ThreeEighthesIntegratorTest
   }
 
   public void testKepler()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
 
     final TestProblem3 pb  = new TestProblem3(0.9);
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.0003;
@@ -179,7 +179,7 @@ public class ThreeEighthesIntegratorTest
     }
 
     public void handleStep(StepInterpolator interpolator,
-                           boolean isLast) throws DerivativeException {
+                           boolean isLast) throws MathUserException {
 
       double[] interpolatedY = interpolator.getInterpolatedState();
       double[] theoreticalY  = pb.computeTheoreticalState(interpolator.getCurrentTime());
@@ -203,7 +203,7 @@ public class ThreeEighthesIntegratorTest
   }
 
   public void testStepSize()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
       final double step = 1.23456;
       FirstOrderIntegrator integ = new ThreeEighthesIntegrator(step);
       integ.addStepHandler(new StepHandler() {

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -26,8 +26,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
 import org.apache.commons.math.ode.sampling.StepHandler;
@@ -38,7 +38,7 @@ public class ThreeEighthesStepInterpolat
 
   @Test
   public void derivativesConsistency()
-  throws DerivativeException, IntegratorException {
+  throws MathUserException, IntegratorException {
     TestProblem3 pb = new TestProblem3();
     double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
     ThreeEighthesIntegrator integ = new ThreeEighthesIntegrator(step);
@@ -47,7 +47,7 @@ public class ThreeEighthesStepInterpolat
 
   @Test
   public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
            IOException, ClassNotFoundException {
 
     TestProblem3 pb = new TestProblem3(0.9);

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -27,7 +27,9 @@ import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
 import java.io.IOException;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.exception.util.Localizable;
+import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.ode.sampling.AbstractStepInterpolator;
 import org.apache.commons.math.ode.sampling.DummyStepInterpolator;
 import org.apache.commons.math.util.FastMath;
@@ -36,7 +38,7 @@ import org.junit.Test;
 public class DummyStepInterpolatorTest {
 
   @Test
-  public void testNoReset() throws DerivativeException {
+  public void testNoReset() throws MathUserException {
 
     double[]   y    =   { 0.0, 1.0, -2.0 };
     DummyStepInterpolator interpolator = new DummyStepInterpolator(y, new double[y.length], true);
@@ -53,7 +55,7 @@ public class DummyStepInterpolatorTest {
 
   @Test
   public void testFixedState()
-    throws DerivativeException {
+    throws MathUserException {
 
     double[]   y    =   { 1.0, 3.0, -4.0 };
     DummyStepInterpolator interpolator = new DummyStepInterpolator(y, new double[y.length], true);
@@ -77,7 +79,7 @@ public class DummyStepInterpolatorTest {
 
   @Test
   public void testSerialization()
-  throws DerivativeException, IOException, ClassNotFoundException {
+  throws MathUserException, IOException, ClassNotFoundException {
 
     double[]   y    =   { 0.0, 1.0, -2.0 };
     DummyStepInterpolator interpolator = new DummyStepInterpolator(y, new double[y.length], true);
@@ -134,9 +136,8 @@ public class DummyStepInterpolatorTest {
           super(y, new double[y.length], forward);
       }
       @Override
-      protected void doFinalize()
-      throws DerivativeException {
-          throw new DerivativeException(null);
+      protected void doFinalize() throws MathUserException {
+          throw new MathUserException((Localizable) null, LocalizedFormats.SIMPLE_MESSAGE, "");
       }
   }
 

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java Sat Nov 20 20:57:37 2010
@@ -26,8 +26,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Random;
 
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.ContinuousOutputModel;
-import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem1;
 import org.apache.commons.math.ode.TestProblem3;
@@ -38,7 +38,7 @@ public class NordsieckStepInterpolatorTe
 
     @Test
     public void derivativesConsistency()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
         TestProblem3 pb = new TestProblem3();
         AdamsBashforthIntegrator integ = new AdamsBashforthIntegrator(4, 0.0, 1.0, 1.0e-10, 1.0e-10);
         StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 7e-10);
@@ -46,7 +46,7 @@ public class NordsieckStepInterpolatorTe
 
     @Test
     public void serialization()
-    throws DerivativeException, IntegratorException,
+    throws MathUserException, IntegratorException,
     IOException, ClassNotFoundException {
 
         TestProblem1 pb = new TestProblem1();

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java Sat Nov 20 20:57:37 2010
@@ -18,7 +18,7 @@ package org.apache.commons.math.ode.samp
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblemAbstract;
@@ -29,7 +29,7 @@ public class StepInterpolatorTestUtils {
     public static void checkDerivativesConsistency(final FirstOrderIntegrator integrator,
                                                    final TestProblemAbstract problem,
                                                    final double threshold)
-        throws DerivativeException, IntegratorException {
+        throws MathUserException, IntegratorException {
         integrator.addStepHandler(new StepHandler() {
 
             public boolean requiresDenseOutput() {
@@ -37,7 +37,7 @@ public class StepInterpolatorTestUtils {
             }
 
             public void handleStep(StepInterpolator interpolator, boolean isLast)
-                throws DerivativeException {
+                throws MathUserException {
 
                 final double h = 0.001 * (interpolator.getCurrentTime() - interpolator.getPreviousTime());
                 final double t = interpolator.getCurrentTime() - 300 * h;

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java Sat Nov 20 20:57:37 2010
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.sampling;
 
-import org.apache.commons.math.ode.DerivativeException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.TestProblem3;
@@ -38,7 +38,7 @@ public class StepNormalizerTest
   }
 
   public void testBoundaries()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
     double range = pb.getFinalTime() - pb.getInitialTime();
     setLastSeen(false);
     integ.addStepHandler(new StepNormalizer(range / 10.0,
@@ -66,7 +66,7 @@ public class StepNormalizerTest
   }
 
   public void testBeforeEnd()
-    throws DerivativeException, IntegratorException {
+    throws MathUserException, IntegratorException {
     final double range = pb.getFinalTime() - pb.getInitialTime();
     setLastSeen(false);
     integ.addStepHandler(new StepNormalizer(range / 10.5,

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java Sat Nov 20 20:57:37 2010
@@ -23,11 +23,11 @@ import static org.junit.Assert.assertTru
 import java.awt.geom.Point2D;
 import java.util.ArrayList;
 
-import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateRealFunction;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
 import org.apache.commons.math.analysis.MultivariateVectorialFunction;
 import org.apache.commons.math.analysis.solvers.BrentSolver;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.general.ConjugateGradientFormula;
 import org.apache.commons.math.optimization.general.NonLinearConjugateGradientOptimizer;
 import org.apache.commons.math.random.GaussianRandomGenerator;
@@ -39,7 +39,7 @@ import org.junit.Test;
 public class MultiStartDifferentiableMultivariateRealOptimizerTest {
 
     @Test
-    public void testCircleFitting() throws FunctionEvaluationException, OptimizationException {
+    public void testCircleFitting() throws MathUserException, OptimizationException {
         Circle circle = new Circle();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);
@@ -123,7 +123,7 @@ public class MultiStartDifferentiableMul
         }
 
         public double value(double[] variables)
-        throws IllegalArgumentException, FunctionEvaluationException {
+        throws IllegalArgumentException, MathUserException {
 
             Point2D.Double center = new Point2D.Double(variables[0], variables[1]);
             double radius = getRadius(center);

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java Sat Nov 20 20:57:37 2010
@@ -23,9 +23,9 @@ import static org.junit.Assert.fail;
 
 import java.io.Serializable;
 
-import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
 import org.apache.commons.math.analysis.MultivariateMatrixFunction;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.linear.BlockRealMatrix;
 import org.apache.commons.math.linear.RealMatrix;
 import org.apache.commons.math.optimization.general.GaussNewtonOptimizer;
@@ -100,7 +100,7 @@ import org.junit.Test;
 public class MultiStartDifferentiableMultivariateVectorialOptimizerTest {
 
     @Test
-    public void testTrivial() throws FunctionEvaluationException, OptimizationException {
+    public void testTrivial() throws MathUserException, OptimizationException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
         DifferentiableMultivariateVectorialOptimizer underlyingOptimizer =
@@ -142,7 +142,7 @@ public class MultiStartDifferentiableMul
     }
 
     @Test(expected = OptimizationException.class)
-    public void testNoOptimum() throws FunctionEvaluationException, OptimizationException {
+    public void testNoOptimum() throws MathUserException, OptimizationException {
         DifferentiableMultivariateVectorialOptimizer underlyingOptimizer =
             new GaussNewtonOptimizer(true);
         JDKRandomGenerator g = new JDKRandomGenerator();
@@ -158,8 +158,8 @@ public class MultiStartDifferentiableMul
                 public MultivariateMatrixFunction jacobian() {
                     return null;
                 }
-                public double[] value(double[] point) throws FunctionEvaluationException {
-                    throw new FunctionEvaluationException(point[0]);
+                public double[] value(double[] point) throws MathUserException {
+                    throw new MathUserException();
                 }
             }, new double[] { 2 }, new double[] { 1 }, new double[] { 0 });
     }

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java Sat Nov 20 20:57:37 2010
@@ -21,8 +21,8 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.math.ConvergenceException;
-import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.direct.NelderMead;
 import org.apache.commons.math.random.GaussianRandomGenerator;
 import org.apache.commons.math.random.JDKRandomGenerator;
@@ -34,7 +34,7 @@ public class MultiStartMultivariateRealO
 
   @Test
   public void testRosenbrock()
-    throws FunctionEvaluationException, ConvergenceException {
+    throws MathUserException, ConvergenceException {
 
     Rosenbrock rosenbrock = new Rosenbrock();
     NelderMead underlying = new NelderMead();
@@ -67,7 +67,7 @@ public class MultiStartMultivariateRealO
           count = 0;
       }
 
-      public double value(double[] x) throws FunctionEvaluationException {
+      public double value(double[] x) throws MathUserException {
           ++count;
           double a = x[1] - x[0] * x[0];
           double b = 1.0 - x[0];

Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java?rev=1037327&r1=1037326&r2=1037327&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java Sat Nov 20 20:57:37 2010
@@ -18,8 +18,9 @@
 package org.apache.commons.math.optimization.direct;
 
 import org.apache.commons.math.ConvergenceException;
-import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
+import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.optimization.GoalType;
 import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.RealPointValuePair;
@@ -31,15 +32,15 @@ import org.junit.Test;
 public class MultiDirectionalTest {
 
   @Test
-  public void testFunctionEvaluationExceptions() throws OptimizationException {
+  public void testMathUserException() throws OptimizationException, MathUserException, IllegalArgumentException {
       MultivariateRealFunction wrong =
           new MultivariateRealFunction() {
             private static final long serialVersionUID = 4751314470965489371L;
-            public double value(double[] x) throws FunctionEvaluationException {
+            public double value(double[] x) throws MathUserException {
                 if (x[0] < 0) {
-                    throw new FunctionEvaluationException(x, "{0}", "oops");
+                    throw new MathUserException(LocalizedFormats.SIMPLE_MESSAGE, "oops");
                 } else if (x[0] > 1) {
-                    throw new FunctionEvaluationException(new RuntimeException("oops"), x);
+                    throw new MathUserException(new RuntimeException("oops"));
                 } else {
                     return x[0] * (1 - x[0]);
                 }
@@ -49,7 +50,7 @@ public class MultiDirectionalTest {
           MultiDirectional optimizer = new MultiDirectional(0.9, 1.9);
           optimizer.optimize(wrong, GoalType.MINIMIZE, new double[] { -1.0 });
           Assert.fail("an exception should have been thrown");
-      } catch (FunctionEvaluationException ce) {
+      } catch (MathUserException ce) {
           // expected behavior
           Assert.assertNull(ce.getCause());
       }
@@ -57,7 +58,7 @@ public class MultiDirectionalTest {
           MultiDirectional optimizer = new MultiDirectional(0.9, 1.9);
           optimizer.optimize(wrong, GoalType.MINIMIZE, new double[] { +2.0 });
           Assert.fail("an exception should have been thrown");
-      } catch (FunctionEvaluationException ce) {
+      } catch (MathUserException ce) {
           // expected behavior
           Assert.assertNotNull(ce.getCause());
       }
@@ -65,7 +66,7 @@ public class MultiDirectionalTest {
 
   @Test
   public void testMinimizeMaximize()
-      throws FunctionEvaluationException, ConvergenceException {
+      throws MathUserException, ConvergenceException {
 
       // the following function has 4 local extrema:
       final double xM        = -3.841947088256863675365;
@@ -78,7 +79,7 @@ public class MultiDirectionalTest {
       final double valueXpYp = -valueXpYm;                // global maximum
       MultivariateRealFunction fourExtrema = new MultivariateRealFunction() {
           private static final long serialVersionUID = -7039124064449091152L;
-          public double value(double[] variables) throws FunctionEvaluationException {
+          public double value(double[] variables) throws MathUserException {
               final double x = variables[0];
               final double y = variables[1];
               return ((x == 0) || (y == 0)) ? 0 : (FastMath.atan(x) * FastMath.atan(x + 2) * FastMath.atan(y) * FastMath.atan(y) / (x * y));
@@ -126,12 +127,12 @@ public class MultiDirectionalTest {
 
   @Test
   public void testRosenbrock()
-    throws FunctionEvaluationException, ConvergenceException {
+    throws MathUserException, ConvergenceException {
 
     MultivariateRealFunction rosenbrock =
       new MultivariateRealFunction() {
         private static final long serialVersionUID = -9044950469615237490L;
-        public double value(double[] x) throws FunctionEvaluationException {
+        public double value(double[] x) throws MathUserException {
           ++count;
           double a = x[1] - x[0] * x[0];
           double b = 1.0 - x[0];
@@ -158,12 +159,12 @@ public class MultiDirectionalTest {
 
   @Test
   public void testPowell()
-    throws FunctionEvaluationException, ConvergenceException {
+    throws MathUserException, ConvergenceException {
 
     MultivariateRealFunction powell =
       new MultivariateRealFunction() {
         private static final long serialVersionUID = -832162886102041840L;
-        public double value(double[] x) throws FunctionEvaluationException {
+        public double value(double[] x) throws MathUserException {
           ++count;
           double a = x[0] + 10 * x[1];
           double b = x[2] - x[3];
@@ -188,7 +189,7 @@ public class MultiDirectionalTest {
 
   @Test
   public void testMath283()
-      throws FunctionEvaluationException, OptimizationException {
+      throws MathUserException, OptimizationException {
       // fails because MultiDirectional.iterateSimplex is looping forever
       // the while(true) should be replaced with a convergence check
       MultiDirectional multiDirectional = new MultiDirectional();



Mime
View raw message