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/11/12 00:39:34 UTC

svn commit: r1201105 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/ode/AbstractIntegrator.java site/xdoc/changes.xml

Author: luc
Date: Fri Nov 11 23:39:34 2011
New Revision: 1201105

URL: http://svn.apache.org/viewvc?rev=1201105&view=rev
Log:
Fixed a bad interaction between step handlers and event handlers in ODE
integrators.

The problem was due to an internal array from the step interpolator that
was changed by the step handlers. These array was expected to contain
the state at event time, but was overridden later on. the solution is
simply to clone the array. Note that the fact the array is reused *is*
documented in the javadoc and is a feature of the interpolators ...

JIRA: MATH-706

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java
    commons/proper/math/trunk/src/site/xdoc/changes.xml

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java?rev=1201105&r1=1201104&r2=1201105&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/AbstractIntegrator.java Fri Nov 11 23:39:34 2011
@@ -318,7 +318,7 @@ public abstract class AbstractIntegrator
 
                 // trigger the event
                 interpolator.setInterpolatedTime(eventT);
-                final double[] eventY = interpolator.getInterpolatedState();
+                final double[] eventY = interpolator.getInterpolatedState().clone();
                 currentEvent.stepAccepted(eventT, eventY);
                 isLastStep = currentEvent.stop();
 

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=1201105&r1=1201104&r2=1201105&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Fri Nov 11 23:39:34 2011
@@ -52,6 +52,10 @@ 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="fix" due-to="MATH-706" >
+        Fixed a bad interaction between step handlers and event handlers in
+        ODE integrators.
+      </action>
       <action dev="luc" type="add" due-to="Jan Kotek" >
         Added array constructor and getter for Vector2D and Vector3D.
       </action>