commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject svn commit: r782468 - in /commons/proper/math/trunk/src: java/org/apache/commons/math/optimization/ java/org/apache/commons/math/optimization/direct/ java/org/apache/commons/math/optimization/general/ test/org/apache/commons/math/optimization/general/ ...
Date Sun, 07 Jun 2009 21:24:35 GMT
Author: billbarker
Date: Sun Jun  7 21:24:18 2009
New Revision: 782468

URL: http://svn.apache.org/viewvc?rev=782468&view=rev
Log:
Serialization changes for optimization.

Still need to add junit test, but for this it doesn't look like a blocker.

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/direct/DirectSearchOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/Preconditioner.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -17,8 +17,6 @@
 
 package org.apache.commons.math.optimization;
 
-import java.io.Serializable;
-
 import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateRealFunction;
 
@@ -32,7 +30,7 @@
  * @version $Revision$ $Date$
  * @since 2.0
  */
-public interface DifferentiableMultivariateRealOptimizer extends Serializable {
+public interface DifferentiableMultivariateRealOptimizer {
 
     /** Set the maximal number of iterations of the algorithm.
      * @param maxIterations maximal number of function calls

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -17,8 +17,6 @@
 
 package org.apache.commons.math.optimization;
 
-import java.io.Serializable;
-
 import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
 
@@ -32,7 +30,7 @@
  * @version $Revision$ $Date$
  * @since 2.0
  */
-public interface DifferentiableMultivariateVectorialOptimizer extends Serializable {
+public interface DifferentiableMultivariateVectorialOptimizer {
 
     /** Set the maximal number of iterations of the algorithm.
      * @param maxIterations maximal number of function calls

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -17,6 +17,7 @@
 
 package org.apache.commons.math.optimization;
 
+import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Comparator;
 
@@ -38,7 +39,7 @@
  * @since 2.0
  */
 public class MultiStartDifferentiableMultivariateRealOptimizer
-    implements DifferentiableMultivariateRealOptimizer {
+    implements DifferentiableMultivariateRealOptimizer, Serializable {
 
     /** Serializable version identifier. */
     private static final long serialVersionUID = -3220364832729994537L;

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/direct/DirectSearchOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/direct/DirectSearchOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/direct/DirectSearchOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/direct/DirectSearchOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -86,12 +86,7 @@
  * @version $Revision$ $Date$
  * @since 1.2
  */
-public abstract class DirectSearchOptimizer implements MultivariateRealOptimizer, Serializable
{
-    // TODO: Add Serializable documentation
-    // TODO: Check Serializable implementation
-
-    /** Serializable version identifier. */
-    private static final long serialVersionUID = 4299910390345933369L;
+public abstract class DirectSearchOptimizer implements MultivariateRealOptimizer {
 
     /** Simplex. */
     protected RealPointValuePair[] simplex;

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -41,9 +41,6 @@
  */
 public abstract class AbstractLeastSquaresOptimizer implements DifferentiableMultivariateVectorialOptimizer
{
 
-    /** Serializable version identifier */
-    private static final long serialVersionUID = 5413193243329026789L;
-
     /** Default maximal number of iterations allowed. */
     public static final int DEFAULT_MAX_ITERATIONS = 100;
 

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -41,9 +41,6 @@
     /** Default maximal number of iterations allowed. */
     public static final int DEFAULT_MAX_ITERATIONS = 100;
 
-    /** Serializable version identifier. */
-    private static final long serialVersionUID = 1357126012308766636L;
-
     /** Maximal number of iterations allowed. */
     private int maxIterations;
 

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -17,6 +17,8 @@
 
 package org.apache.commons.math.optimization.general;
 
+import java.io.Serializable;
+
 import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.linear.DecompositionSolver;
 import org.apache.commons.math.linear.DenseRealMatrix;
@@ -42,7 +44,7 @@
  *
  */
 
-public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer {
+public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer implements Serializable
{
 
     /** Serializable version identifier */
     private static final long serialVersionUID = 7011643996279553223L;

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.math.optimization.general;
 
+import java.io.Serializable;
 import java.util.Arrays;
 
 import org.apache.commons.math.FunctionEvaluationException;
@@ -99,7 +100,7 @@
  * @since 2.0
  *
  */
-public class LevenbergMarquardtOptimizer extends AbstractLeastSquaresOptimizer {
+public class LevenbergMarquardtOptimizer extends AbstractLeastSquaresOptimizer implements
Serializable {
 
     /** Serializable version identifier */
     private static final long serialVersionUID = 8851282236194244323L;

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizer.java
Sun Jun  7 21:24:18 2009
@@ -45,7 +45,7 @@
 
 public class NonLinearConjugateGradientOptimizer
     extends AbstractScalarDifferentiableOptimizer
-    implements DifferentiableMultivariateRealOptimizer {
+    implements DifferentiableMultivariateRealOptimizer, Serializable {
 
     /** Serializable version identifier. */
     private static final long serialVersionUID = -6545223926568155458L;
@@ -242,7 +242,7 @@
     }
 
     /** Default identity preconditioner. */
-    private static class IdentityPreconditioner implements Preconditioner {
+    private static class IdentityPreconditioner implements Preconditioner, Serializable {
 
         /** Serializable version identifier. */
         private static final long serialVersionUID = 1868235977809734023L;

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/Preconditioner.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/Preconditioner.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/Preconditioner.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/general/Preconditioner.java
Sun Jun  7 21:24:18 2009
@@ -17,8 +17,6 @@
 
 package org.apache.commons.math.optimization.general;
 
-import java.io.Serializable;
-
 import org.apache.commons.math.FunctionEvaluationException;
 
 /** 
@@ -27,7 +25,7 @@
  * @version $Revision$ $Date$
  * @since 2.0
  */
-public interface Preconditioner extends Serializable {
+public interface Preconditioner {
 
     /** 
      * Precondition a search direction.

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
Sun Jun  7 21:24:18 2009
@@ -191,7 +191,6 @@
             new NonLinearConjugateGradientOptimizer(ConjugateGradientFormula.POLAK_RIBIERE);
         optimizer.setMaxIterations(100);
         optimizer.setPreconditioner(new Preconditioner() {
-            private static final long serialVersionUID = -2935127802358453014L;
             public double[] precondition(double[] point, double[] r) {
                 double[] d = r.clone();
                 d[0] /=  72.0;

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java?rev=782468&r1=782467&r2=782468&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java
Sun Jun  7 21:24:18 2009
@@ -21,6 +21,7 @@
 import java.util.HashSet;
 
 import org.apache.commons.math.RetryTestCase;
+import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.stat.Frequency;
 import org.apache.commons.math.stat.inference.ChiSquareTestImpl;
 import org.apache.commons.math.stat.descriptive.SummaryStatistics;
@@ -607,6 +608,10 @@
 		}
 	}
 	
+	// Disable until we have equals
+	//public void testSerial() {
+	//    assertEquals(randomData, TestUtils.serializeAndRecover(randomData));
+	//}
 	
 	private int findPerm(int[][] p, int[] samp) {
 		for (int i = 0; i < p.length; i++) {



Mime
View raw message