commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1037328 [5/5] - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/analysis/ main/java/org/apache/commons/math/analysis/integration/ main/java/org/apache/commons/math/analysis/solvers/ main/java/org/apache/commons/math/ex...
Date Sat, 20 Nov 2010 21:01:55 GMT
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesIntegratorTest.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/DummyStepInterpolatorTest.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolatorTest.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepInterpolatorTestUtils.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ode/sampling/StepNormalizerTest.java Sat Nov 20 21:01:50 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/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java Sat Nov 20 21:01:50 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.exception.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 {
+    public void testCircleFitting() throws MathUserException {
         Circle circle = new Circle();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);
@@ -114,7 +114,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/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java Sat Nov 20 21:01:50 2010
@@ -23,8 +23,8 @@ import static org.junit.Assert.fail;
 
 import java.io.Serializable;
 
-import org.apache.commons.math.exception.FunctionEvaluationException;
 import org.apache.commons.math.exception.ConvergenceException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
 import org.apache.commons.math.analysis.MultivariateMatrixFunction;
 import org.apache.commons.math.linear.BlockRealMatrix;
@@ -101,7 +101,7 @@ import org.junit.Test;
 public class MultiStartDifferentiableMultivariateVectorialOptimizerTest {
 
     @Test
-    public void testTrivial() throws FunctionEvaluationException {
+    public void testTrivial() throws MathUserException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
         DifferentiableMultivariateVectorialOptimizer underlyingOptimizer =
@@ -138,8 +138,8 @@ public class MultiStartDifferentiableMul
         assertEquals(100, optimizer.getMaxEvaluations());
     }
 
-    @Test(expected = ConvergenceException.class)
-    public void testNoOptimum() throws FunctionEvaluationException {
+    @Test(expected = MathUserException.class)
+    public void testNoOptimum() throws MathUserException {
         DifferentiableMultivariateVectorialOptimizer underlyingOptimizer =
             new GaussNewtonOptimizer(true);
         JDKRandomGenerator g = new JDKRandomGenerator();
@@ -155,8 +155,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/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java Sat Nov 20 21:01:50 2010
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.math.analysis.MultivariateRealFunction;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.direct.SimplexOptimizer;
 import org.apache.commons.math.optimization.direct.NelderMeadSimplex;
 import org.apache.commons.math.random.GaussianRandomGenerator;
@@ -31,7 +32,7 @@ import org.junit.Test;
 
 public class MultiStartMultivariateRealOptimizerTest {
     @Test
-    public void testRosenbrock() {
+    public void testRosenbrock() throws MathUserException {
         Rosenbrock rosenbrock = new Rosenbrock();
         SimplexOptimizer underlying = new SimplexOptimizer();
         NelderMeadSimplex simplex = new NelderMeadSimplex(new double[][] {

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java Sat Nov 20 21:01:50 2010
@@ -16,7 +16,6 @@
  */
 package org.apache.commons.math.optimization.direct;
 
-import org.apache.commons.math.exception.FunctionEvaluationException;
 import org.apache.commons.math.MathException;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
 import org.apache.commons.math.analysis.SumSincFunction;
@@ -59,8 +58,7 @@ public class PowellOptimizerTest {
     @Test
     public void testQuadratic() throws MathException {
         final MultivariateRealFunction func = new MultivariateRealFunction() {
-                public double value(double[] x)
-                    throws FunctionEvaluationException {
+                public double value(double[] x) {
                     final double a = x[0] - 1;
                     final double b = x[1] - 1;
                     return a * a + b * b + 1;
@@ -91,8 +89,7 @@ public class PowellOptimizerTest {
     @Test
     public void testMaximizeQuadratic() throws MathException {
         final MultivariateRealFunction func = new MultivariateRealFunction() {
-                public double value(double[] x)
-                    throws FunctionEvaluationException {
+                public double value(double[] x) {
                     final double a = x[0] - 1;
                     final double b = x[1] - 1;
                     return -a * a - b * b + 1;

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerMultiDirectionalTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerMultiDirectionalTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerMultiDirectionalTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerMultiDirectionalTest.java Sat Nov 20 21:01:50 2010
@@ -17,8 +17,8 @@
 
 package org.apache.commons.math.optimization.direct;
 
-import org.apache.commons.math.exception.FunctionEvaluationException;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.GoalType;
 import org.apache.commons.math.optimization.RealPointValuePair;
 import org.apache.commons.math.optimization.SimpleScalarValueChecker;
@@ -28,7 +28,7 @@ import org.junit.Test;
 
 public class SimplexOptimizerMultiDirectionalTest {
     @Test
-    public void testMinimizeMaximize() throws FunctionEvaluationException {
+    public void testMinimizeMaximize() throws MathUserException {
         // the following function has 4 local extrema:
         final double xM        = -3.841947088256863675365;
         final double yM        = -1.391745200270734924416;
@@ -40,7 +40,7 @@ public class SimplexOptimizerMultiDirect
         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 :
@@ -86,11 +86,11 @@ public class SimplexOptimizerMultiDirect
     }
 
     @Test
-    public void testRosenbrock() throws FunctionEvaluationException {
+    public void testRosenbrock() throws MathUserException {
         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];
@@ -114,11 +114,11 @@ public class SimplexOptimizerMultiDirect
     }
 
     @Test
-    public void testPowell() throws FunctionEvaluationException {
+    public void testPowell() throws MathUserException {
         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];
@@ -141,7 +141,7 @@ public class SimplexOptimizerMultiDirect
     }
 
     @Test
-    public void testMath283() throws FunctionEvaluationException {
+    public void testMath283() throws MathUserException {
         // fails because MultiDirectional.iterateSimplex is looping forever
         // the while(true) should be replaced with a convergence check
         SimplexOptimizer optimizer = new SimplexOptimizer();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerNelderMeadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerNelderMeadTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerNelderMeadTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/SimplexOptimizerNelderMeadTest.java Sat Nov 20 21:01:50 2010
@@ -19,7 +19,8 @@ package org.apache.commons.math.optimiza
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import org.apache.commons.math.exception.FunctionEvaluationException;
+
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.TooManyEvaluationsException;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
 import org.apache.commons.math.analysis.MultivariateVectorialFunction;
@@ -33,7 +34,7 @@ import org.junit.Test;
 public class SimplexOptimizerNelderMeadTest {
     @Test
     public void testMinimizeMaximize()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         // the following function has 4 local extrema:
         final double xM        = -3.841947088256863675365;
@@ -46,7 +47,7 @@ public class SimplexOptimizerNelderMeadT
         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) {
                     final double x = variables[0];
                     final double y = variables[1];
                     return (x == 0 || y == 0) ? 0 :
@@ -92,7 +93,7 @@ public class SimplexOptimizerNelderMeadT
 
     @Test
     public void testRosenbrock()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         Rosenbrock rosenbrock = new Rosenbrock();
         SimplexOptimizer optimizer = new SimplexOptimizer(-1, 1e-3);
@@ -111,7 +112,7 @@ public class SimplexOptimizerNelderMeadT
 
     @Test
     public void testPowell()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         Powell powell = new Powell();
         SimplexOptimizer optimizer = new SimplexOptimizer(-1, 1e-3);
@@ -127,7 +128,7 @@ public class SimplexOptimizerNelderMeadT
 
     @Test
     public void testLeastSquares1()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         final RealMatrix factors =
             new Array2DRowRealMatrix(new double[][] {
@@ -153,7 +154,7 @@ public class SimplexOptimizerNelderMeadT
 
     @Test
     public void testLeastSquares2()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         final RealMatrix factors =
             new Array2DRowRealMatrix(new double[][] {
@@ -179,7 +180,7 @@ public class SimplexOptimizerNelderMeadT
 
     @Test
     public void testLeastSquares3()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         final RealMatrix factors =
             new Array2DRowRealMatrix(new double[][] {
@@ -206,7 +207,7 @@ public class SimplexOptimizerNelderMeadT
     }
 
     @Test(expected = TooManyEvaluationsException.class)
-    public void testMaxIterations() throws FunctionEvaluationException {
+    public void testMaxIterations() throws MathUserException {
         Powell powell = new Powell();
         SimplexOptimizer optimizer = new SimplexOptimizer(-1, 1e-3);
         optimizer.setMaxEvaluations(20);
@@ -221,7 +222,7 @@ public class SimplexOptimizerNelderMeadT
             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];
@@ -240,7 +241,7 @@ public class SimplexOptimizerNelderMeadT
             count = 0;
         }
 
-        public double value(double[] x) throws FunctionEvaluationException {
+        public double value(double[] x) {
             ++count;
             double a = x[0] + 10 * x[1];
             double b = x[2] - x[3];

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java Sat Nov 20 21:01:50 2010
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.optimization.fitting;
 
-import org.apache.commons.math.exception.FunctionEvaluationException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer;
 import org.apache.commons.math.util.FastMath;
 import org.junit.Assert;
@@ -27,7 +27,7 @@ public class CurveFitterTest {
 
     @Test
     public void testMath303()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter fitter = new CurveFitter(optimizer);
@@ -51,7 +51,7 @@ public class CurveFitterTest {
 
     @Test
     public void testMath304()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter fitter = new CurveFitter(optimizer);
@@ -74,7 +74,7 @@ public class CurveFitterTest {
 
     @Test
     public void testMath372()
-    throws FunctionEvaluationException {
+    throws MathUserException {
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter curveFitter = new CurveFitter(optimizer);
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java Sat Nov 20 21:01:50 2010
@@ -19,7 +19,7 @@ package org.apache.commons.math.optimiza
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.commons.math.exception.FunctionEvaluationException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.general.
        LevenbergMarquardtOptimizer;
@@ -185,11 +185,11 @@ public class GaussianFitterTest {
      * Basic.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit01()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET1, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -203,11 +203,11 @@ public class GaussianFitterTest {
      * Zero points is not enough observed points.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test(expected=IllegalArgumentException.class)
     public void testFit02()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         fitter.fit();
     }
@@ -216,11 +216,11 @@ public class GaussianFitterTest {
      * Two points is not enough observed points.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test(expected=IllegalArgumentException.class)
     public void testFit03()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(new double[][] {
             {4.0254623,  531026.0},
@@ -233,11 +233,11 @@ public class GaussianFitterTest {
      * Poor data: right of peak not symmetric with left of peak.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit04()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET2, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -251,11 +251,11 @@ public class GaussianFitterTest {
      * Poor data: long tails.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit05()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET3, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -269,11 +269,11 @@ public class GaussianFitterTest {
      * Poor data: right of peak is missing.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit06()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET4, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -287,11 +287,11 @@ public class GaussianFitterTest {
      * Basic with smaller dataset.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit07()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET5, fitter);
         GaussianFunction fitFunction = fitter.fit();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java Sat Nov 20 21:01:50 2010
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.optimization.fitting;
 
-import org.apache.commons.math.exception.FunctionEvaluationException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.ZeroException;
 import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.fitting.CurveFitter;
@@ -72,11 +72,11 @@ public class ParametricGaussianFunctionT
      * Using not-so-good initial parameters.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit01()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         CurveFitter fitter = new CurveFitter(new LevenbergMarquardtOptimizer());
         addDatasetToCurveFitter(DATASET1, fitter);
         double[] parameters = fitter.fit(new ParametricGaussianFunction(),
@@ -91,11 +91,11 @@ public class ParametricGaussianFunctionT
      * Using eye-balled guesses for initial parameters.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit02()
-    throws OptimizationException, FunctionEvaluationException {
+    throws OptimizationException, MathUserException {
         CurveFitter fitter = new CurveFitter(new LevenbergMarquardtOptimizer());
         addDatasetToCurveFitter(DATASET1, fitter);
         double[] parameters = fitter.fit(new ParametricGaussianFunction(),
@@ -109,10 +109,10 @@ public class ParametricGaussianFunctionT
     /**
      * The parameters array is null.
      *
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test(expected=IllegalArgumentException.class)
-    public void testValue01() throws FunctionEvaluationException {
+    public void testValue01() throws MathUserException {
         ParametricGaussianFunction f = new ParametricGaussianFunction();
         f.value(0.0, null);
     }
@@ -120,10 +120,10 @@ public class ParametricGaussianFunctionT
     /**
      * The parameters array length is not 4.
      *
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test(expected=IllegalArgumentException.class)
-    public void testValue02() throws FunctionEvaluationException {
+    public void testValue02() throws MathUserException {
         ParametricGaussianFunction f = new ParametricGaussianFunction();
         f.value(0.0, new double[] {0.0, 1.0});
     }
@@ -131,10 +131,10 @@ public class ParametricGaussianFunctionT
     /**
      * The parameters d is 0.
      *
-     * @throws FunctionEvaluationException in the event of a test case error
+     * @throws MathUserException in the event of a test case error
      */
     @Test(expected=ZeroException.class)
-    public void testValue03() throws FunctionEvaluationException {
+    public void testValue03() throws MathUserException {
         ParametricGaussianFunction f = new ParametricGaussianFunction();
         f.value(0.0, new double[] {0.0, 1.0, 1.0, 0.0});
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java Sat Nov 20 21:01:50 2010
@@ -24,8 +24,7 @@ import java.util.Arrays;
 
 import junit.framework.TestCase;
 
-import org.apache.commons.math.exception.SingularMatrixException;
-import org.apache.commons.math.exception.FunctionEvaluationException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.ConvergenceException;
 import org.apache.commons.math.exception.TooManyEvaluationsException;
 import org.apache.commons.math.exception.DimensionMismatchException;
@@ -107,7 +106,7 @@ extends TestCase {
         super(name);
     }
 
-    public void testTrivial() throws FunctionEvaluationException {
+    public void testTrivial() throws MathUserException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
         GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
@@ -120,7 +119,7 @@ extends TestCase {
         assertEquals(3.0, optimum.getValue()[0], 1.0e-10);
     }
 
-    public void testColumnsPermutation() throws FunctionEvaluationException {
+    public void testColumnsPermutation() throws MathUserException {
 
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1.0, -1.0 }, { 0.0, 2.0 }, { 1.0, -2.0 } },
@@ -140,7 +139,7 @@ extends TestCase {
 
     }
 
-    public void testNoDependency() throws FunctionEvaluationException {
+    public void testNoDependency() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 2, 0, 0, 0, 0, 0 },
                 { 0, 2, 0, 0, 0, 0 },
@@ -161,7 +160,7 @@ extends TestCase {
         }
     }
 
-    public void testOneSet() throws FunctionEvaluationException {
+    public void testOneSet() throws MathUserException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1,  0, 0 },
@@ -180,7 +179,7 @@ extends TestCase {
 
     }
 
-    public void testTwoSets() throws FunctionEvaluationException {
+    public void testTwoSets() throws MathUserException {
         double epsilon = 1.0e-7;
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  2,  1,   0,  4,       0, 0 },
@@ -225,7 +224,7 @@ extends TestCase {
         }
     }
 
-    public void testIllConditioned() throws FunctionEvaluationException {
+    public void testIllConditioned() throws MathUserException {
         LinearProblem problem1 = new LinearProblem(new double[][] {
                 { 10.0, 7.0,  8.0,  7.0 },
                 {  7.0, 5.0,  6.0,  5.0 },
@@ -301,7 +300,7 @@ extends TestCase {
         }
     }
 
-    public void testRedundantEquations() throws FunctionEvaluationException {
+    public void testRedundantEquations() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -320,7 +319,7 @@ extends TestCase {
 
     }
 
-    public void testInconsistentEquations() throws FunctionEvaluationException {
+    public void testInconsistentEquations() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -335,7 +334,7 @@ extends TestCase {
 
     }
 
-    public void testInconsistentSizes() throws FunctionEvaluationException {
+    public void testInconsistentSizes() throws MathUserException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1, 0 }, { 0, 1 } }, new double[] { -1, 1 });
         GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
@@ -388,7 +387,7 @@ extends TestCase {
         }
     }
 
-    public void testCircleFitting() throws FunctionEvaluationException {
+    public void testCircleFitting() throws MathUserException {
         Circle circle = new Circle();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);
@@ -409,7 +408,7 @@ extends TestCase {
         assertEquals(48.135167894714,   center.y, 1.0e-10);
     }
 
-    public void testCircleFittingBadInit() throws FunctionEvaluationException {
+    public void testCircleFittingBadInit() throws MathUserException {
         Circle circle = new Circle();
         double[][] points = new double[][] {
                 {-0.312967,  0.072366}, {-0.339248,  0.132965}, {-0.379780,  0.202724},

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java Sat Nov 20 21:01:50 2010
@@ -25,20 +25,20 @@ import java.util.List;
 
 import junit.framework.TestCase;
 
-import org.apache.commons.math.exception.SingularMatrixException;
-import org.apache.commons.math.exception.FunctionEvaluationException;
+import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
+import org.apache.commons.math.analysis.MultivariateMatrixFunction;
 import org.apache.commons.math.exception.ConvergenceException;
 import org.apache.commons.math.exception.DimensionMismatchException;
-import org.apache.commons.math.exception.TooManyEvaluationsException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.NumberIsTooSmallException;
-import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
-import org.apache.commons.math.analysis.MultivariateMatrixFunction;
+import org.apache.commons.math.exception.SingularMatrixException;
+import org.apache.commons.math.exception.TooManyEvaluationsException;
 import org.apache.commons.math.linear.BlockRealMatrix;
 import org.apache.commons.math.linear.RealMatrix;
 import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
 import org.apache.commons.math.optimization.VectorialPointValuePair;
-import org.apache.commons.math.util.MathUtils;
 import org.apache.commons.math.util.FastMath;
+import org.apache.commons.math.util.MathUtils;
 
 /**
  * <p>Some of the unit tests are re-implementations of the MINPACK <a
@@ -109,7 +109,7 @@ public class LevenbergMarquardtOptimizer
         super(name);
     }
 
-    public void testTrivial() {
+    public void testTrivial() throws MathUserException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
@@ -126,7 +126,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals(3.0, optimum.getValue()[0], 1.0e-10);
     }
 
-    public void testQRColumnsPermutation() {
+    public void testQRColumnsPermutation() throws MathUserException {
 
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1.0, -1.0 }, { 0.0, 2.0 }, { 1.0, -2.0 } },
@@ -143,7 +143,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals(1.0, optimum.getValue()[2], 1.0e-10);
     }
 
-    public void testNoDependency() {
+    public void testNoDependency() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 2, 0, 0, 0, 0, 0 },
                 { 0, 2, 0, 0, 0, 0 },
@@ -162,7 +162,7 @@ public class LevenbergMarquardtOptimizer
         }
     }
 
-    public void testOneSet() {
+    public void testOneSet() throws MathUserException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1,  0, 0 },
@@ -178,7 +178,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals(3.0, optimum.getPoint()[2], 1.0e-10);
     }
 
-    public void testTwoSets() {
+    public void testTwoSets() throws MathUserException {
         double epsilon = 1.0e-7;
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  2,  1,   0,  4,       0, 0 },
@@ -202,7 +202,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals( 1.0 - epsilon, optimum.getPoint()[5], 1.0e-10);
     }
 
-    public void testNonInvertible() {
+    public void testNonInvertible() throws MathUserException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1, 2, -3 },
@@ -221,7 +221,7 @@ public class LevenbergMarquardtOptimizer
         }
     }
 
-    public void testIllConditioned() {
+    public void testIllConditioned() throws MathUserException {
         LinearProblem problem1 = new LinearProblem(new double[][] {
                 { 10.0, 7.0,  8.0,  7.0 },
                 {  7.0, 5.0,  6.0,  5.0 },
@@ -254,7 +254,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals( 22.0, optimum2.getPoint()[3], 1.0e-8);
     }
 
-    public void testMoreEstimatedParametersSimple() {
+    public void testMoreEstimatedParametersSimple() throws MathUserException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 3.0, 2.0,  0.0, 0.0 },
@@ -268,7 +268,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals(0, optimizer.getRMS(), 1.0e-10);
     }
 
-    public void testMoreEstimatedParametersUnsorted() {
+    public void testMoreEstimatedParametersUnsorted() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0, 1.0,  0.0,  0.0, 0.0,  0.0 },
                 { 0.0, 0.0,  1.0,  1.0, 1.0,  0.0 },
@@ -288,7 +288,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals(6.0, optimum.getPointRef()[5], 1.0e-10);
     }
 
-    public void testRedundantEquations() {
+    public void testRedundantEquations() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -304,7 +304,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals(1.0, optimum.getPointRef()[1], 1.0e-10);
     }
 
-    public void testInconsistentEquations() {
+    public void testInconsistentEquations() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -316,7 +316,7 @@ public class LevenbergMarquardtOptimizer
         assertTrue(optimizer.getRMS() > 0.1);
     }
 
-    public void testInconsistentSizes() {
+    public void testInconsistentSizes() throws MathUserException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1, 0 }, { 0, 1 } }, new double[] { -1, 1 });
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
@@ -346,7 +346,7 @@ public class LevenbergMarquardtOptimizer
         }
     }
 
-    public void testControlParameters() {
+    public void testControlParameters() throws MathUserException {
         Circle circle = new Circle();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);
@@ -363,7 +363,7 @@ public class LevenbergMarquardtOptimizer
     private void checkEstimate(DifferentiableMultivariateVectorialFunction problem,
                                double initialStepBoundFactor, int maxCostEval,
                                double costRelativeTolerance, double parRelativeTolerance,
-                               double orthoTolerance, boolean shouldFail) {
+                               double orthoTolerance, boolean shouldFail) throws MathUserException {
         try {
             LevenbergMarquardtOptimizer optimizer
                 = new LevenbergMarquardtOptimizer(initialStepBoundFactor,
@@ -382,7 +382,7 @@ public class LevenbergMarquardtOptimizer
         }
     }
 
-    public void testCircleFitting() {
+    public void testCircleFitting() throws MathUserException {
         Circle circle = new Circle();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);
@@ -430,7 +430,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals(0.004, errors[1], 0.001);
     }
 
-    public void testCircleFittingBadInit() {
+    public void testCircleFittingBadInit() throws MathUserException {
         Circle circle = new Circle();
         double[][] points = new double[][] {
                 {-0.312967,  0.072366}, {-0.339248,  0.132965}, {-0.379780,  0.202724},
@@ -483,7 +483,7 @@ public class LevenbergMarquardtOptimizer
         assertEquals( 0.2075001, center.y,      1.0e-6);
     }
 
-    public void testMath199() {
+    public void testMath199() throws MathUserException {
         try {
             QuadraticProblem problem = new QuadraticProblem();
             problem.addPoint (0, -3.182591015485607);
@@ -581,8 +581,7 @@ public class LevenbergMarquardtOptimizer
             return jacobian;
         }
 
-        public double[] value(double[] variables)
-        throws FunctionEvaluationException, IllegalArgumentException {
+        public double[] value(double[] variables) {
 
             Point2D.Double center = new Point2D.Double(variables[0], variables[1]);
             double radius = getRadius(center);

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java Sat Nov 20 21:01:50 2010
@@ -22,7 +22,7 @@ import java.util.Arrays;
 
 import junit.framework.TestCase;
 
-import org.apache.commons.math.exception.FunctionEvaluationException;
+import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.TooManyEvaluationsException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
 import org.apache.commons.math.analysis.MultivariateMatrixFunction;
@@ -505,7 +505,7 @@ public class MinpackTest extends TestCas
           function.checkTheoreticalMinParams(optimum);
       } catch (TooManyEvaluationsException e) {
           assertTrue(exceptionExpected);
-      } catch (FunctionEvaluationException fe) {
+      } catch (MathUserException fe) {
           assertTrue(exceptionExpected);
       }
   }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java Sat Nov 20 21:01:50 2010
@@ -23,11 +23,11 @@ import java.util.ArrayList;
 
 import junit.framework.TestCase;
 
-import org.apache.commons.math.exception.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.linear.BlockRealMatrix;
 import org.apache.commons.math.linear.RealMatrix;
 import org.apache.commons.math.optimization.GoalType;
@@ -103,7 +103,7 @@ extends TestCase {
         super(name);
     }
 
-    public void testTrivial() throws FunctionEvaluationException {
+    public void testTrivial() throws MathUserException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
         NonLinearConjugateGradientOptimizer optimizer =
@@ -116,7 +116,7 @@ extends TestCase {
         assertEquals(0.0, optimum.getValue(), 1.0e-10);
     }
 
-    public void testColumnsPermutation() throws FunctionEvaluationException {
+    public void testColumnsPermutation() throws MathUserException {
 
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1.0, -1.0 }, { 0.0, 2.0 }, { 1.0, -2.0 } },
@@ -134,7 +134,7 @@ extends TestCase {
 
     }
 
-    public void testNoDependency() throws FunctionEvaluationException {
+    public void testNoDependency() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 2, 0, 0, 0, 0, 0 },
                 { 0, 2, 0, 0, 0, 0 },
@@ -154,7 +154,7 @@ extends TestCase {
         }
     }
 
-    public void testOneSet() throws FunctionEvaluationException {
+    public void testOneSet() throws MathUserException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1,  0, 0 },
@@ -173,7 +173,7 @@ extends TestCase {
 
     }
 
-    public void testTwoSets() throws FunctionEvaluationException {
+    public void testTwoSets() throws MathUserException {
         final double epsilon = 1.0e-7;
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  2,  1,   0,  4,       0, 0 },
@@ -212,7 +212,7 @@ extends TestCase {
 
     }
 
-    public void testNonInversible() throws FunctionEvaluationException {
+    public void testNonInversible() throws MathUserException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1, 2, -3 },
@@ -228,7 +228,7 @@ extends TestCase {
         assertTrue(optimum.getValue() > 0.5);
     }
 
-    public void testIllConditioned() throws FunctionEvaluationException {
+    public void testIllConditioned() throws MathUserException {
         LinearProblem problem1 = new LinearProblem(new double[][] {
                 { 10.0, 7.0,  8.0,  7.0 },
                 {  7.0, 5.0,  6.0,  5.0 },
@@ -266,7 +266,7 @@ extends TestCase {
     }
 
     public void testMoreEstimatedParametersSimple()
-        throws FunctionEvaluationException {
+        throws MathUserException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 3.0, 2.0,  0.0, 0.0 },
@@ -285,7 +285,7 @@ extends TestCase {
     }
 
     public void testMoreEstimatedParametersUnsorted()
-        throws FunctionEvaluationException {
+        throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                  { 1.0, 1.0,  0.0,  0.0, 0.0,  0.0 },
                  { 0.0, 0.0,  1.0,  1.0, 1.0,  0.0 },
@@ -302,7 +302,7 @@ extends TestCase {
         assertEquals(0, optimum.getValue(), 1.0e-10);
     }
 
-    public void testRedundantEquations() throws FunctionEvaluationException {
+    public void testRedundantEquations() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -320,7 +320,7 @@ extends TestCase {
 
     }
 
-    public void testInconsistentEquations() throws FunctionEvaluationException {
+    public void testInconsistentEquations() throws MathUserException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -337,7 +337,7 @@ extends TestCase {
 
     }
 
-    public void testCircleFitting() throws FunctionEvaluationException {
+    public void testCircleFitting() throws MathUserException {
         Circle circle = new Circle();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);
@@ -382,7 +382,7 @@ extends TestCase {
             return p;
         }
 
-        public double value(double[] variables) throws FunctionEvaluationException {
+        public double value(double[] variables) throws MathUserException {
             double[] y = factors.operate(variables);
             double sum = 0;
             for (int i = 0; i < y.length; ++i) {
@@ -456,7 +456,7 @@ extends TestCase {
         }
 
         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/trunk/src/test/java/org/apache/commons/math/optimization/univariate/BracketFinderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/BracketFinderTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/BracketFinderTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/BracketFinderTest.java Sat Nov 20 21:01:50 2010
@@ -17,7 +17,6 @@
 package org.apache.commons.math.optimization.univariate;
 
 import org.apache.commons.math.MathException;
-import org.apache.commons.math.exception.FunctionEvaluationException;
 import org.apache.commons.math.analysis.UnivariateRealFunction;
 import org.apache.commons.math.optimization.GoalType;
 
@@ -33,8 +32,7 @@ public class BracketFinderTest {
     public void testCubicMin() throws MathException {
         final BracketFinder bFind = new BracketFinder();
         final UnivariateRealFunction func = new UnivariateRealFunction() {
-                public double value(double x)
-                    throws FunctionEvaluationException {
+                public double value(double x) {
                     if (x < -2) {
                         return value(-2);
                     }
@@ -56,8 +54,7 @@ public class BracketFinderTest {
     public void testCubicMax() throws MathException {
         final BracketFinder bFind = new BracketFinder();
         final UnivariateRealFunction func = new UnivariateRealFunction() {
-                public double value(double x)
-                    throws FunctionEvaluationException {
+                public double value(double x) {
                     if (x < -2) {
                         return value(-2);
                     }
@@ -77,8 +74,7 @@ public class BracketFinderTest {
     @Test
     public void testMinimumIsOnIntervalBoundary() throws MathException {
         final UnivariateRealFunction func = new UnivariateRealFunction() {
-                public double value(double x)
-                    throws FunctionEvaluationException {
+                public double value(double x) {
                     return x * x;
                 }
             };
@@ -97,8 +93,7 @@ public class BracketFinderTest {
     @Test
     public void testIntervalBoundsOrdering() throws MathException {
         final UnivariateRealFunction func = new UnivariateRealFunction() {
-                public double value(double x)
-                    throws FunctionEvaluationException {
+                public double value(double x) {
                     return x * x;
                 }
             };

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java?rev=1037328&r1=1037327&r2=1037328&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java Sat Nov 20 21:01:50 2010
@@ -32,7 +32,7 @@ import org.junit.Test;
 public class MultiStartUnivariateRealOptimizerTest {
 
     @Test
-    public void testSinMin() {
+    public void testSinMin() throws MathUserException {
         UnivariateRealFunction f = new SinFunction();
         UnivariateRealOptimizer underlying = new BrentOptimizer(1e-10, 1e-14);
         underlying.setMaxEvaluations(300);
@@ -53,7 +53,7 @@ public class MultiStartUnivariateRealOpt
     }
 
     @Test
-    public void testQuinticMin() {
+    public void testQuinticMin() throws MathUserException {
         // The quintic function has zeros at 0, +-0.5 and +-1.
         // The function has extrema (first derivative is zero) at 0.27195613 and 0.82221643,
         UnivariateRealFunction f = new QuinticFunction();
@@ -78,9 +78,9 @@ public class MultiStartUnivariateRealOpt
     }
 
     @Test(expected=MathUserException.class)
-    public void testBadFunction() {
+    public void testBadFunction() throws MathUserException {
         UnivariateRealFunction f = new UnivariateRealFunction() {
-                public double value(double x) {
+                public double value(double x) throws MathUserException {
                     if (x < 0) {
                         throw new MathUserException();
                     }
@@ -94,7 +94,6 @@ public class MultiStartUnivariateRealOpt
         MultiStartUnivariateRealOptimizer<UnivariateRealFunction> optimizer =
             new MultiStartUnivariateRealOptimizer<UnivariateRealFunction>(underlying, 5, g);
 
-        UnivariateRealPointValuePair optimum
-            = optimizer.optimize(f, GoalType.MINIMIZE, -0.3, -0.2);
+        optimizer.optimize(f, GoalType.MINIMIZE, -0.3, -0.2);
     }
 }



Mime
View raw message