commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r591650 - in /commons/proper/math/trunk/src/java/org/apache/commons/math/ode: ClassicalRungeKuttaIntegrator.java EulerIntegrator.java GillIntegrator.java MidpointIntegrator.java RungeKuttaIntegrator.java ThreeEighthesIntegrator.java
Date Sat, 03 Nov 2007 16:47:56 GMT
Author: luc
Date: Sat Nov  3 09:47:55 2007
New Revision: 591650

URL: http://svn.apache.org/viewvc?rev=591650&view=rev
Log:
removed unused FSAL flag for simple Runge-Kutta schemes
it is used only for Runge-Kutta-Fehlberg schemes

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/ode/EulerIntegrator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/ode/GillIntegrator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java?rev=591650&r1=591649&r2=591650&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
Sat Nov  3 09:47:55 2007
@@ -68,7 +68,7 @@
    * @param step integration step
    */
   public ClassicalRungeKuttaIntegrator(double step) {
-    super(false, c, a, b, new ClassicalRungeKuttaStepInterpolator(), step);
+    super(c, a, b, new ClassicalRungeKuttaStepInterpolator(), step);
   }
 
   /** Get the name of the method.

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/ode/EulerIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/ode/EulerIntegrator.java?rev=591650&r1=591649&r2=591650&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/ode/EulerIntegrator.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/ode/EulerIntegrator.java Sat
Nov  3 09:47:55 2007
@@ -66,7 +66,7 @@
    * @param step integration step
    */
   public EulerIntegrator(double step) {
-    super(false, c, a, b, new EulerStepInterpolator(), step);
+    super(c, a, b, new EulerStepInterpolator(), step);
   }
 
   /** Get the name of the method.

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/ode/GillIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/ode/GillIntegrator.java?rev=591650&r1=591649&r2=591650&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/ode/GillIntegrator.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/ode/GillIntegrator.java Sat
Nov  3 09:47:55 2007
@@ -68,7 +68,7 @@
    * @param step integration step
    */
   public GillIntegrator(double step) {
-    super(false, c, a, b, new GillStepInterpolator(), step);
+    super(c, a, b, new GillStepInterpolator(), step);
   }
 
   /** Get the name of the method.

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/ode/MidpointIntegrator.java?rev=591650&r1=591649&r2=591650&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
Sat Nov  3 09:47:55 2007
@@ -61,7 +61,7 @@
    * @param step integration step
    */
   public MidpointIntegrator(double step) {
-    super(false, c, a, b, new MidpointStepInterpolator(), step);
+    super(c, a, b, new MidpointStepInterpolator(), step);
   }
 
   /** Get the name of the method.

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java?rev=591650&r1=591649&r2=591650&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
Sat Nov  3 09:47:55 2007
@@ -34,16 +34,6 @@
  * </pre>
  * </p>
 
- * <p>Some methods are qualified as <i>fsal</i> (first same as last)
- * methods. This means the last evaluation of the derivatives in one
- * step is the same as the first in the next step. Then, this
- * evaluation can be reused from one step to the next one and the cost
- * of such a method is really s-1 evaluations despite the method still
- * has s stages. This behaviour is true only for successful steps, if
- * the step is rejected after the error estimation phase, no
- * evaluation is saved. For an <i>fsal</i> method, we have cs = 1 and
- * asi = bi for all i.</p>
-
  * @see EulerIntegrator
  * @see ClassicalRungeKuttaIntegrator
  * @see GillIntegrator
@@ -59,18 +49,15 @@
   /** Simple constructor.
    * Build a Runge-Kutta integrator with the given
    * step. The default step handler does nothing.
-   * @param fsal indicate that the method is an <i>fsal</i>
    * @param c time steps from Butcher array (without the first zero)
    * @param a internal weights from Butcher array (without the first empty row)
    * @param b external weights for the high order method from Butcher array
    * @param prototype prototype of the step interpolator to use
    * @param step integration step
    */
-  protected RungeKuttaIntegrator(boolean fsal,
-                                 double[] c, double[][] a, double[] b,
+  protected RungeKuttaIntegrator(double[] c, double[][] a, double[] b,
                                  RungeKuttaStepInterpolator prototype,
                                  double step) {
-    this.fsal       = fsal;
     this.c          = c;
     this.a          = a;
     this.b          = b;
@@ -182,7 +169,6 @@
 
     // recompute the step
     long    nbStep    = Math.max(1l, Math.abs(Math.round((t - t0) / step)));
-    boolean firstTime = true;
     boolean lastStep  = false;
     stepStart = t0;
     stepSize  = (t - t0) / nbStep;
@@ -194,11 +180,8 @@
       boolean needUpdate = false;
       for (boolean loop = true; loop;) {
 
-        if (firstTime || !fsal) {
-          // first stage
-          equations.computeDerivatives(stepStart, y, yDotK[0]);
-          firstTime = false;
-        }
+        // first stage
+        equations.computeDerivatives(stepStart, y, yDotK[0]);
 
         // next stages
         for (int k = 1; k < stages; ++k) {
@@ -249,11 +232,6 @@
       interpolator.storeTime(stepStart);
       handler.handleStep(interpolator, lastStep);
 
-      if (fsal) {
-        // save the last evaluation for the next step
-        System.arraycopy(yDotK[stages - 1], 0, yDotK[0], 0, y0.length);
-      }
-
       if (switchesHandler.reset(stepStart, y) && ! lastStep) {
         // some switching function has triggered changes that
         // invalidate the derivatives, we need to recompute them
@@ -287,9 +265,6 @@
     stepStart = Double.NaN;
     stepSize  = Double.NaN;
   }
-
-  /** Indicator for <i>fsal</i> methods. */
-  private boolean fsal;
 
   /** Time steps from Butcher array (without the first zero). */
   private double[] c;

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java?rev=591650&r1=591649&r2=591650&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java
Sat Nov  3 09:47:55 2007
@@ -66,7 +66,7 @@
    * @param step integration step
    */
   public ThreeEighthesIntegrator(double step) {
-    super(false, c, a, b, new ThreeEighthesStepInterpolator(), step);
+    super(c, a, b, new ThreeEighthesStepInterpolator(), step);
   }
 
   /** Get the name of the method.



Mime
View raw message