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

svn commit: r1073158 [2/4] - in /commons/proper/math/branches/MATH_2_X/src: main/java/org/apache/commons/math/analysis/ main/java/org/apache/commons/math/linear/ main/java/org/apache/commons/math/ode/ main/java/org/apache/commons/math/ode/events/ main/...

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/RealMatrixPreservingVisitor.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.linear;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.linear.MatrixVisitorException;
 
 /**
  * Interface defining a visitor for matrix entries.
@@ -46,10 +46,10 @@ public interface RealMatrixPreservingVis
      * @param row row index of the entry
      * @param column column index of the entry
      * @param value current value of the entry
-     * @throws MathUserException if something wrong occurs
+     * @throws MatrixVisitorException if something wrong occurs
      */
     void visit(int row, int column, double value)
-        throws MathUserException;
+        throws MatrixVisitorException;
 
     /**
      * End visiting a matrix.

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java Mon Feb 21 21:46:52 2011
@@ -28,7 +28,6 @@ import java.util.TreeSet;
 
 import org.apache.commons.math.ConvergenceException;
 import org.apache.commons.math.MaxEvaluationsExceededException;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.ode.events.CombinedEventsManager;
 import org.apache.commons.math.ode.events.EventException;
@@ -200,13 +199,13 @@ public abstract class AbstractIntegrator
      * @param t current value of the independent <I>time</I> variable
      * @param y array containing the current value of the state vector
      * @param yDot placeholder array where to put the time derivative of the state vector
-     * @throws MathUserException this user-defined exception should be used if an error is
+     * @throws DerivativeException this user-defined exception should be used if an error is
      * is triggered by user code
      */
     public void computeDerivatives(final double t, final double[] y, final double[] yDot)
-        throws MathUserException {
+        throws DerivativeException {
         if (++evaluations > maxEvaluations) {
-            throw new MathUserException(new MaxEvaluationsExceededException(maxEvaluations));
+            throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
         }
         equations.computeDerivatives(t, y, yDot);
     }
@@ -228,11 +227,13 @@ public abstract class AbstractIntegrator
      * @param yDot placeholder array where to put the time derivative of the state vector
      * @param tEnd final integration time
      * @return time at end of step
+     * @throws DerivativeException this exception is propagated to the caller if
+     * the underlying user function triggers one
      * @exception IntegratorException if the value of one event state cannot be evaluated
      */
     protected double acceptStep(final AbstractStepInterpolator interpolator,
                                 final double[] y, final double[] yDot, final double tEnd)
-        throws IntegratorException {
+        throws DerivativeException, IntegratorException {
 
         try {
             double previousT = interpolator.getGlobalPreviousTime();
@@ -332,8 +333,8 @@ public abstract class AbstractIntegrator
             return currentT;
         } catch (EventException se) {
             final Throwable cause = se.getCause();
-            if ((cause != null) && (cause instanceof MathUserException)) {
-                throw (MathUserException) cause;
+            if ((cause != null) && (cause instanceof DerivativeException)) {
+                throw (DerivativeException) cause;
             }
             throw new IntegratorException(se);
         } catch (ConvergenceException ce) {

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/ContinuousOutputModel.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/ContinuousOutputModel.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/ContinuousOutputModel.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/ContinuousOutputModel.java Mon Feb 21 21:46:52 2011
@@ -22,7 +22,7 @@ import java.util.List;
 import java.io.Serializable;
 
 import org.apache.commons.math.MathRuntimeException;
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.ode.sampling.StepHandler;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
@@ -117,14 +117,14 @@ public class ContinuousOutputModel
 
   /** Append another model at the end of the instance.
    * @param model model to add at the end of the instance
-   * @exception MathUserException if user code called from step interpolator
+   * @exception DerivativeException if user code called from step interpolator
    * finalization triggers one
    * @exception IllegalArgumentException if the model to append is not
    * compatible with the instance (dimension of the state vector,
    * propagation direction, hole between the dates)
    */
   public void append(final ContinuousOutputModel model)
-    throws MathUserException {
+    throws DerivativeException {
 
     if (model.steps.size() == 0) {
       return;
@@ -194,11 +194,11 @@ public class ContinuousOutputModel
    * the instance for later use.
    * @param interpolator interpolator for the last accepted step.
    * @param isLast true if the step is the last one
-   * @exception MathUserException if user code called from step interpolator
+   * @exception DerivativeException if user code called from step interpolator
    * finalization triggers one
    */
   public void handleStep(final StepInterpolator interpolator, final boolean isLast)
-    throws MathUserException {
+    throws DerivativeException {
 
     if (steps.size() == 0) {
       initialTime = interpolator.getPreviousTime();
@@ -343,10 +343,10 @@ public class ContinuousOutputModel
   /**
    * Get the state vector of the interpolated point.
    * @return state vector at time {@link #getInterpolatedTime}
-   * @exception MathUserException if user code called from step interpolator
+   * @exception DerivativeException if user code called from step interpolator
    * finalization triggers one
    */
-  public double[] getInterpolatedState() throws MathUserException {
+  public double[] getInterpolatedState() throws DerivativeException {
     return steps.get(index).getInterpolatedState();
   }
 

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderConverter.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderConverter.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderConverter.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /** This class converts second order differential equations to first
  * order ones.
@@ -97,11 +97,11 @@ public class FirstOrderConverter impleme
    * @param t current value of the independent <I>time</I> variable
    * @param y array containing the current value of the state vector
    * @param yDot placeholder array where to put the time derivative of the state vector
-   * @throws MathUserException this exception is propagated to the caller if the
+   * @throws DerivativeException this exception is propagated to the caller if the
    * underlying user function triggers one
    */
   public void computeDerivatives(final double t, final double[] y, final double[] yDot)
-      throws MathUserException {
+      throws DerivativeException {
 
     // split the state vector in two
     System.arraycopy(y, 0,         z,    0, dimension);

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,6 @@
 
 package org.apache.commons.math.ode;
 
-import org.apache.commons.math.exception.MathUserException;
 
 
 /** This interface represents a first order differential equations set.
@@ -58,10 +57,10 @@ public interface FirstOrderDifferentialE
      * @param t current value of the independent <I>time</I> variable
      * @param y array containing the current value of the state vector
      * @param yDot placeholder array where to put the time derivative of the state vector
-     * @throws MathUserException this user-defined exception should be used if an error is
+     * @throws DerivativeException this user-defined exception should be used if an error is
      * is triggered by user code
      */
     void computeDerivatives(double t, double[] y, double[] yDot)
-        throws MathUserException;
+        throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/FirstOrderIntegrator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,6 @@
 
 package org.apache.commons.math.ode;
 
-import org.apache.commons.math.exception.MathUserException;
 
 /** This interface represents a first order integrator for
  * differential equations.
@@ -51,12 +50,12 @@ public interface FirstOrderIntegrator ex
    * @return stop time, will be the same as target time if integration reached its
    * target, but may be different if some {@link
    * org.apache.commons.math.ode.events.EventHandler} stops it at some point.
-   * @throws IntegratorException if the integrator cannot perform integration
-   * @throws MathUserException this exception is propagated to the caller if
+   * @throws DerivativeException this exception is propagated to the caller if
    * the underlying user function triggers one
+   * @throws IntegratorException if the integrator cannot perform integration
    */
   double integrate (FirstOrderDifferentialEquations equations,
                     double t0, double[] y0,
-                    double t, double[] y) throws MathUserException, IntegratorException;
+                    double t, double[] y) throws DerivativeException, IntegratorException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/MultistepIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/MultistepIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/MultistepIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/MultistepIntegrator.java Mon Feb 21 21:46:52 2011
@@ -18,7 +18,7 @@
 package org.apache.commons.math.ode;
 
 import org.apache.commons.math.MathRuntimeException;
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.linear.Array2DRowRealMatrix;
 import org.apache.commons.math.linear.RealMatrix;
@@ -206,11 +206,11 @@ public abstract class MultistepIntegrato
      * @param t target time for the integration
      * (can be set to a value smaller than <code>t0</code> for backward integration)
      * @throws IntegratorException if the integrator cannot perform integration
-     * @throws MathUserException this exception is propagated to the caller if
+     * @throws DerivativeException this exception is propagated to the caller if
      * the underlying user function triggers one
      */
     protected void start(final double t0, final double[] y0, final double t)
-        throws MathUserException, IntegratorException {
+        throws DerivativeException, IntegratorException {
 
         // make sure NO user event nor user step handler is triggered,
         // this is the task of the top level integrator, not the task
@@ -225,7 +225,7 @@ public abstract class MultistepIntegrato
         try {
             starter.integrate(new CountingDifferentialEquations(y0.length),
                               t0, y0, t, new double[y0.length]);
-        } catch (MathUserException mue) {
+        } catch (DerivativeException mue) {
             if (!(mue instanceof InitializationCompletedMarkerException)) {
                 // this is not the expected nominal interruption of the start integrator
                 throw mue;
@@ -322,7 +322,7 @@ public abstract class MultistepIntegrato
 
         /** {@inheritDoc} */
         public void handleStep(StepInterpolator interpolator, boolean isLast)
-            throws MathUserException {
+            throws DerivativeException {
 
             final double prev = interpolator.getPreviousTime();
             final double curr = interpolator.getCurrentTime();
@@ -367,7 +367,7 @@ public abstract class MultistepIntegrato
 
     /** Marker exception used ONLY to stop the starter integrator after first step. */
     private static class InitializationCompletedMarkerException
-        extends MathUserException {
+        extends DerivativeException {
 
         /** Serializable version identifier. */
         private static final long serialVersionUID = -4105805787353488365L;
@@ -394,7 +394,7 @@ public abstract class MultistepIntegrato
 
         /** {@inheritDoc} */
         public void computeDerivatives(double t, double[] y, double[] dot)
-                throws MathUserException {
+                throws DerivativeException {
             MultistepIntegrator.this.computeDerivatives(t, y, dot);
         }
 

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderDifferentialEquations.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderDifferentialEquations.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderDifferentialEquations.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderDifferentialEquations.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /** This interface represents a second order differential equations set.
 
@@ -60,10 +60,10 @@ public interface SecondOrderDifferential
      * of the state vector
      * @param yDDot placeholder array where to put the second time derivative
      * of the state vector
-     * @throws MathUserException this user-defined exception should be used if an error is
+     * @throws DerivativeException this user-defined exception should be used if an error is
      * is triggered by user code
      */
     void computeSecondDerivatives(double t, double[] y, double[] yDot, double[] yDDot)
-        throws MathUserException;
+        throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/SecondOrderIntegrator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 
 /** This interface represents a second order integrator for
@@ -49,12 +49,12 @@ public interface SecondOrderIntegrator e
    * @param yDot placeholder where to put the first derivative of
    * the state vector at time t, can be the same object as yDot0
    * @throws IntegratorException if the integrator cannot perform integration
-   * @throws MathUserException this exception is propagated to the caller if the
+   * @throws DerivativeException this exception is propagated to the caller if the
    * underlying user function triggers one
    */
   void integrate(SecondOrderDifferentialEquations equations,
                  double t0, double[] y0, double[] yDot0,
                  double t, double[] y, double[] yDot)
-      throws MathUserException, IntegratorException;
+      throws DerivativeException, IntegratorException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/CombinedEventsManager.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/CombinedEventsManager.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/CombinedEventsManager.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/CombinedEventsManager.java Mon Feb 21 21:46:52 2011
@@ -23,7 +23,7 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.commons.math.ConvergenceException;
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
@@ -116,12 +116,12 @@ public class CombinedEventsManager {
      * @return true if at least one event handler triggers an event
      * before the end of the proposed step (this implies the step should
      * be rejected)
-     * @exception MathUserException if the interpolator fails to
+     * @exception DerivativeException if the interpolator fails to
      * compute the function somewhere within the step
      * @exception IntegratorException if an event cannot be located
      */
     public boolean evaluateStep(final StepInterpolator interpolator)
-    throws MathUserException, IntegratorException {
+    throws DerivativeException, IntegratorException {
 
         try {
 
@@ -169,8 +169,8 @@ public class CombinedEventsManager {
 
         } catch (EventException se) {
             final Throwable cause = se.getCause();
-            if ((cause != null) && (cause instanceof MathUserException)) {
-                throw (MathUserException) cause;
+            if ((cause != null) && (cause instanceof DerivativeException)) {
+                throw (DerivativeException) cause;
             }
             throw new IntegratorException(se);
         } catch (ConvergenceException ce) {

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/EventState.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/EventState.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/EventState.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/events/EventState.java Mon Feb 21 21:46:52 2011
@@ -22,7 +22,7 @@ import org.apache.commons.math.FunctionE
 import org.apache.commons.math.analysis.UnivariateRealFunction;
 import org.apache.commons.math.analysis.solvers.BrentSolver;
 import org.apache.commons.math.exception.MathInternalError;
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 import org.apache.commons.math.util.FastMath;
 
@@ -180,7 +180,7 @@ public class EventState {
                 g0Positive = g0 >= 0;
             }
 
-        } catch (MathUserException mue) {
+        } catch (DerivativeException mue) {
             throw new EventException(mue);
         }
     }
@@ -189,14 +189,14 @@ public class EventState {
      * @param interpolator step interpolator for the proposed step
      * @return true if the event handler triggers an event before
      * the end of the proposed step
-     * @exception MathUserException if the interpolator fails to
+     * @exception DerivativeException if the interpolator fails to
      * compute the switching function somewhere within the step
      * @exception EventException if the switching function
      * cannot be evaluated
      * @exception ConvergenceException if an event cannot be located
      */
     public boolean evaluateStep(final StepInterpolator interpolator)
-        throws MathUserException, EventException, ConvergenceException {
+        throws DerivativeException, EventException, ConvergenceException {
 
         try {
 
@@ -228,12 +228,14 @@ public class EventState {
                     increasing = gb >= ga;
 
                     final UnivariateRealFunction f = new UnivariateRealFunction() {
-                        public double value(final double t) throws MathUserException {
+                        public double value(final double t) {
                             try {
                                 interpolator.setInterpolatedTime(t);
                                 return handler.g(t, interpolator.getInterpolatedState());
+                            } catch (DerivativeException e) {
+                                throw new EmbeddedDerivativeException(e);
                             } catch (EventException e) {
-                                throw new MathUserException(e);
+                                throw new EmbeddedEventException(e);
                             }
                         }
                     };
@@ -253,7 +255,7 @@ public class EventState {
                             try {
                                 ga = f.value(ta);
                             } catch (FunctionEvaluationException ex) {
-                                throw new MathUserException(ex);
+                                throw new DerivativeException(ex);
                             }
                         }
                         if (ga * gb > 0) {
@@ -268,7 +270,7 @@ public class EventState {
                                 solver.solve(maxIterationCount, f, ta, tb) :
                                     solver.solve(maxIterationCount, f, tb, ta);
                     } catch (FunctionEvaluationException ex) {
-                        throw new MathUserException(ex);
+                        throw new DerivativeException(ex);
                     }
 
                     if ((!Double.isNaN(previousEventTime)) &&
@@ -301,12 +303,10 @@ public class EventState {
             pendingEventTime = Double.NaN;
             return false;
 
-        } catch (MathUserException mue) {
-            final Throwable cause = mue.getCause();
-            if ((cause != null) && (cause instanceof EventException)) {
-                throw (EventException) cause;
-            }
-            throw mue;
+        } catch (EmbeddedDerivativeException ede) {
+            throw ede.getDerivativeException();
+        } catch (EmbeddedEventException eee) {
+            throw eee.getEventException();
         }
 
     }
@@ -379,4 +379,53 @@ public class EventState {
 
     }
 
+    /** Local exception for embedding DerivativeException. */
+    private static class EmbeddedDerivativeException extends RuntimeException {
+
+        /** Serializable UID. */
+        private static final long serialVersionUID = 3574188382434584610L;
+
+        /** Embedded exception. */
+        private final DerivativeException derivativeException;
+
+        /** Simple constructor.
+         * @param derivativeException embedded exception
+         */
+        public EmbeddedDerivativeException(final DerivativeException derivativeException) {
+            this.derivativeException = derivativeException;
+        }
+
+        /** Get the embedded exception.
+         * @return embedded exception
+         */
+        public DerivativeException getDerivativeException() {
+            return derivativeException;
+        }
+
+    }
+
+    /** Local exception for embedding EventException. */
+    private static class EmbeddedEventException extends RuntimeException {
+
+        /** Serializable UID. */
+        private static final long serialVersionUID = -1337749250090455474L;
+
+        /** Embedded exception. */
+        private final EventException eventException;
+
+        /** Simple constructor.
+         * @param eventException embedded exception
+         */
+        public EmbeddedEventException(final EventException eventException) {
+            this.eventException = eventException;
+        }
+
+        /** Get the embedded exception.
+         * @return embedded exception
+         */
+        public EventException getEventException() {
+            return eventException;
+        }
+
+    }
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/FirstOrderIntegratorWithJacobians.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/FirstOrderIntegratorWithJacobians.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/FirstOrderIntegratorWithJacobians.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/FirstOrderIntegratorWithJacobians.java Mon Feb 21 21:46:52 2011
@@ -26,7 +26,7 @@ import java.util.Collection;
 
 import org.apache.commons.math.MathRuntimeException;
 import org.apache.commons.math.MaxEvaluationsExceededException;
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.ode.ExtendedFirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderIntegrator;
@@ -209,13 +209,13 @@ public class FirstOrderIntegratorWithJac
      * @return stop time, will be the same as target time if integration reached its
      * target, but may be different if some event handler stops it at some point.
      * @throws IntegratorException if the integrator cannot perform integration
-     * @throws MathUserException this exception is propagated to the caller if
+     * @throws DerivativeException this exception is propagated to the caller if
      * the underlying user function triggers one
      */
     public double integrate(final double t0, final double[] y0, final double[][] dY0dP,
                             final double t, final double[] y,
                             final double[][] dYdY0, final double[][] dYdP)
-        throws MathUserException, IntegratorException {
+        throws DerivativeException, IntegratorException {
 
         final int n = ode.getDimension();
         final int k = ode.getParametersDimension();
@@ -398,7 +398,7 @@ public class FirstOrderIntegratorWithJac
 
         /** {@inheritDoc} */
         public void computeDerivatives(final double t, final double[] z, final double[] zDot)
-            throws MathUserException {
+            throws DerivativeException {
 
             final int n = y.length;
             final int k = dFdP[0].length;
@@ -406,7 +406,7 @@ public class FirstOrderIntegratorWithJac
             // compute raw ODE and its jacobians: dy/dt, d[dy/dt]/dy0 and d[dy/dt]/dp
             System.arraycopy(z,    0, y,    0, n);
             if (++evaluations > maxEvaluations) {
-                throw new MathUserException(new MaxEvaluationsExceededException(maxEvaluations));
+                throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
             }
             ode.computeDerivatives(t, y, yDot);
             ode.computeJacobians(t, y, yDot, dFdY, dFdP);
@@ -488,7 +488,7 @@ public class FirstOrderIntegratorWithJac
         }
 
         /** {@inheritDoc} */
-        public void computeDerivatives(double t, double[] y, double[] yDot) throws MathUserException {
+        public void computeDerivatives(double t, double[] y, double[] yDot) throws DerivativeException {
             // this call to computeDerivatives has already been counted,
             // we must not increment the counter again
             ode.computeDerivatives(t, y, yDot);
@@ -502,14 +502,14 @@ public class FirstOrderIntegratorWithJac
         /** {@inheritDoc} */
         public void computeJacobians(double t, double[] y, double[] yDot,
                                      double[][] dFdY, double[][] dFdP)
-            throws MathUserException {
+            throws DerivativeException {
 
             final int n = hY.length;
             final int k = hP.length;
 
             evaluations += n + k;
             if (evaluations > maxEvaluations) {
-                throw new MathUserException(new MaxEvaluationsExceededException(maxEvaluations));
+                throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
             }
 
             // compute df/dy where f is the ODE and y is the state array
@@ -570,7 +570,7 @@ public class FirstOrderIntegratorWithJac
 
         /** {@inheritDoc} */
         public void handleStep(StepInterpolator interpolator, boolean isLast)
-            throws MathUserException {
+            throws DerivativeException {
             handler.handleStep(new StepInterpolatorWrapper(interpolator, n, k), isLast);
         }
 
@@ -655,14 +655,14 @@ public class FirstOrderIntegratorWithJac
         }
 
         /** {@inheritDoc} */
-        public double[] getInterpolatedY() throws MathUserException {
+        public double[] getInterpolatedY() throws DerivativeException {
             double[] extendedState = interpolator.getInterpolatedState();
             System.arraycopy(extendedState, 0, y, 0, y.length);
             return y;
         }
 
         /** {@inheritDoc} */
-        public double[][] getInterpolatedDyDy0() throws MathUserException {
+        public double[][] getInterpolatedDyDy0() throws DerivativeException {
             double[] extendedState = interpolator.getInterpolatedState();
             final int n = y.length;
             int start = n;
@@ -674,7 +674,7 @@ public class FirstOrderIntegratorWithJac
         }
 
         /** {@inheritDoc} */
-        public double[][] getInterpolatedDyDp() throws MathUserException {
+        public double[][] getInterpolatedDyDp() throws DerivativeException {
             double[] extendedState = interpolator.getInterpolatedState();
             final int n = y.length;
             final int k = dydp[0].length;
@@ -687,14 +687,14 @@ public class FirstOrderIntegratorWithJac
         }
 
         /** {@inheritDoc} */
-        public double[] getInterpolatedYDot() throws MathUserException {
+        public double[] getInterpolatedYDot() throws DerivativeException {
             double[] extendedDerivatives = interpolator.getInterpolatedDerivatives();
             System.arraycopy(extendedDerivatives, 0, yDot, 0, yDot.length);
             return yDot;
         }
 
         /** {@inheritDoc} */
-        public double[][] getInterpolatedDyDy0Dot() throws MathUserException {
+        public double[][] getInterpolatedDyDy0Dot() throws DerivativeException {
             double[] extendedDerivatives = interpolator.getInterpolatedDerivatives();
             final int n = y.length;
             int start = n;
@@ -706,7 +706,7 @@ public class FirstOrderIntegratorWithJac
         }
 
         /** {@inheritDoc} */
-        public double[][] getInterpolatedDyDpDot() throws MathUserException {
+        public double[][] getInterpolatedDyDpDot() throws DerivativeException {
             double[] extendedDerivatives = interpolator.getInterpolatedDerivatives();
             final int n = y.length;
             final int k = dydpDot[0].length;
@@ -724,7 +724,7 @@ public class FirstOrderIntegratorWithJac
         }
 
         /** {@inheritDoc} */
-        public StepInterpolatorWithJacobians copy() throws MathUserException {
+        public StepInterpolatorWithJacobians copy() throws DerivativeException {
             final int n = y.length;
             final int k = dydp[0].length;
             StepInterpolatorWrapper copied =

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/ODEWithJacobians.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/ODEWithJacobians.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/ODEWithJacobians.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/ODEWithJacobians.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.jacobians;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 
 
@@ -45,10 +45,10 @@ public interface ODEWithJacobians extend
      * @param yDot array containing the current value of the time derivative of the state vector
      * @param dFdY placeholder array where to put the jacobian of the ODE with respect to the state vector
      * @param dFdP placeholder array where to put the jacobian of the ODE with respect to the parameters
-     * @throws MathUserException this exception is propagated to the caller if the
+     * @throws DerivativeException this exception is propagated to the caller if the
      * underlying user function triggers one
      */
     void computeJacobians(double t, double[] y, double[] yDot, double[][] dFdY, double[][] dFdP)
-        throws MathUserException;
+        throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepHandlerWithJacobians.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepHandlerWithJacobians.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepHandlerWithJacobians.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepHandlerWithJacobians.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.jacobians;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /**
  * This interface represents a handler that should be called after
@@ -89,9 +89,9 @@ public interface StepHandlerWithJacobian
    * Keeping only a reference to the interpolator and reusing it will
    * result in unpredictable behavior (potentially crashing the application).
    * @param isLast true if the step is the last one
-   * @throws MathUserException this exception is propagated to the
+   * @throws DerivativeException this exception is propagated to the
    * caller if the underlying user function triggers one
    */
-  void handleStep(StepInterpolatorWithJacobians interpolator, boolean isLast) throws MathUserException;
+  void handleStep(StepInterpolatorWithJacobians interpolator, boolean isLast) throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepInterpolatorWithJacobians.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepInterpolatorWithJacobians.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepInterpolatorWithJacobians.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/jacobians/StepInterpolatorWithJacobians.java Mon Feb 21 21:46:52 2011
@@ -19,7 +19,7 @@ package org.apache.commons.math.ode.jaco
 
 import java.io.Externalizable;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /** This interface represents an interpolator over the last step
  * during an ODE integration.
@@ -90,10 +90,10 @@ public interface StepInterpolatorWithJac
    * to be preserved across several calls.</p>
    * @return state vector at time {@link #getInterpolatedTime}
    * @see #getInterpolatedYDot()
-   * @throws MathUserException if this call induces an automatic
+   * @throws DerivativeException if this call induces an automatic
    * step finalization that throws one
    */
-  double[] getInterpolatedY() throws MathUserException;
+  double[] getInterpolatedY() throws DerivativeException;
 
   /**
    * Get the partial derivatives of the state vector with respect to
@@ -104,10 +104,10 @@ public interface StepInterpolatorWithJac
    * @return partial derivatives of the state vector with respect to
    * the initial state at time {@link #getInterpolatedTime}
    * @see #getInterpolatedY()
-   * @throws MathUserException if this call induces an automatic
+   * @throws DerivativeException if this call induces an automatic
    * step finalization that throws one
    */
-  double[][] getInterpolatedDyDy0() throws MathUserException;
+  double[][] getInterpolatedDyDy0() throws DerivativeException;
 
   /**
    * Get the partial derivatives of the state vector with respect to
@@ -118,10 +118,10 @@ public interface StepInterpolatorWithJac
    * @return partial derivatives of the state vector with respect to
    * the ODE parameters at time {@link #getInterpolatedTime}
    * @see #getInterpolatedY()
-   * @throws MathUserException if this call induces an automatic
+   * @throws DerivativeException if this call induces an automatic
    * step finalization that throws one
    */
-  double[][] getInterpolatedDyDp() throws MathUserException;
+  double[][] getInterpolatedDyDp() throws DerivativeException;
 
   /**
    * Get the time derivatives of the state vector of the interpolated point.
@@ -130,10 +130,10 @@ public interface StepInterpolatorWithJac
    * to be preserved across several calls.</p>
    * @return derivatives of the state vector at time {@link #getInterpolatedTime}
    * @see #getInterpolatedY()
-   * @throws MathUserException if this call induces an automatic
+   * @throws DerivativeException if this call induces an automatic
    * step finalization that throws one
    */
-  double[] getInterpolatedYDot() throws MathUserException;
+  double[] getInterpolatedYDot() throws DerivativeException;
 
   /**
    * Get the time derivatives of the jacobian of the state vector
@@ -144,10 +144,10 @@ public interface StepInterpolatorWithJac
    * @return time derivatives of the jacobian of the state vector
    * with respect to the initial state at time {@link #getInterpolatedTime}
    * @see #getInterpolatedY()
-   * @throws MathUserException if this call induces an automatic
+   * @throws DerivativeException if this call induces an automatic
    * step finalization that throws one
    */
-  double[][] getInterpolatedDyDy0Dot() throws MathUserException;
+  double[][] getInterpolatedDyDy0Dot() throws DerivativeException;
 
   /**
    * Get the time derivatives of the jacobian of the state vector
@@ -158,10 +158,10 @@ public interface StepInterpolatorWithJac
    * @return time derivatives of the jacobian of the state vector
    * with respect to the ODE parameters at time {@link #getInterpolatedTime}
    * @see #getInterpolatedY()
-   * @throws MathUserException if this call induces an automatic
+   * @throws DerivativeException if this call induces an automatic
    * step finalization that throws one
    */
-  double[][] getInterpolatedDyDpDot() throws MathUserException;
+  double[][] getInterpolatedDyDpDot() throws DerivativeException;
 
   /** Check if the natural integration direction is forward.
    * <p>This method provides the integration direction as specified by
@@ -179,10 +179,10 @@ public interface StepInterpolatorWithJac
    * original one. Both can be used with different settings for
    * interpolated time without any side effect.</p>
    * @return a deep copy of the instance, which can be used independently.
-   * @throws MathUserException if this call induces an automatic
+   * @throws DerivativeException if this call induces an automatic
    * step finalization that throws one
    * @see #setInterpolatedTime(double)
    */
-   StepInterpolatorWithJacobians copy() throws MathUserException;
+   StepInterpolatorWithJacobians copy() throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java Mon Feb 21 21:46:52 2011
@@ -17,8 +17,8 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.linear.Array2DRowRealMatrix;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.sampling.NordsieckStepInterpolator;
@@ -188,7 +188,7 @@ public class AdamsBashforthIntegrator ex
     public double integrate(final FirstOrderDifferentialEquations equations,
                             final double t0, final double[] y0,
                             final double t, final double[] y)
-        throws MathUserException, IntegratorException {
+        throws DerivativeException, IntegratorException {
 
         final int n = y0.length;
         sanityChecks(equations, t0, y0, t, y);

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsIntegrator.java Mon Feb 21 21:46:52 2011
@@ -17,8 +17,8 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.linear.Array2DRowRealMatrix;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.MultistepIntegrator;
@@ -85,7 +85,7 @@ public abstract class AdamsIntegrator ex
     public abstract double integrate(final FirstOrderDifferentialEquations equations,
                                      final double t0, final double[] y0,
                                      final double t, final double[] y)
-        throws MathUserException, IntegratorException;
+        throws DerivativeException, IntegratorException;
 
     /** {@inheritDoc} */
     @Override

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdamsMoultonIntegrator.java Mon Feb 21 21:46:52 2011
@@ -19,9 +19,9 @@ package org.apache.commons.math.ode.nons
 
 import java.util.Arrays;
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.linear.Array2DRowRealMatrix;
 import org.apache.commons.math.linear.RealMatrixPreservingVisitor;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.sampling.NordsieckStepInterpolator;
@@ -205,7 +205,7 @@ public class AdamsMoultonIntegrator exte
     public double integrate(final FirstOrderDifferentialEquations equations,
                             final double t0, final double[] y0,
                             final double t, final double[] y)
-        throws MathUserException, IntegratorException {
+        throws DerivativeException, IntegratorException {
 
         final int n = y0.length;
         sanityChecks(equations, t0, y0, t, y);

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java Mon Feb 21 21:46:52 2011
@@ -17,9 +17,9 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.ode.AbstractIntegrator;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.ExtendedFirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.IntegratorException;
@@ -213,14 +213,14 @@ public abstract class AdaptiveStepsizeIn
    * @param y1 work array for a state vector
    * @param yDot1 work array for the first time derivative of y1
    * @return first integration step
-   * @exception MathUserException this exception is propagated to
+   * @exception DerivativeException this exception is propagated to
    * the caller if the underlying user function triggers one
    */
   public double initializeStep(final FirstOrderDifferentialEquations equations,
                                final boolean forward, final int order, final double[] scale,
                                final double t0, final double[] y0, final double[] yDot0,
                                final double[] y1, final double[] yDot1)
-      throws MathUserException {
+      throws DerivativeException {
 
     if (initialStep > 0) {
       // use the user provided value
@@ -318,7 +318,7 @@ public abstract class AdaptiveStepsizeIn
   public abstract double integrate (FirstOrderDifferentialEquations equations,
                                     double t0, double[] y0,
                                     double t, double[] y)
-    throws MathUserException, IntegratorException;
+    throws DerivativeException, IntegratorException;
 
   /** {@inheritDoc} */
   @Override

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
 /**
@@ -83,7 +83,7 @@ class ClassicalRungeKuttaStepInterpolato
     @Override
     protected void computeInterpolatedStateAndDerivatives(final double theta,
                                             final double oneMinusThetaH)
-        throws MathUserException {
+        throws DerivativeException {
 
         final double fourTheta      = 4 * theta;
         final double oneMinusTheta  = 1 - theta;

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.AbstractIntegrator;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
@@ -166,7 +166,7 @@ class DormandPrince54StepInterpolator
   @Override
   protected void computeInterpolatedStateAndDerivatives(final double theta,
                                           final double oneMinusThetaH)
-    throws MathUserException {
+    throws DerivativeException {
 
     if (! vectorsInitialized) {
 

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -21,8 +21,8 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.AbstractIntegrator;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
 /**
@@ -312,7 +312,7 @@ class DormandPrince853StepInterpolator
   @Override
   protected void computeInterpolatedStateAndDerivatives(final double theta,
                                           final double oneMinusThetaH)
-    throws MathUserException {
+    throws DerivativeException {
 
     if (! vectorsInitialized) {
 
@@ -386,7 +386,7 @@ class DormandPrince853StepInterpolator
   /** {@inheritDoc} */
   @Override
   protected void doFinalize()
-    throws MathUserException {
+    throws DerivativeException {
 
     if (currentState == null) {
       // we are finalizing an uninitialized instance
@@ -436,7 +436,7 @@ class DormandPrince853StepInterpolator
     try {
       // save the local attributes
       finalizeStep();
-    } catch (MathUserException e) {
+    } catch (DerivativeException e) {
         IOException ioe = new IOException(e.getLocalizedMessage());
         ioe.initCause(e);
         throw ioe;

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.sampling.AbstractStepInterpolator;
@@ -192,7 +192,7 @@ public abstract class EmbeddedRungeKutta
   public double integrate(final FirstOrderDifferentialEquations equations,
                           final double t0, final double[] y0,
                           final double t, final double[] y)
-  throws MathUserException, IntegratorException {
+  throws DerivativeException, IntegratorException {
 
     sanityChecks(equations, t0, y0, t, y);
     setEquations(equations);

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/EulerStepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
 /**
@@ -79,7 +79,7 @@ class EulerStepInterpolator
   @Override
   protected void computeInterpolatedStateAndDerivatives(final double theta,
                                           final double oneMinusThetaH)
-    throws MathUserException {
+    throws DerivativeException {
 
     for (int i = 0; i < interpolatedState.length; ++i) {
       interpolatedState[i] = currentState[i] - oneMinusThetaH * yDotK[0][i];

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GillStepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 import org.apache.commons.math.util.FastMath;
 
@@ -91,7 +91,7 @@ class GillStepInterpolator
   @Override
   protected void computeInterpolatedStateAndDerivatives(final double theta,
                                           final double oneMinusThetaH)
-    throws MathUserException {
+    throws DerivativeException {
 
     final double twoTheta  = 2 * theta;
     final double fourTheta = 4 * theta;

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.events.EventHandler;
@@ -453,14 +453,14 @@ public class GraggBulirschStoerIntegrato
    * @param yTmp placeholder for one state vector
    * @return true if computation was done properly,
    *         false if stability check failed before end of computation
-   * @throws MathUserException this exception is propagated to the caller if the
+   * @throws DerivativeException this exception is propagated to the caller if the
    * underlying user function triggers one
    */
   private boolean tryStep(final double t0, final double[] y0, final double step, final int k,
                           final double[] scale, final double[][] f,
                           final double[] yMiddle, final double[] yEnd,
                           final double[] yTmp)
-    throws MathUserException {
+    throws DerivativeException {
 
     final int    n        = sequence[k];
     final double subStep  = step / n;
@@ -549,7 +549,7 @@ public class GraggBulirschStoerIntegrato
   @Override
   public double integrate(final FirstOrderDifferentialEquations equations,
                           final double t0, final double[] y0, final double t, final double[] y)
-      throws MathUserException, IntegratorException {
+      throws DerivativeException, IntegratorException {
 
     sanityChecks(equations, t0, y0, t, y);
     setEquations(equations);

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
 /**
@@ -71,7 +71,7 @@ class HighamHall54StepInterpolator
   @Override
   protected void computeInterpolatedStateAndDerivatives(final double theta,
                                           final double oneMinusThetaH)
-    throws MathUserException {
+    throws DerivativeException {
 
     final double theta2 = theta * theta;
 

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
 /**
@@ -81,7 +81,7 @@ class MidpointStepInterpolator
   @Override
   protected void computeInterpolatedStateAndDerivatives(final double theta,
                                           final double oneMinusThetaH)
-    throws MathUserException {
+    throws DerivativeException {
 
     final double coeff1    = oneMinusThetaH * theta;
     final double coeff2    = oneMinusThetaH * (1.0 + theta);

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java Mon Feb 21 21:46:52 2011
@@ -18,8 +18,8 @@
 package org.apache.commons.math.ode.nonstiff;
 
 
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.ode.AbstractIntegrator;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
 import org.apache.commons.math.ode.IntegratorException;
 import org.apache.commons.math.ode.sampling.AbstractStepInterpolator;
@@ -95,7 +95,7 @@ public abstract class RungeKuttaIntegrat
   public double integrate(final FirstOrderDifferentialEquations equations,
                           final double t0, final double[] y0,
                           final double t, final double[] y)
-  throws MathUserException, IntegratorException {
+  throws DerivativeException, IntegratorException {
 
     sanityChecks(equations, t0, y0, t, y);
     setEquations(equations);

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.nonstiff;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.ode.sampling.StepInterpolator;
 
 /**
@@ -86,7 +86,7 @@ class ThreeEighthesStepInterpolator
   @Override
   protected void computeInterpolatedStateAndDerivatives(final double theta,
                                           final double oneMinusThetaH)
-      throws MathUserException {
+      throws DerivativeException {
 
       final double fourTheta2 = 4 * theta * theta;
       final double s          = oneMinusThetaH / 8.0;

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/AbstractStepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/AbstractStepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/AbstractStepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/AbstractStepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -21,7 +21,7 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /** This abstract class represents an interpolator over the last step
  * during an ODE integration.
@@ -197,7 +197,7 @@ public abstract class AbstractStepInterp
   }
 
   /** {@inheritDoc} */
-   public StepInterpolator copy() throws MathUserException {
+   public StepInterpolator copy() throws DerivativeException {
 
      // finalize the step before performing copy
      finalizeStep();
@@ -328,15 +328,15 @@ public abstract class AbstractStepInterp
    * (theta is zero at the previous time step and one at the current time step)
    * @param oneMinusThetaH time gap between the interpolated time and
    * the current time
-   * @throws MathUserException this exception is propagated to the caller if the
+   * @throws DerivativeException this exception is propagated to the caller if the
    * underlying user function triggers one
    */
   protected abstract void computeInterpolatedStateAndDerivatives(double theta,
                                                                  double oneMinusThetaH)
-    throws MathUserException;
+    throws DerivativeException;
 
   /** {@inheritDoc} */
-  public double[] getInterpolatedState() throws MathUserException {
+  public double[] getInterpolatedState() throws DerivativeException {
 
       // lazy evaluation of the state
       if (dirtyState) {
@@ -351,7 +351,7 @@ public abstract class AbstractStepInterp
   }
 
   /** {@inheritDoc} */
-  public double[] getInterpolatedDerivatives() throws MathUserException {
+  public double[] getInterpolatedDerivatives() throws DerivativeException {
 
       // lazy evaluation of the state
       if (dirtyState) {
@@ -403,11 +403,11 @@ public abstract class AbstractStepInterp
    * Therefore, subclasses are not allowed not reimplement it, they
    * should rather reimplement <code>doFinalize</code>.</p>
    *
-   * @throws MathUserException this exception is propagated to the
+   * @throws DerivativeException this exception is propagated to the
    * caller if the underlying user function triggers one
    */
   public final void finalizeStep()
-    throws MathUserException {
+    throws DerivativeException {
     if (! finalized) {
       doFinalize();
       finalized = true;
@@ -417,11 +417,11 @@ public abstract class AbstractStepInterp
   /**
    * Really finalize the step.
    * The default implementation of this method does nothing.
-   * @throws MathUserException this exception is propagated to the
+   * @throws DerivativeException this exception is propagated to the
    * caller if the underlying user function triggers one
    */
   protected void doFinalize()
-    throws MathUserException {
+    throws DerivativeException {
   }
 
   /** {@inheritDoc} */
@@ -467,7 +467,7 @@ public abstract class AbstractStepInterp
     // finalize the step (and don't bother saving the now true flag)
     try {
       finalizeStep();
-    } catch (MathUserException e) {
+    } catch (DerivativeException e) {
         IOException ioe = new IOException(e.getLocalizedMessage());
         ioe.initCause(e);
         throw ioe;

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/FixedStepHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/FixedStepHandler.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/FixedStepHandler.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/FixedStepHandler.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.sampling;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /**
  * This interface represents a handler that should be called after
@@ -55,8 +55,8 @@ public interface FixedStepHandler  {
    * provide at the end of the integration a complete array of all
    * steps), it should build a local copy store this copy.
    * @param isLast true if the step is the last one
-   * @throws MathUserException if some error condition is encountered
+   * @throws DerivativeException if some error condition is encountered
    */
-  void handleStep(double t, double[] y, double[] yDot, boolean isLast) throws MathUserException;
+  void handleStep(double t, double[] y, double[] yDot, boolean isLast) throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/NordsieckStepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -22,7 +22,7 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Arrays;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.linear.Array2DRowRealMatrix;
 import org.apache.commons.math.util.FastMath;
 
@@ -171,11 +171,11 @@ public class NordsieckStepInterpolator e
      * to be preserved across several calls.</p>
      * @return state vector at time {@link #getInterpolatedTime}
      * @see #getInterpolatedDerivatives()
-     * @throws MathUserException if this call induces an automatic
+     * @throws DerivativeException if this call induces an automatic
      * step finalization that throws one
      */
     public double[] getInterpolatedStateVariation()
-        throws MathUserException {
+        throws DerivativeException {
         // compute and ignore interpolated state
         // to make sure state variation is computed as a side effect
         getInterpolatedState();

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.sampling;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /**
  * This interface represents a handler that should be called after
@@ -70,9 +70,9 @@ public interface StepHandler {
    * Keeping only a reference to the interpolator and reusing it will
    * result in unpredictable behavior (potentially crashing the application).
    * @param isLast true if the step is the last one
-   * @exception MathUserException if user code called from step interpolator
+   * @exception DerivativeException if user code called from step interpolator
    * finalization triggers one
    */
-  void handleStep(StepInterpolator interpolator, boolean isLast) throws MathUserException;
+  void handleStep(StepInterpolator interpolator, boolean isLast) throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepInterpolator.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepInterpolator.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepInterpolator.java Mon Feb 21 21:46:52 2011
@@ -19,7 +19,7 @@ package org.apache.commons.math.ode.samp
 
 import java.io.Externalizable;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 
 /** This interface represents an interpolator over the last step
  * during an ODE integration.
@@ -89,10 +89,10 @@ public interface StepInterpolator extend
    * to be preserved across several calls.</p>
    * @return state vector at time {@link #getInterpolatedTime}
    * @see #getInterpolatedDerivatives()
-   * @exception MathUserException if user code called from step interpolator
+   * @exception DerivativeException if user code called from step interpolator
    * finalization triggers one
    */
-  double[] getInterpolatedState() throws MathUserException;
+  double[] getInterpolatedState() throws DerivativeException;
 
   /**
    * Get the derivatives of the state vector of the interpolated point.
@@ -101,11 +101,11 @@ public interface StepInterpolator extend
    * to be preserved across several calls.</p>
    * @return derivatives of the state vector at time {@link #getInterpolatedTime}
    * @see #getInterpolatedState()
-   * @exception MathUserException if user code called from step interpolator
+   * @exception DerivativeException if user code called from step interpolator
    * finalization triggers one
    * @since 2.0
    */
-  double[] getInterpolatedDerivatives() throws MathUserException;
+  double[] getInterpolatedDerivatives() throws DerivativeException;
 
   /** Check if the natural integration direction is forward.
    * <p>This method provides the integration direction as specified by
@@ -123,10 +123,10 @@ public interface StepInterpolator extend
    * original one. Both can be used with different settings for
    * interpolated time without any side effect.</p>
    * @return a deep copy of the instance, which can be used independently.
-   * @exception MathUserException if user code called from step interpolator
+   * @exception DerivativeException if user code called from step interpolator
    * finalization triggers one
    * @see #setInterpolatedTime(double)
    */
-   StepInterpolator copy() throws MathUserException;
+   StepInterpolator copy() throws DerivativeException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepNormalizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepNormalizer.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepNormalizer.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/sampling/StepNormalizer.java Mon Feb 21 21:46:52 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.ode.sampling;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.ode.DerivativeException;
 import org.apache.commons.math.util.FastMath;
 
 /**
@@ -109,11 +109,11 @@ public class StepNormalizer implements S
      * should build a local copy using the clone method and store this
      * copy.
      * @param isLast true if the step is the last one
-     * @throws MathUserException this exception is propagated to the
+     * @throws DerivativeException this exception is propagated to the
      * caller if the underlying user function triggers one
      */
     public void handleStep(final StepInterpolator interpolator, final boolean isLast)
-        throws MathUserException {
+        throws DerivativeException {
 
         if (lastState == null) {
 

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java Mon Feb 21 21:46:52 2011
@@ -18,7 +18,7 @@
 package org.apache.commons.math.optimization;
 
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.FunctionEvaluationException;
 
 /**
  * This interface represents an optimization algorithm for {@link DifferentiableMultivariateVectorialFunction
@@ -101,7 +101,7 @@ public interface DifferentiableMultivari
      * @param weights weight for the least squares cost computation
      * @param startPoint the start point for optimization
      * @return the point/value pair giving the optimal value for objective function
-     * @exception MathUserException if the objective function throws one during
+     * @exception FunctionEvaluationException if the objective function throws one during
      * the search
      * @exception OptimizationException if the algorithm failed to converge
      * @exception IllegalArgumentException if the start point dimension is wrong
@@ -109,6 +109,6 @@ public interface DifferentiableMultivari
     VectorialPointValuePair optimize(DifferentiableMultivariateVectorialFunction f,
                                      double[] target, double[] weights,
                                      double[] startPoint)
-        throws MathUserException, OptimizationException, IllegalArgumentException;
+        throws FunctionEvaluationException, OptimizationException, IllegalArgumentException;
 
 }

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java Mon Feb 21 21:46:52 2011
@@ -23,7 +23,6 @@ import java.util.Comparator;
 import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.MathRuntimeException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateRealFunction;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.random.RandomVectorGenerator;
 
@@ -173,7 +172,7 @@ public class MultiStartDifferentiableMul
     public RealPointValuePair optimize(final DifferentiableMultivariateRealFunction f,
                                          final GoalType goalType,
                                          double[] startPoint)
-        throws MathUserException, OptimizationException, FunctionEvaluationException {
+        throws FunctionEvaluationException, OptimizationException, FunctionEvaluationException {
 
         optima                   = new RealPointValuePair[starts];
         totalIterations          = 0;
@@ -188,7 +187,7 @@ public class MultiStartDifferentiableMul
                 optimizer.setMaxEvaluations(maxEvaluations - totalEvaluations);
                 optima[i] = optimizer.optimize(f, goalType,
                                                (i == 0) ? startPoint : generator.nextVector());
-            } catch (MathUserException fee) {
+            } catch (FunctionEvaluationException fee) {
                 optima[i] = null;
             } catch (OptimizationException oe) {
                 optima[i] = null;

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizer.java?rev=1073158&r1=1073157&r2=1073158&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizer.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizer.java Mon Feb 21 21:46:52 2011
@@ -22,7 +22,7 @@ import java.util.Comparator;
 
 import org.apache.commons.math.MathRuntimeException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.random.RandomVectorGenerator;
 
@@ -176,7 +176,7 @@ public class MultiStartDifferentiableMul
     public VectorialPointValuePair optimize(final DifferentiableMultivariateVectorialFunction f,
                                             final double[] target, final double[] weights,
                                             final double[] startPoint)
-        throws MathUserException, OptimizationException, IllegalArgumentException {
+        throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
 
         optima                   = new VectorialPointValuePair[starts];
         totalIterations          = 0;
@@ -191,7 +191,7 @@ public class MultiStartDifferentiableMul
                 optimizer.setMaxEvaluations(maxEvaluations - totalEvaluations);
                 optima[i] = optimizer.optimize(f, target, weights,
                                                (i == 0) ? startPoint : generator.nextVector());
-            } catch (MathUserException fee) {
+            } catch (FunctionEvaluationException fee) {
                 optima[i] = null;
             } catch (OptimizationException oe) {
                 optima[i] = null;