commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r668106 - in /commons/proper/math/branches/MATH_2_0/src: java/org/apache/commons/math/ode/ site/xdoc/ test/org/apache/commons/math/ode/
Date Mon, 16 Jun 2008 10:46:45 GMT
Author: luc
Date: Mon Jun 16 03:46:44 2008
New Revision: 668106

URL: http://svn.apache.org/viewvc?rev=668106&view=rev
Log:
The FirstOrderDifferentialEquations and FirstOrderIntegrator interfaces now extends Serializable.
This allows users to embed implementations of these interfaces in their objects when their
objects needs to be serializable.

Modified:
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince54Integrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince853Integrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/EulerIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderConverter.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GillIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GraggBulirschStoerIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/HighamHall54Integrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/ContinuousOutputModelTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/EulerStepInterpolatorTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem1.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem2.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem3.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem4.java
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem5.java

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ClassicalRungeKuttaIntegrator.java
Mon Jun 16 03:46:44 2008
@@ -45,6 +45,9 @@
 public class ClassicalRungeKuttaIntegrator
   extends RungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -8987762131146169612L;
+
   /** Integrator method name. */
   private static final String methodName = "classical Runge-Kutta";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince54Integrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince54Integrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince54Integrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince54Integrator.java
Mon Jun 16 03:46:44 2008
@@ -46,6 +46,9 @@
 public class DormandPrince54Integrator
   extends EmbeddedRungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -5346655668732043826L;
+
   /** Integrator method name. */
   private static final String methodName = "Dormand-Prince 5(4)";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince853Integrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince853Integrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince853Integrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/DormandPrince853Integrator.java
Mon Jun 16 03:46:44 2008
@@ -54,6 +54,9 @@
 public class DormandPrince853Integrator
   extends EmbeddedRungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = 6175337145090754336L;
+
   /** Integrator method name. */
   private static final String methodName = "Dormand-Prince 8 (5, 3)";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/EulerIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/EulerIntegrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/EulerIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/EulerIntegrator.java
Mon Jun 16 03:46:44 2008
@@ -48,6 +48,9 @@
 public class EulerIntegrator
   extends RungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -3378479003330094013L;
+
   /** Integrator method name. */
   private static final String methodName = "Euler";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderConverter.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderConverter.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderConverter.java
Mon Jun 16 03:46:44 2008
@@ -56,6 +56,9 @@
 public class FirstOrderConverter
   implements FirstOrderDifferentialEquations {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -8233657110042144146L;
+
   /** Simple constructor.
    * Build a converter around a second order equations set.
    * @param equations second order equations set to convert

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderDifferentialEquations.java
Mon Jun 16 03:46:44 2008
@@ -17,6 +17,8 @@
 
 package org.apache.commons.math.ode;
 
+import java.io.Serializable;
+
 /** This interface represents a first order differential equations set.
  *
  * <p>This interface should be implemented by all real first order
@@ -44,7 +46,7 @@
  * @since 1.2
  */
 
-public interface FirstOrderDifferentialEquations {
+public interface FirstOrderDifferentialEquations extends Serializable {
     
     /** Get the dimension of the problem.
      * @return dimension of the problem

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
Mon Jun 16 03:46:44 2008
@@ -17,6 +17,7 @@
 
 package org.apache.commons.math.ode;
 
+import java.io.Serializable;
 import java.util.Collection;
 
 /** This interface represents a first order integrator for
@@ -34,7 +35,7 @@
  * @since 1.2
  */
 
-public interface FirstOrderIntegrator {
+public interface FirstOrderIntegrator extends Serializable {
 
   /** Get the name of the method.
    * @return name of the method

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GillIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GillIntegrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GillIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GillIntegrator.java
Mon Jun 16 03:46:44 2008
@@ -44,6 +44,9 @@
 public class GillIntegrator
   extends RungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -3270987073897562791L;
+
   /** Integrator method name. */
   private static final String methodName = "Gill";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GraggBulirschStoerIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GraggBulirschStoerIntegrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GraggBulirschStoerIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/GraggBulirschStoerIntegrator.java
Mon Jun 16 03:46:44 2008
@@ -87,6 +87,9 @@
 public class GraggBulirschStoerIntegrator
   extends AdaptiveStepsizeIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -1263159462413447366L;
+
   /** Integrator method name. */
   private static final String methodName = "Gragg-Bulirsch-Stoer";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/HighamHall54Integrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/HighamHall54Integrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/HighamHall54Integrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/HighamHall54Integrator.java
Mon Jun 16 03:46:44 2008
@@ -34,6 +34,9 @@
 public class HighamHall54Integrator
   extends EmbeddedRungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -1499486749907617454L;
+
   /** Integrator method name. */
   private static final String methodName = "Higham-Hall 5(4)";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/MidpointIntegrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/MidpointIntegrator.java
Mon Jun 16 03:46:44 2008
@@ -42,6 +42,9 @@
 public class MidpointIntegrator
   extends RungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = 1871083451154005310L;
+
   /** Integrator method name. */
   private static final String methodName = "midpoint";
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/ThreeEighthesIntegrator.java
Mon Jun 16 03:46:44 2008
@@ -44,6 +44,9 @@
 public class ThreeEighthesIntegrator
   extends RungeKuttaIntegrator {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -5738562635641912717L;
+
   /** Integrator method name. */
   private static final String methodName = "3/8";
 

Modified: commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml Mon Jun 16 03:46:44 2008
@@ -39,6 +39,11 @@
   </properties>
   <body>
     <release version="2.0" date="TBD" description="TBD">
+      <action dev="luc" type="update">
+        The FirstOrderDifferentialEquations and FirstOrderIntegrator
+        interfaces now extends Serializable, allowing integrators and
+        problems to be embedded into users Serializable classes.
+      </action>
       <action dev="luc" type="add">
         Added several convenience methods for Vector3D and Rotation.
       </action>

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/ContinuousOutputModelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/ContinuousOutputModelTest.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/ContinuousOutputModelTest.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/ContinuousOutputModelTest.java
Mon Jun 16 03:46:44 2008
@@ -82,15 +82,16 @@
       // theoretical solution: y[0] = cos(t), y[1] = sin(t)
       FirstOrderDifferentialEquations problem =
           new FirstOrderDifferentialEquations() {
-          public void computeDerivatives(double t, double[] y, double[] dot)
-          throws DerivativeException {
-              dot[0] = -y[1];
-              dot[1] =  y[0];
-          }
-          public int getDimension() {
-              return 2;
-          }
-      };
+              private static final long serialVersionUID = 2472449657345878299L;
+              public void computeDerivatives(double t, double[] y, double[] dot)
+                  throws DerivativeException {
+                  dot[0] = -y[1];
+                  dot[1] =  y[0];
+              }
+              public int getDimension() {
+                  return 2;
+              }
+          };
 
       // integrate backward from &pi; to 0;
       ContinuousOutputModel cm1 = new ContinuousOutputModel();

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/EulerStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/EulerStepInterpolatorTest.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/EulerStepInterpolatorTest.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/EulerStepInterpolatorTest.java
Mon Jun 16 03:46:44 2008
@@ -162,6 +162,7 @@
 
   private static class DummyEquations
     implements FirstOrderDifferentialEquations {
+    private static final long serialVersionUID = 291437140744677100L;
     public int getDimension() {
       return 0;
     }

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/HighamHall54IntegratorTest.java
Mon Jun 16 03:46:44 2008
@@ -36,7 +36,8 @@
           new HighamHall54Integrator(0.0, 1.0, 1.0e-10, 1.0e-10);
       FirstOrderDifferentialEquations equations =
           new FirstOrderDifferentialEquations() {
-          public void computeDerivatives(double t, double[] y, double[] dot)
+            private static final long serialVersionUID = -1157081786301178032L;
+            public void computeDerivatives(double t, double[] y, double[] dot)
             throws DerivativeException {
             if (t < -0.5) {
                 throw new DerivativeException("{0}", new String[] { "oops" });

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem1.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem1.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem1.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem1.java
Mon Jun 16 03:46:44 2008
@@ -34,6 +34,9 @@
 class TestProblem1
   extends TestProblemAbstract {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = 1977870815289373164L;
+
   /** theoretical state */
   private double[] y;
 

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem2.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem2.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem2.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem2.java
Mon Jun 16 03:46:44 2008
@@ -35,6 +35,9 @@
 class TestProblem2
   extends TestProblemAbstract {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = 8330741783213512366L;
+
   /** theoretical state */
   private double[] y;
 

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem3.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem3.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem3.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem3.java
Mon Jun 16 03:46:44 2008
@@ -37,6 +37,9 @@
 class TestProblem3
   extends TestProblemAbstract {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = 8567328542728919999L;
+
   /** Eccentricity */
   double e;
 

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem4.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem4.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem4.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem4.java
Mon Jun 16 03:46:44 2008
@@ -37,6 +37,9 @@
 class TestProblem4
   extends TestProblemAbstract {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = -5910438521889015745L;
+
   /** Time offset. */
   private double a;
 

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem5.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem5.java?rev=668106&r1=668105&r2=668106&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem5.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/ode/TestProblem5.java
Mon Jun 16 03:46:44 2008
@@ -25,6 +25,9 @@
 class TestProblem5
   extends TestProblem1 {
 
+  /** Serializable version identifier. */
+  private static final long serialVersionUID = 7579233102411804237L;
+
   /**
    * Simple constructor.
    */



Mime
View raw message