commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1166311 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/distribution/ main/java/org/apache/commons/math/exception/ main/java/org/apache/commons/math/ode/nonstiff/ main/java/org/apache/commons/math/optimization/ main/...
Date Wed, 07 Sep 2011 18:48:07 GMT
Author: luc
Date: Wed Sep  7 18:48:06 2011
New Revision: 1166311

URL: http://svn.apache.org/viewvc?rev=1166311&view=rev
Log:
Removed completely MathUserException.

JIRA: MATH-195

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/exception/MathUserException.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateRealOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorialOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/LeastSquaresConverter.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/AbstractSimplex.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractScalarOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractVectorialOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/NelderMeadSimplex.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java
    commons/proper/math/trunk/src/site/xdoc/changes.xml
    commons/proper/math/trunk/src/site/xdoc/userguide/ode.xml
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java Wed Sep  7 18:48:06 2011
@@ -21,7 +21,6 @@ import java.io.Serializable;
 import org.apache.commons.math.MathException;
 import org.apache.commons.math.analysis.UnivariateRealFunction;
 import org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
 import org.apache.commons.math.exception.OutOfRangeException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
@@ -76,6 +75,8 @@ public abstract class AbstractContinuous
      */
     public double inverseCumulativeProbability(final double p)
         throws MathException {
+        try {
+
         if (p < 0.0 || p > 1.0) {
             throw new OutOfRangeException(p, 0, 1);
         }
@@ -84,15 +85,15 @@ public abstract class AbstractContinuous
         // subclasses can override if there is a better method.
         UnivariateRealFunction rootFindingFunction =
             new UnivariateRealFunction() {
-            public double value(double x) throws MathUserException {
+            public double value(double x) {
                 double ret = Double.NaN;
                 try {
                     ret = cumulativeProbability(x) - p;
                 } catch (MathException ex) {
-                    throw new MathUserException(ex);
+                    throw new WrappingException(ex);
                 }
                 if (Double.isNaN(ret)) {
-                    throw new MathUserException(LocalizedFormats.CUMULATIVE_PROBABILITY_RETURNED_NAN, x, p);
+                    throw new WrappingException(new MathException(LocalizedFormats.CUMULATIVE_PROBABILITY_RETURNED_NAN, x, p));
                 }
                 return ret;
             }
@@ -128,6 +129,35 @@ public abstract class AbstractContinuous
                 // absolute accuracy different from the default.
                 bracket[0],bracket[1], getSolverAbsoluteAccuracy());
         return root;
+
+        } catch (WrappingException we) {
+            throw we.getWrapped();
+        }
+    }
+
+    /** Local exception wrapping a MathException. */
+    private static class WrappingException extends RuntimeException {
+
+        /** Serializable UID. */
+        private static final long serialVersionUID = -2102700399222815344L;
+
+        /** Wrapped exception. */
+        private final MathException wrapped;
+
+        /** simple constructor.
+         * @param wrapped exception to wrap
+         */
+        public WrappingException(final MathException wrapped) {
+            this.wrapped = wrapped;
+        }
+
+        /** Get the wrapped exception.
+         * @return wrapped exception
+         */
+        public MathException getWrapped() {
+            return wrapped;
+        }
+
     }
 
     /**

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java Wed Sep  7 18:48:06 2011
@@ -20,7 +20,6 @@ package org.apache.commons.math.ode.nons
 import org.apache.commons.math.exception.DimensionMismatchException;
 import org.apache.commons.math.exception.MathIllegalArgumentException;
 import org.apache.commons.math.exception.MathIllegalStateException;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.NumberIsTooSmallException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.ode.AbstractIntegrator;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java Wed Sep  7 18:48:06 2011
@@ -20,11 +20,10 @@ package org.apache.commons.math.optimiza
 import java.util.Arrays;
 import java.util.Comparator;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.analysis.MultivariateRealFunction;
 import org.apache.commons.math.exception.MathIllegalStateException;
-import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
-import org.apache.commons.math.analysis.MultivariateRealFunction;
+import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.random.RandomVectorGenerator;
 
@@ -101,7 +100,7 @@ public class BaseMultiStartMultivariateR
      * descending order if maximizing), followed by and null elements
      * corresponding to the runs that did not converge. This means all
      * elements will be null if the {@link #optimize(int,MultivariateRealFunction,GoalType,double[])
-     * optimize} method did throw a {@link MathUserException}).
+     * optimize} method did throw an exception.
      * This also means that if the first element is not {@code null}, it
      * is the best point found across all starts.
      *
@@ -144,7 +143,7 @@ public class BaseMultiStartMultivariateR
                                        final GoalType goal,
                                        double[] startPoint) {
         maxEvaluations = maxEval;
-        MathUserException lastException = null;
+        RuntimeException lastException = null;
         optima = new RealPointValuePair[starts];
         totalEvaluations = 0;
 
@@ -153,7 +152,7 @@ public class BaseMultiStartMultivariateR
             try {
                 optima[i] = optimizer.optimize(maxEval - totalEvaluations, f, goal,
                                                i == 0 ? startPoint : generator.nextVector());
-            } catch (MathUserException mue) {
+            } catch (RuntimeException mue) {
                 lastException = mue;
                 optima[i] = null;
             }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java Wed Sep  7 18:48:06 2011
@@ -20,12 +20,11 @@ package org.apache.commons.math.optimiza
 import java.util.Arrays;
 import java.util.Comparator;
 
-import org.apache.commons.math.exception.MathIllegalStateException;
+import org.apache.commons.math.analysis.MultivariateVectorialFunction;
 import org.apache.commons.math.exception.ConvergenceException;
-import org.apache.commons.math.exception.MathUserException;
-import org.apache.commons.math.exception.NullArgumentException;
+import org.apache.commons.math.exception.MathIllegalStateException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
-import org.apache.commons.math.analysis.MultivariateVectorialFunction;
+import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.random.RandomVectorGenerator;
 
@@ -145,7 +144,7 @@ public class BaseMultiStartMultivariateV
                                             double[] target, double[] weights,
                                             double[] startPoint) {
         maxEvaluations = maxEval;
-        MathUserException lastException = null;
+        RuntimeException lastException = null;
         optima = new VectorialPointValuePair[starts];
         totalEvaluations = 0;
 
@@ -155,11 +154,11 @@ public class BaseMultiStartMultivariateV
             try {
                 optima[i] = optimizer.optimize(maxEval - totalEvaluations, f, target, weights,
                                                i == 0 ? startPoint : generator.nextVector());
-            } catch (MathUserException mue) {
-                lastException = mue;
-                optima[i] = null;
             } catch (ConvergenceException oe) {
                 optima[i] = null;
+            } catch (RuntimeException mue) {
+                lastException = mue;
+                optima[i] = null;
             }
 
             totalEvaluations += optimizer.getEvaluations();

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateRealOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateRealOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateRealOptimizer.java Wed Sep  7 18:48:06 2011
@@ -51,8 +51,6 @@ public interface BaseMultivariateRealOpt
      * if the maximal number of evaluations is exceeded.
      * @throws org.apache.commons.math.exception.NullArgumentException if
      * any argument is {@code null}.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * objective function throws one during search.
      */
     RealPointValuePair optimize(int maxEval, FUNC f, GoalType goalType,
                                 double[] startPoint);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorialOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorialOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorialOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorialOptimizer.java Wed Sep  7 18:48:06 2011
@@ -53,8 +53,6 @@ public interface BaseMultivariateVectori
      * if the maximal number of evaluations is exceeded.
      * @throws org.apache.commons.math.exception.NullArgumentException if
      * any argument is {@code null}.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * function throws one during search.
      */
     VectorialPointValuePair optimize(int maxEval, FUNC f, double[] target,
                                      double[] weight, double[] startPoint);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/LeastSquaresConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/LeastSquaresConverter.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/LeastSquaresConverter.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/LeastSquaresConverter.java Wed Sep  7 18:48:06 2011
@@ -20,7 +20,6 @@ package org.apache.commons.math.optimiza
 import org.apache.commons.math.analysis.MultivariateRealFunction;
 import org.apache.commons.math.analysis.MultivariateVectorialFunction;
 import org.apache.commons.math.exception.DimensionMismatchException;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.linear.RealMatrix;
 
 /** This class converts {@link MultivariateVectorialFunction vectorial
@@ -150,7 +149,7 @@ public class LeastSquaresConverter imple
     }
 
     /** {@inheritDoc} */
-    public double value(final double[] point) throws MathUserException {
+    public double value(final double[] point) {
         // compute residuals
         final double[] residuals = function.value(point);
         if (residuals.length != observations.length) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/AbstractSimplex.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/AbstractSimplex.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/AbstractSimplex.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/AbstractSimplex.java Wed Sep  7 18:48:06 2011
@@ -21,7 +21,6 @@ import java.util.Arrays;
 import java.util.Comparator;
 
 import org.apache.commons.math.analysis.MultivariateRealFunction;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
 import org.apache.commons.math.exception.DimensionMismatchException;
 import org.apache.commons.math.exception.ZeroException;
@@ -202,11 +201,9 @@ public abstract class AbstractSimplex {
      * to worst.
      * @throws org.apache.commons.math.exception.TooManyEvaluationsException
      * if the algorithm fails to converge.
-     * @throws MathUserException if evaluation function throws one
      */
     public abstract void iterate(final MultivariateRealFunction evaluationFunction,
-                                 final Comparator<RealPointValuePair> comparator)
-        throws MathUserException;
+                                 final Comparator<RealPointValuePair> comparator);
 
     /**
      * Build an initial simplex.
@@ -242,11 +239,9 @@ public abstract class AbstractSimplex {
      * @param comparator Comparator to use to sort simplex vertices from best to worst.
      * @throws org.apache.commons.math.exception.TooManyEvaluationsException
      * if the maximal number of evaluations is exceeded.
-     * @throws MathUserException if evaluation function throws one
      */
     public void evaluate(final MultivariateRealFunction evaluationFunction,
-                         final Comparator<RealPointValuePair> comparator)
-        throws MathUserException {
+                         final Comparator<RealPointValuePair> comparator) {
         // Evaluate the objective function at all non-evaluated simplex points.
         for (int i = 0; i < simplex.length; i++) {
             final RealPointValuePair vertex = simplex[i];

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractScalarOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractScalarOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractScalarOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractScalarOptimizer.java Wed Sep  7 18:48:06 2011
@@ -93,8 +93,6 @@ public abstract class BaseAbstractScalar
      * @return the objective function value at the specified point.
      * @throws TooManyEvaluationsException if the maximal number of
      * evaluations is exceeded.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * objective function throws one.
      */
     protected double computeObjectiveValue(double[] point) {
         try {
@@ -151,8 +149,6 @@ public abstract class BaseAbstractScalar
      *
      * @return the point/value pair giving the optimal value for the
      * objective function.
-     * @throws org.apache.commons.math.exception.MathUserException if
-     * the objective function throws one.
      */
     protected abstract RealPointValuePair doOptimize();
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractVectorialOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractVectorialOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractVectorialOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractVectorialOptimizer.java Wed Sep  7 18:48:06 2011
@@ -95,8 +95,6 @@ public abstract class BaseAbstractVector
      * @return the objective function value at the specified point.
      * @throws TooManyEvaluationsException if the maximal number of evaluations is
      * exceeded.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * objective function throws one.
      */
     protected double[] computeObjectiveValue(double[] point) {
         try {
@@ -153,8 +151,6 @@ public abstract class BaseAbstractVector
      *
      * @return the point/value pair giving the optimal value for the
      * objective function.
-     * @throws org.apache.commons.math.exception.MathUserException if
-     * the function throws one during search.
      */
     protected abstract VectorialPointValuePair doOptimize();
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java Wed Sep  7 18:48:06 2011
@@ -20,7 +20,6 @@ package org.apache.commons.math.optimiza
 import java.util.Comparator;
 
 import org.apache.commons.math.analysis.MultivariateRealFunction;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.RealPointValuePair;
 
 /**
@@ -154,8 +153,7 @@ public class MultiDirectionalSimplex ext
     /** {@inheritDoc} */
     @Override
     public void iterate(final MultivariateRealFunction evaluationFunction,
-                        final Comparator<RealPointValuePair> comparator)
-        throws MathUserException {
+                        final Comparator<RealPointValuePair> comparator) {
         // Save the original simplex.
         final RealPointValuePair[] original = getPoints();
         final RealPointValuePair best = original[0];
@@ -192,13 +190,11 @@ public class MultiDirectionalSimplex ext
      * @return the best point in the transformed simplex.
      * @throws org.apache.commons.math.exception.TooManyEvaluationsException
      * if the maximal number of evaluations is exceeded.
-     * @throws MathUserException if function cannot be evaluated at some points
      */
     private RealPointValuePair evaluateNewSimplex(final MultivariateRealFunction evaluationFunction,
                                                   final RealPointValuePair[] original,
                                                   final double coeff,
-                                                  final Comparator<RealPointValuePair> comparator)
-        throws MathUserException {
+                                                  final Comparator<RealPointValuePair> comparator) {
         final double[] xSmallest = original[0].getPointRef();
         // Perform a linear transformation on all the simplex points,
         // except the first one.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/NelderMeadSimplex.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/NelderMeadSimplex.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/NelderMeadSimplex.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/NelderMeadSimplex.java Wed Sep  7 18:48:06 2011
@@ -21,7 +21,6 @@ import java.util.Comparator;
 
 import org.apache.commons.math.optimization.RealPointValuePair;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
-import org.apache.commons.math.exception.MathUserException;
 
 /**
  * This class implements the Nelder-Mead simplex algorithm.
@@ -186,8 +185,7 @@ public class NelderMeadSimplex extends A
     /** {@inheritDoc} */
     @Override
     public void iterate(final MultivariateRealFunction evaluationFunction,
-                        final Comparator<RealPointValuePair> comparator)
-        throws MathUserException {
+                        final Comparator<RealPointValuePair> comparator) {
         // The simplex has n + 1 points if dimension is n.
         final int n = getDimension();
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java Wed Sep  7 18:48:06 2011
@@ -261,8 +261,6 @@ public class PowellOptimizer
          * @return the optimum.
          * @throws org.apache.commons.math.exception.TooManyEvaluationsException
          * if the number of evaluations is exceeded.
-         * @throws org.apache.commons.math.exception.MathUserException if the
-         * objective function throws one.
          */
         public UnivariateRealPointValuePair search(final double[] p, final double[] d) {
             final int n = p.length;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java Wed Sep  7 18:48:06 2011
@@ -20,7 +20,6 @@ package org.apache.commons.math.optimiza
 import java.util.Comparator;
 
 import org.apache.commons.math.analysis.MultivariateRealFunction;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.optimization.GoalType;
 import org.apache.commons.math.optimization.ConvergenceChecker;
@@ -112,7 +111,7 @@ public class SimplexOptimizer
 
     /** {@inheritDoc} */
     @Override
-    protected RealPointValuePair doOptimize() throws MathUserException {
+    protected RealPointValuePair doOptimize() {
         if (simplex == null) {
             throw new NullArgumentException();
         }
@@ -121,7 +120,7 @@ public class SimplexOptimizer
         // evaluations counter.
         final MultivariateRealFunction evalFunc
             = new MultivariateRealFunction() {
-                public double value(double[] point) throws MathUserException {
+                public double value(double[] point) {
                     return computeObjectiveValue(point);
                 }
             };

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java Wed Sep  7 18:48:06 2011
@@ -119,8 +119,6 @@ public class CurveFitter {
      * @return the fitted parameters.
      * @throws org.apache.commons.math.exception.DimensionMismatchException
      * if the start point dimension is wrong.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * parametric function throws one.
      */
     public double[] fit(final ParametricUnivariateRealFunction f, final double[] initialGuess) {
         return fit(Integer.MAX_VALUE, f, initialGuess);
@@ -141,8 +139,6 @@ public class CurveFitter {
      * if the number of allowed evaluations is exceeded.
      * @throws org.apache.commons.math.exception.DimensionMismatchException
      * if the start point dimension is wrong.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * parametric function throws one.
      */
     public double[] fit(int maxEval, final ParametricUnivariateRealFunction f,
                         final double[] initialGuess) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java Wed Sep  7 18:48:06 2011
@@ -103,8 +103,6 @@ public abstract class AbstractLeastSquar
      *
      * @throws DimensionMismatchException if the Jacobian dimension does not
      * match problem dimension.
-     * @throws org.apache.commons.math.exception.MathUserException if the jacobian
-     * function throws one.
      */
     protected void updateJacobian() {
         ++jacobianEvaluations;
@@ -180,8 +178,6 @@ public abstract class AbstractLeastSquar
      * @return the covariance matrix.
      * @throws org.apache.commons.math.linear.SingularMatrixException
      * if the covariance matrix cannot be computed (singular problem).
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * jacobian function throws one.
      */
     public double[][] getCovariances() {
         // set up the jacobian
@@ -216,8 +212,6 @@ public abstract class AbstractLeastSquar
      * @throws NumberIsTooSmallException if the number of degrees of freedom is not
      * positive, i.e. the number of measurements is less or equal to the number of
      * parameters.
-     * @throws org.apache.commons.math.exception.MathUserException if the jacobian
-     * function throws one.
      */
     public double[] guessParametersErrors() {
         if (rows <= cols) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java Wed Sep  7 18:48:06 2011
@@ -19,7 +19,6 @@ package org.apache.commons.math.optimiza
 
 import org.apache.commons.math.analysis.DifferentiableMultivariateRealFunction;
 import org.apache.commons.math.analysis.MultivariateVectorialFunction;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.DifferentiableMultivariateRealOptimizer;
 import org.apache.commons.math.optimization.GoalType;
 import org.apache.commons.math.optimization.ConvergenceChecker;
@@ -63,10 +62,8 @@ public abstract class AbstractScalarDiff
      * @return the gradient at the specified point.
      * @throws org.apache.commons.math.exception.TooManyEvaluationsException
      * if the allowed number of evaluations is exceeded.
-     * @throws MathUserException if objective function gradient throws one
      */
-    protected double[] computeObjectiveGradient(final double[] evaluationPoint)
-        throws MathUserException {
+    protected double[] computeObjectiveGradient(final double[] evaluationPoint) {
         return gradient.value(evaluationPoint);
     }
 
@@ -75,7 +72,7 @@ public abstract class AbstractScalarDiff
     public RealPointValuePair optimize(int maxEval,
                                        final DifferentiableMultivariateRealFunction f,
                                        final GoalType goalType,
-                                       final double[] startPoint) throws MathUserException {
+                                       final double[] startPoint) {
         // Store optimization problem characteristics.
         gradient = f.gradient();
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java Wed Sep  7 18:48:06 2011
@@ -18,7 +18,6 @@
 package org.apache.commons.math.optimization.general;
 
 import org.apache.commons.math.exception.ConvergenceException;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.linear.ArrayRealVector;
 import org.apache.commons.math.linear.BlockRealMatrix;
@@ -26,7 +25,6 @@ import org.apache.commons.math.linear.De
 import org.apache.commons.math.linear.LUDecompositionImpl;
 import org.apache.commons.math.linear.QRDecompositionImpl;
 import org.apache.commons.math.linear.RealMatrix;
-import org.apache.commons.math.linear.RealVector;
 import org.apache.commons.math.linear.SingularMatrixException;
 import org.apache.commons.math.optimization.ConvergenceChecker;
 import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
@@ -97,7 +95,7 @@ public class GaussNewtonOptimizer extend
 
     /** {@inheritDoc} */
     @Override
-    public VectorialPointValuePair doOptimize() throws MathUserException {
+    public VectorialPointValuePair doOptimize() {
 
         final ConvergenceChecker<VectorialPointValuePair> checker
             = getConvergenceChecker();

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java Wed Sep  7 18:48:06 2011
@@ -19,7 +19,6 @@ package org.apache.commons.math.optimiza
 import java.util.Arrays;
 
 import org.apache.commons.math.exception.ConvergenceException;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.optimization.VectorialPointValuePair;
 import org.apache.commons.math.optimization.ConvergenceChecker;
@@ -270,7 +269,7 @@ public class LevenbergMarquardtOptimizer
 
     /** {@inheritDoc} */
     @Override
-    protected VectorialPointValuePair doOptimize() throws MathUserException {
+    protected VectorialPointValuePair doOptimize() {
         // arrays shared with the other private methods
         solvedCols  = FastMath.min(rows, cols);
         diagR       = new double[cols];

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java Wed Sep  7 18:48:06 2011
@@ -243,8 +243,6 @@ public class NonLinearConjugateGradientO
      * @param h initial step to try.
      * @return b such that f(a) and f(b) have opposite signs.
      * @throws MathIllegalStateException if no bracket can be found.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * function throws one.
      */
     private double findUpperBound(final UnivariateRealFunction f,
                                   final double a, final double h) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java Wed Sep  7 18:48:06 2011
@@ -91,8 +91,6 @@ public abstract class AbstractUnivariate
      * @return the objective function value at specified point.
      * @throws TooManyEvaluationsException if the maximal number of evaluations
      * is exceeded.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * objective function throws one.
      */
     protected double computeObjectiveValue(double point) {
         try {
@@ -158,8 +156,6 @@ public abstract class AbstractUnivariate
      * @return the optimum and its corresponding function value.
      * @throws TooManyEvaluationsException if the maximal number of evaluations
      * is exceeded.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * function to optimize throws one during search.
      */
     protected abstract UnivariateRealPointValuePair doOptimize();
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java Wed Sep  7 18:48:06 2011
@@ -54,8 +54,6 @@ public interface BaseUnivariateRealOptim
      * if the optimizer detects a convergence problem.
      * @throws IllegalArgumentException if {@code min > max} or the endpoints
      * do not satisfy the requirements specified by the optimizer.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * function to optimize throws one during search.
      */
     UnivariateRealPointValuePair optimize(int maxEval, FUNC f, GoalType goalType,
                                           double min, double max);
@@ -80,8 +78,6 @@ public interface BaseUnivariateRealOptim
      * do not satisfy the requirements specified by the optimizer.
      * @throws org.apache.commons.math.exception.NullArgumentException if any
      * argument is {@code null}.
-     * @throws org.apache.commons.math.exception.MathUserException if the
-     * function to optimize throws one during search.
      */
     UnivariateRealPointValuePair optimize(int maxEval, FUNC f, GoalType goalType,
                                           double min, double max,

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java Wed Sep  7 18:48:06 2011
@@ -17,7 +17,6 @@
 package org.apache.commons.math.optimization.univariate;
 
 import org.apache.commons.math.util.Incrementor;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
 import org.apache.commons.math.exception.TooManyEvaluationsException;
 import org.apache.commons.math.exception.MaxCountExceededException;
@@ -109,10 +108,8 @@ public class BracketFinder {
      * @param xB Initial point.
      * @throws TooManyEvaluationsException if the maximum number of evaluations
      * is exceeded.
-     * @throws MathUserException if function throw one
      */
-    public void search(UnivariateRealFunction func, GoalType goal, double xA, double xB)
-        throws MathUserException {
+    public void search(UnivariateRealFunction func, GoalType goal, double xA, double xB) {
         evaluations.resetCount();
         final boolean isMinim = goal == GoalType.MINIMIZE;
 
@@ -278,9 +275,8 @@ public class BracketFinder {
      * @return {@code f(x)}
      * @throws TooManyEvaluationsException if the maximal number of evaluations is
      * exceeded.
-     * @throws MathUserException if f throws one.
      */
-    private double eval(UnivariateRealFunction f, double x) throws MathUserException {
+    private double eval(UnivariateRealFunction f, double x) {
         try {
             evaluations.incrementCount();
         } catch (MaxCountExceededException e) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java Wed Sep  7 18:48:06 2011
@@ -18,7 +18,6 @@ package org.apache.commons.math.optimiza
 
 import org.apache.commons.math.util.MathUtils;
 import org.apache.commons.math.util.FastMath;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.NumberIsTooSmallException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
 import org.apache.commons.math.optimization.ConvergenceChecker;
@@ -86,7 +85,7 @@ public class BrentOptimizer extends Abst
 
     /** {@inheritDoc} */
     @Override
-    protected UnivariateRealPointValuePair doOptimize() throws MathUserException {
+    protected UnivariateRealPointValuePair doOptimize() {
         final boolean isMinim = getGoalType() == GoalType.MINIMIZE;
         final double lo = getMin();
         final double mid = getStartValue();

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java Wed Sep  7 18:48:06 2011
@@ -21,7 +21,6 @@ import java.util.Arrays;
 import java.util.Comparator;
 
 import org.apache.commons.math.analysis.UnivariateRealFunction;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.MathIllegalStateException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
 import org.apache.commons.math.exception.NullArgumentException;
@@ -128,7 +127,7 @@ public class MultiStartUnivariateRealOpt
      * corresponding to the runs that did not converge. This means all
      * elements will be {@code null} if the {@link
      * #optimize(int,UnivariateRealFunction,GoalType,double,double) optimize}
-     * method did throw a {@link MathUserException}).
+     * method did throw an exception.
      * This also means that if the first element is not {@code null}, it is
      * the best point found across all starts.
      *
@@ -156,7 +155,7 @@ public class MultiStartUnivariateRealOpt
                                                  final GoalType goal,
                                                  final double min, final double max,
                                                  final double startValue) {
-        MathUserException lastException = null;
+        RuntimeException lastException = null;
         optima = new UnivariateRealPointValuePair[starts];
         totalEvaluations = 0;
 
@@ -165,7 +164,7 @@ public class MultiStartUnivariateRealOpt
             try {
                 final double s = (i == 0) ? startValue : min + generator.nextDouble() * (max - min);
                 optima[i] = optimizer.optimize(maxEval - totalEvaluations, f, goal, min, max, s);
-            } catch (MathUserException mue) {
+            } catch (RuntimeException mue) {
                 lastException = mue;
                 optima[i] = null;
             }

Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Wed Sep  7 18:48:06 2011
@@ -52,6 +52,9 @@ The <action> type attribute can be add,u
     If the output is not quite correct, check for invisible trailing spaces!
      -->
     <release version="3.0" date="TBD" description="TBD">
+      <action dev="luc" type="update" issue="MATH-195" >
+        Removed completely MathUserException. 
+      </action>
       <action dev="luc" type="update" issue="MATH-488" >
         Use the refactored exceptions framework for ODE. 
       </action>

Modified: commons/proper/math/trunk/src/site/xdoc/userguide/ode.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/ode.xml?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/userguide/ode.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/userguide/ode.xml Wed Sep  7 18:48:06 2011
@@ -130,7 +130,7 @@ dp853.integrate(ode, 0.0, y, 16.0, y); /
 StepHandler stepHandler = new StepHandler() {
     public void reset() {}
             
-    public void handleStep(StepInterpolator interpolator, boolean isLast) throws MathUserException {
+    public void handleStep(StepInterpolator interpolator, boolean isLast) {
         double   t = interpolator.getCurrentTime();
         double[] y = interpolator.getInterpolatedState();
         System.out.println(t + " " + y[0] + " " + y[1]);

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java Wed Sep  7 18:48:06 2011
@@ -21,7 +21,6 @@ import org.junit.Assert;
 
 import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.util.FastMath;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.DimensionMismatchException;
 import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.OutOfRangeException;

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java Wed Sep  7 18:48:06 2011
@@ -23,7 +23,6 @@ import org.junit.Test;
 import org.junit.Assert;
 
 import org.apache.commons.math.TestUtils;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.fraction.Fraction;
 import org.apache.commons.math.fraction.FractionField;
 import org.apache.commons.math.exception.NoDataException;

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java Wed Sep  7 18:48:06 2011
@@ -23,7 +23,6 @@ import org.junit.Test;
 import org.junit.Assert;
 
 import org.apache.commons.math.TestUtils;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.util.FastMath;
 import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.OutOfRangeException;

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java?rev=1166311&r1=1166310&r2=1166311&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java Wed Sep  7 18:48:06 2011
@@ -22,7 +22,6 @@ import org.junit.Assert;
 import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.fraction.Fraction;
 import org.apache.commons.math.fraction.FractionField;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.MathIllegalStateException;
 import org.apache.commons.math.exception.DimensionMismatchException;
 import org.apache.commons.math.exception.NoDataException;

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=1166311&r1=1166310&r2=1166311&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 Wed Sep  7 18:48:06 2011
@@ -21,7 +21,6 @@ package org.apache.commons.math.optimiza
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
 import org.apache.commons.math.analysis.MultivariateMatrixFunction;
 import org.apache.commons.math.exception.MathIllegalStateException;
-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;
@@ -133,7 +132,7 @@ public class MultiStartDifferentiableMul
         Assert.assertEquals(100, optimizer.getMaxEvaluations());
     }
 
-    @Test(expected = MathUserException.class)
+    @Test(expected = TestException.class)
     public void testNoOptimum() {
         DifferentiableMultivariateVectorialOptimizer underlyingOptimizer =
             new GaussNewtonOptimizer(true);
@@ -150,11 +149,15 @@ public class MultiStartDifferentiableMul
                     return null;
                 }
                 public double[] value(double[] point) {
-                    throw new MathUserException();
+                    throw new TestException();
                 }
             }, new double[] { 2 }, new double[] { 1 }, new double[] { 0 });
     }
 
+    private static class TestException extends RuntimeException {
+        private static final long serialVersionUID = -7809988995389067683L;
+    }
+
     private static class LinearProblem implements DifferentiableMultivariateVectorialFunction {
 
         final RealMatrix factors;

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=1166311&r1=1166310&r2=1166311&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 Wed Sep  7 18:48:06 2011
@@ -19,9 +19,8 @@ package org.apache.commons.math.optimiza
 
 
 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.optimization.direct.SimplexOptimizer;
 import org.apache.commons.math.random.GaussianRandomGenerator;
 import org.apache.commons.math.random.JDKRandomGenerator;
 import org.apache.commons.math.random.RandomVectorGenerator;
@@ -31,7 +30,7 @@ import org.junit.Test;
 
 public class MultiStartMultivariateRealOptimizerTest {
     @Test
-    public void testRosenbrock() throws MathUserException {
+    public void testRosenbrock() {
         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/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=1166311&r1=1166310&r2=1166311&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 Wed Sep  7 18:48:06 2011
@@ -17,7 +17,6 @@
 
 package org.apache.commons.math.optimization.fitting;
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer;
 import org.apache.commons.math.analysis.ParametricUnivariateRealFunction;
 import org.apache.commons.math.util.FastMath;
@@ -27,8 +26,7 @@ import org.junit.Test;
 public class CurveFitterTest {
 
     @Test
-    public void testMath303()
-        throws MathUserException {
+    public void testMath303() {
 
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter fitter = new CurveFitter(optimizer);
@@ -51,8 +49,7 @@ public class CurveFitterTest {
     }
 
     @Test
-    public void testMath304()
-        throws MathUserException {
+    public void testMath304() {
 
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter fitter = new CurveFitter(optimizer);
@@ -74,8 +71,7 @@ public class CurveFitterTest {
     }
 
     @Test
-    public void testMath372()
-    throws MathUserException {
+    public void testMath372() {
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter curveFitter = new CurveFitter(optimizer);
 

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=1166311&r1=1166310&r2=1166311&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 Wed Sep  7 18:48:06 2011
@@ -22,7 +22,6 @@ import java.io.Serializable;
 import java.util.Arrays;
 
 
-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;
@@ -30,7 +29,6 @@ import org.apache.commons.math.analysis.
 import org.apache.commons.math.analysis.MultivariateMatrixFunction;
 import org.apache.commons.math.linear.BlockRealMatrix;
 import org.apache.commons.math.linear.RealMatrix;
-import org.apache.commons.math.optimization.SimpleVectorialPointChecker;
 import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
 import org.apache.commons.math.optimization.VectorialPointValuePair;
 import org.apache.commons.math.util.FastMath;
@@ -102,7 +100,7 @@ import org.junit.Test;
 public class GaussNewtonOptimizerTest {
 
     @Test
-    public void testTrivial() throws MathUserException {
+    public void testTrivial() {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
 
@@ -117,7 +115,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testColumnsPermutation() throws MathUserException {
+    public void testColumnsPermutation() {
 
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1.0, -1.0 }, { 0.0, 2.0 }, { 1.0, -2.0 } },
@@ -138,7 +136,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testNoDependency() throws MathUserException {
+    public void testNoDependency() {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 2, 0, 0, 0, 0, 0 },
                 { 0, 2, 0, 0, 0, 0 },
@@ -161,7 +159,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testOneSet() throws MathUserException {
+    public void testOneSet() {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1,  0, 0 },
@@ -182,7 +180,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testTwoSets() throws MathUserException {
+    public void testTwoSets() {
         double epsilon = 1.0e-7;
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  2,  1,   0,  4,       0, 0 },
@@ -225,7 +223,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testIllConditioned() throws MathUserException {
+    public void testIllConditioned() {
         LinearProblem problem1 = new LinearProblem(new double[][] {
                 { 10.0, 7.0,  8.0,  7.0 },
                 {  7.0, 5.0,  6.0,  5.0 },
@@ -296,7 +294,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testRedundantEquations() throws MathUserException {
+    public void testRedundantEquations() {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -315,7 +313,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testInconsistentEquations() throws MathUserException {
+    public void testInconsistentEquations() {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -331,7 +329,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test(expected=DimensionMismatchException.class)
-    public void testInconsistentSizes1() throws MathUserException {
+    public void testInconsistentSizes1() {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1, 0 }, { 0, 1 } }, new double[] { -1, 1 });
 
@@ -350,7 +348,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test(expected=DimensionMismatchException.class)
-    public void testInconsistentSizes2() throws MathUserException {
+    public void testInconsistentSizes2() {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1, 0 }, { 0, 1 } }, new double[] { -1, 1 });
 
@@ -386,7 +384,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testCircleFitting() throws MathUserException {
+    public void testCircleFitting() {
         CircleVectorial circle = new CircleVectorial();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);
@@ -409,7 +407,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test(expected=ConvergenceException.class)
-    public void testCircleFittingBadInit() throws MathUserException {
+    public void testCircleFittingBadInit() {
         CircleVectorial circle = new CircleVectorial();
         double[][] points = circlePoints;
         double[] target = new double[points.length];
@@ -427,7 +425,7 @@ public class GaussNewtonOptimizerTest {
     }
 
     @Test
-    public void testCircleFittingGoodInit() throws MathUserException {
+    public void testCircleFittingGoodInit() {
         CircleVectorial circle = new CircleVectorial();
         double[][] points = circlePoints;
         double[] target = new double[points.length];

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=1166311&r1=1166310&r2=1166311&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 Wed Sep  7 18:48:06 2011
@@ -21,7 +21,6 @@ import java.io.Serializable;
 import java.util.Arrays;
 
 
-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;
@@ -519,8 +518,6 @@ public class MinpackTest {
           function.checkTheoreticalMinParams(optimum);
       } catch (TooManyEvaluationsException e) {
           Assert.assertTrue(exceptionExpected);
-      } catch (MathUserException fe) {
-          Assert.assertTrue(exceptionExpected);
       }
   }
 

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=1166311&r1=1166310&r2=1166311&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 Wed Sep  7 18:48:06 2011
@@ -17,7 +17,6 @@
 
 package org.apache.commons.math.optimization.univariate;
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.analysis.QuinticFunction;
 import org.apache.commons.math.analysis.SinFunction;
 import org.apache.commons.math.analysis.UnivariateRealFunction;
@@ -79,7 +78,7 @@ public class MultiStartUnivariateRealOpt
         UnivariateRealFunction f = new UnivariateRealFunction() {
                 public double value(double x) {
                     if (x < 0) {
-                        throw new MathUserException();
+                        throw new LocalException();
                     }
                     return 0;
                 }
@@ -93,11 +92,16 @@ public class MultiStartUnivariateRealOpt
         try {
             optimizer.optimize(300, f, GoalType.MINIMIZE, -0.3, -0.2);
             Assert.fail();
-        } catch (MathUserException e) {
+        } catch (LocalException e) {
             // Expected.
         }
 
         // Ensure that the exception was thrown because no optimum was found.
         Assert.assertTrue(optimizer.getOptima()[0] == null);
     }
+
+    private static class LocalException extends RuntimeException {
+        private static final long serialVersionUID = 1194682757034350629L;
+    }
+
 }



Mime
View raw message