commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject svn commit: r780933 - in /commons/proper/math/trunk/src: java/org/apache/commons/math/optimization/linear/ java/org/apache/commons/math/random/ java/org/apache/commons/math/special/ test/org/apache/commons/math/optimization/linear/ test/org/apache/comm...
Date Tue, 02 Jun 2009 04:39:13 GMT
Author: billbarker
Date: Tue Jun  2 04:39:12 2009
New Revision: 780933

URL: http://svn.apache.org/viewvc?rev=780933&view=rev
Log:
More serialization changes.

Not clear what I should do with RandomAdaptor.  So I've let it remained broken (no public
no-opt construtor, but Serializable).

Feel free to -1 anything that I've stripped Serializable from and you care about, but I think
I've been pretty conservative.

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/AbstractLinearOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/LinearOptimizer.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/SimplexSolver.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/CorrelatedRandomVectorGenerator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/GaussianRandomGenerator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/NormalizedRandomGenerator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomData.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomGenerator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomVectorGenerator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/random/UncorrelatedRandomVectorGenerator.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/special/Beta.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/special/Erf.java
    commons/proper/math/trunk/src/java/org/apache/commons/math/special/Gamma.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexTableauTest.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomAdaptorTest.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/random/TestRandomGenerator.java
    commons/proper/math/trunk/src/test/org/apache/commons/math/random/UniformRandomGeneratorTest.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/AbstractLinearOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/AbstractLinearOptimizer.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/AbstractLinearOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/AbstractLinearOptimizer.java
Tue Jun  2 04:39:12 2009
@@ -34,9 +34,6 @@
  */
 public abstract class AbstractLinearOptimizer implements LinearOptimizer {
 
-    /** Serializable version identifier */
-    private static final long serialVersionUID = 8581325080951819398L;
-
     /** 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/linear/LinearOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/LinearOptimizer.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/LinearOptimizer.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/LinearOptimizer.java
Tue Jun  2 04:39:12 2009
@@ -51,7 +51,7 @@
  * @version $Revision$ $Date$
  * @since 2.0
  */
-public interface LinearOptimizer extends Serializable {
+public interface LinearOptimizer {
 
     /** 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/linear/SimplexSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/SimplexSolver.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/SimplexSolver.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/linear/SimplexSolver.java
Tue Jun  2 04:39:12 2009
@@ -29,9 +29,6 @@
  */
 public class SimplexSolver extends AbstractLinearOptimizer {
 
-    /** Serializable version identifier. */
-    private static final long serialVersionUID = -4886937648715323786L;
-
     /** Default amount of error to accept in floating point comparisons. */ 
     private static final double DEFAULT_EPSILON = 1.0e-6;
 

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/AbstractRandomGenerator.java
Tue Jun  2 04:39:12 2009
@@ -34,9 +34,6 @@
  */
 public abstract class AbstractRandomGenerator implements RandomGenerator {
     
-    /** Serializable version identifier. */
-    private static final long serialVersionUID = 7026539017027693474L;
-
     /** 
      * Cached random normal value.  The default implementation for 
      * {@link #nextGaussian} generates pairs of values and this field caches the

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/CorrelatedRandomVectorGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/CorrelatedRandomVectorGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/CorrelatedRandomVectorGenerator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/CorrelatedRandomVectorGenerator.java
Tue Jun  2 04:39:12 2009
@@ -62,9 +62,6 @@
 public class CorrelatedRandomVectorGenerator
     implements RandomVectorGenerator {
 
-    /** Serializable version identifier. */
-    private static final long serialVersionUID = -7162933284241468177L;
-
     /** Simple constructor.
      * <p>Build a correlated random vector generator from its mean
      * vector and covariance matrix.</p>

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/GaussianRandomGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/GaussianRandomGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/GaussianRandomGenerator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/GaussianRandomGenerator.java
Tue Jun  2 04:39:12 2009
@@ -27,9 +27,6 @@
 
 public class GaussianRandomGenerator implements NormalizedRandomGenerator {
 
-    /** Serializable version identifier. */
-    private static final long serialVersionUID = -4698731518385853565L;
-
     /** Create a new generator.
      * @param generator underlying random generator to use
      */

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/NormalizedRandomGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/NormalizedRandomGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/NormalizedRandomGenerator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/NormalizedRandomGenerator.java
Tue Jun  2 04:39:12 2009
@@ -17,8 +17,6 @@
 
 package org.apache.commons.math.random;
 
-import java.io.Serializable;
-
 /** 
  * This interface represent a normalized random generator for
  * scalars.
@@ -26,7 +24,7 @@
  * @version $Revision$ $Date$
  * @since 1.2
  */
-public interface NormalizedRandomGenerator extends Serializable {
+public interface NormalizedRandomGenerator {
 
   /** Generate a random scalar with null mean and unit standard deviation.
    * <p>This method does <strong>not</strong> specify the shape of the

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomData.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomData.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomData.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomData.java Tue
Jun  2 04:39:12 2009
@@ -23,7 +23,7 @@
  * Random data generation utilities.
  * @version $Revision$ $Date$
  */
-public interface RandomData extends Serializable {
+public interface RandomData {
     /**
      * Generates a random string of hex characters of length
      * <code>len</code>.

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomGenerator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomGenerator.java
Tue Jun  2 04:39:12 2009
@@ -25,7 +25,7 @@
  * @since 1.1
  * @version $Revision$ $Date$
  */
-public interface RandomGenerator extends Serializable {
+public interface RandomGenerator {
     
     /**
      * Sets the seed of the underyling random number generator using a 

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomVectorGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomVectorGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomVectorGenerator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomVectorGenerator.java
Tue Jun  2 04:39:12 2009
@@ -26,7 +26,7 @@
  *
  */
 
-public interface RandomVectorGenerator extends Serializable {
+public interface RandomVectorGenerator {
 
   /** Generate a random vector.
    * @return a random vector as an array of double.

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/UncorrelatedRandomVectorGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/UncorrelatedRandomVectorGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/UncorrelatedRandomVectorGenerator.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/UncorrelatedRandomVectorGenerator.java
Tue Jun  2 04:39:12 2009
@@ -33,9 +33,6 @@
 public class UncorrelatedRandomVectorGenerator
   implements RandomVectorGenerator {
 
-  /** Serializable version identifier. */
-  private static final long serialVersionUID = -3268228248001718811L;
-
   /** Simple constructor.
    * <p>Build an uncorrelated random vector generator from
    * its mean and standard deviation vectors.</p>

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/special/Beta.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/special/Beta.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/special/Beta.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/special/Beta.java Tue Jun 
2 04:39:12 2009
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.math.special;
 
-import java.io.Serializable;
-
 import org.apache.commons.math.MathException;
 import org.apache.commons.math.util.ContinuedFraction;
 
@@ -27,10 +25,7 @@
  *
  * @version $Revision$ $Date$
  */
-public class Beta implements Serializable {
-
-    /** Serializable version identifier */
-    private static final long serialVersionUID = -3833485397404128220L;
+public class Beta {
 
     /** Maximum allowed numerical error. */
     private static final double DEFAULT_EPSILON = 10e-15;

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/special/Erf.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/special/Erf.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/special/Erf.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/special/Erf.java Tue Jun  2
04:39:12 2009
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.math.special;
 
-import java.io.Serializable;
-
 import org.apache.commons.math.MathException;
 
 /**
@@ -26,10 +24,7 @@
  *
  * @version $Revision$ $Date$
  */
-public class Erf implements Serializable {
-
-    /** Serializable version identifier */
-    private static final long serialVersionUID = 490960015010326571L;
+public class Erf {
 
     /**
      * Default constructor.  Prohibit instantiation.

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/special/Gamma.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/special/Gamma.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/special/Gamma.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/special/Gamma.java Tue Jun
 2 04:39:12 2009
@@ -28,11 +28,8 @@
  *
  * @version $Revision$ $Date$
  */
-public class Gamma implements Serializable {
+public class Gamma {
     
-    /** Serializable version identifier */
-    private static final long serialVersionUID = -6587513359895466954L;
-
     /** 
      * <a href="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant">Euler-Mascheroni
constant</a>
      * @since 2.0

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexTableauTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexTableauTest.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexTableauTest.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexTableauTest.java
Tue Jun  2 04:39:12 2009
@@ -20,6 +20,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 
+import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.optimization.GoalType;
 
 import junit.framework.TestCase;
@@ -73,6 +74,13 @@
         assertMatrixEquals(initialTableau, tableau.getData());
     }
 
+    public void testSerial() {
+        LinearObjectiveFunction f = createFunction();
+        Collection<LinearConstraint> constraints = createConstraints();
+        SimplexTableau tableau =
+            new SimplexTableau(f, constraints, GoalType.MAXIMIZE, false, 1.0e-6);
+        assertEquals(tableau, TestUtils.serializeAndRecover(tableau));
+    }
     private LinearObjectiveFunction createFunction() {
         return new LinearObjectiveFunction(new double[] {15, 10}, 0);
     }

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomAdaptorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomAdaptorTest.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomAdaptorTest.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomAdaptorTest.java
Tue Jun  2 04:39:12 2009
@@ -67,8 +67,6 @@
      */
     private static class ConstantGenerator implements RandomGenerator {
         
-        private static final long serialVersionUID = 5936262220824971138L;
-
         public boolean nextBoolean() {
             return false;
         }

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=780933&r1=780932&r2=780933&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
Tue Jun  2 04:39:12 2009
@@ -606,7 +606,8 @@
 
 		}
 	}
-
+	
+	
 	private int findPerm(int[][] p, int[] samp) {
 		for (int i = 0; i < p.length; i++) {
 			boolean good = true;

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/random/TestRandomGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/random/TestRandomGenerator.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/random/TestRandomGenerator.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/random/TestRandomGenerator.java
Tue Jun  2 04:39:12 2009
@@ -26,7 +26,6 @@
  */
 public class TestRandomGenerator extends AbstractRandomGenerator {
 
-    private static final long serialVersionUID = -9161426374178114548L;
     private Random random = new Random();
 
     @Override

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/random/UniformRandomGeneratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/random/UniformRandomGeneratorTest.java?rev=780933&r1=780932&r2=780933&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/random/UniformRandomGeneratorTest.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/random/UniformRandomGeneratorTest.java
Tue Jun  2 04:39:12 2009
@@ -39,7 +39,8 @@
         assertEquals(0.0, StatUtils.mean(sample), 0.07);
         assertEquals(1.0, StatUtils.variance(sample), 0.02);
     }
-
+    
+    
     public static Test suite() {
         return new TestSuite(UniformRandomGeneratorTest.class);
     }



Mime
View raw message