Move Serializable from interface to implementations

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@777894 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-05-23 11:44:01 +00:00
parent b41ff57526
commit 5220875108
14 changed files with 36 additions and 28 deletions

View File

@ -17,8 +17,6 @@
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -26,7 +24,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* @version $Revision$ $Date$ * @version $Revision$ $Date$
* @since 2.0 * @since 2.0
*/ */
public interface MultivariateRealFunction extends Serializable { public interface MultivariateRealFunction {
/** /**
* Compute the value for the function at the given point. * Compute the value for the function at the given point.

View File

@ -17,8 +17,6 @@
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -26,7 +24,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* @version $Revision$ $Date$ * @version $Revision$ $Date$
* @since 2.0 * @since 2.0
*/ */
public interface MultivariateVectorialFunction extends Serializable { public interface MultivariateVectorialFunction {
/** /**
* Compute the value for the function at the given point. * Compute the value for the function at the given point.

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -26,7 +24,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* @version $Revision$ $Date$ * @version $Revision$ $Date$
* @since 2.0 * @since 2.0
*/ */
public interface UnivariateMatrixFunction extends Serializable { public interface UnivariateMatrixFunction {
/** /**
* Compute the value for the function. * Compute the value for the function.
* @param x the point for which the function value should be computed * @param x the point for which the function value should be computed

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -25,7 +23,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* *
* @version $Revision$ $Date$ * @version $Revision$ $Date$
*/ */
public interface UnivariateRealFunction extends Serializable { public interface UnivariateRealFunction {
/** /**
* Compute the value for the function. * Compute the value for the function.
* @param x the point for which the function value should be computed * @param x the point for which the function value should be computed

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -26,7 +24,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* @version $Revision$ $Date$ * @version $Revision$ $Date$
* @since 2.0 * @since 2.0
*/ */
public interface UnivariateVectorialFunction extends Serializable { public interface UnivariateVectorialFunction {
/** /**
* Compute the value for the function. * Compute the value for the function.
* @param x the point for which the function value should be computed * @param x the point for which the function value should be computed

View File

@ -17,6 +17,8 @@
package org.apache.commons.math.optimization; package org.apache.commons.math.optimization;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
import org.apache.commons.math.MathRuntimeException; import org.apache.commons.math.MathRuntimeException;
import org.apache.commons.math.analysis.MultivariateRealFunction; import org.apache.commons.math.analysis.MultivariateRealFunction;
@ -54,7 +56,9 @@ import org.apache.commons.math.linear.RealMatrix;
* @since 2.0 * @since 2.0
*/ */
public class LeastSquaresConverter implements MultivariateRealFunction { public class LeastSquaresConverter implements MultivariateRealFunction, Serializable {
// TODO: Add Serializable documentation
// TODO: Check Serializable implementation
/** Serializable version identifier. */ /** Serializable version identifier. */
private static final long serialVersionUID = -4369653306135732243L; private static final long serialVersionUID = -4369653306135732243L;

View File

@ -17,6 +17,8 @@
package org.apache.commons.math.optimization.general; package org.apache.commons.math.optimization.general;
import java.io.Serializable;
import org.apache.commons.math.ConvergenceException; import org.apache.commons.math.ConvergenceException;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
import org.apache.commons.math.analysis.UnivariateRealFunction; import org.apache.commons.math.analysis.UnivariateRealFunction;
@ -261,7 +263,9 @@ public class NonLinearConjugateGradientOptimizer
* extremum along the search direction. * extremum along the search direction.
* </p> * </p>
*/ */
private class LineSearchFunction implements UnivariateRealFunction { private class LineSearchFunction implements UnivariateRealFunction, Serializable {
// TODO: Add Serializable documentation
// TODO: Check Serializable implementation
/** Serializable version identifier. */ /** Serializable version identifier. */
private static final long serialVersionUID = 8184683950487801424L; private static final long serialVersionUID = 8184683950487801424L;

View File

@ -16,6 +16,8 @@
*/ */
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -23,7 +25,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* *
* @version $Revision$ $Date$ * @version $Revision$ $Date$
*/ */
public class Expm1Function implements DifferentiableUnivariateRealFunction { public class Expm1Function implements DifferentiableUnivariateRealFunction, Serializable {
private static final long serialVersionUID = 1410052725961159179L; private static final long serialVersionUID = 1410052725961159179L;

View File

@ -16,6 +16,8 @@
*/ */
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -23,7 +25,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* *
* @version $Revision$ $Date$ * @version $Revision$ $Date$
*/ */
public class MonitoredFunction implements UnivariateRealFunction { public class MonitoredFunction implements UnivariateRealFunction, Serializable {
private static final long serialVersionUID = -8403645545888892674L; private static final long serialVersionUID = -8403645545888892674L;

View File

@ -16,6 +16,8 @@
*/ */
package org.apache.commons.math.analysis; package org.apache.commons.math.analysis;
import java.io.Serializable;
import org.apache.commons.math.FunctionEvaluationException; import org.apache.commons.math.FunctionEvaluationException;
/** /**
@ -28,7 +30,7 @@ import org.apache.commons.math.FunctionEvaluationException;
* *
* @version $Revision$ $Date$ * @version $Revision$ $Date$
*/ */
public class SinFunction implements DifferentiableUnivariateRealFunction { public class SinFunction implements DifferentiableUnivariateRealFunction, Serializable {
private static final long serialVersionUID = 6422911699694536977L; private static final long serialVersionUID = 6422911699694536977L;

View File

@ -18,6 +18,7 @@
package org.apache.commons.math.optimization.general; package org.apache.commons.math.optimization.general;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -478,7 +479,7 @@ extends TestCase {
} }
private static class LinearProblem implements DifferentiableMultivariateVectorialFunction { private static class LinearProblem implements DifferentiableMultivariateVectorialFunction, Serializable {
private static final long serialVersionUID = -8804268799379350190L; private static final long serialVersionUID = -8804268799379350190L;
final RealMatrix factors; final RealMatrix factors;
@ -503,7 +504,7 @@ extends TestCase {
} }
private static class Circle implements DifferentiableMultivariateVectorialFunction { private static class Circle implements DifferentiableMultivariateVectorialFunction, Serializable {
private static final long serialVersionUID = -7165774454925027042L; private static final long serialVersionUID = -7165774454925027042L;
private ArrayList<Point2D.Double> points; private ArrayList<Point2D.Double> points;

View File

@ -18,6 +18,7 @@
package org.apache.commons.math.optimization.general; package org.apache.commons.math.optimization.general;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -518,7 +519,7 @@ public class LevenbergMarquardtOptimizerTest
} }
private static class LinearProblem implements DifferentiableMultivariateVectorialFunction { private static class LinearProblem implements DifferentiableMultivariateVectorialFunction, Serializable {
private static final long serialVersionUID = 703247177355019415L; private static final long serialVersionUID = 703247177355019415L;
final RealMatrix factors; final RealMatrix factors;
@ -543,7 +544,7 @@ public class LevenbergMarquardtOptimizerTest
} }
private static class Circle implements DifferentiableMultivariateVectorialFunction { private static class Circle implements DifferentiableMultivariateVectorialFunction, Serializable {
private static final long serialVersionUID = -4711170319243817874L; private static final long serialVersionUID = -4711170319243817874L;
@ -624,7 +625,7 @@ public class LevenbergMarquardtOptimizerTest
} }
private static class QuadraticProblem implements DifferentiableMultivariateVectorialFunction { private static class QuadraticProblem implements DifferentiableMultivariateVectorialFunction, Serializable {
private static final long serialVersionUID = 7072187082052755854L; private static final long serialVersionUID = 7072187082052755854L;
private List<Double> x; private List<Double> x;

View File

@ -17,6 +17,7 @@
package org.apache.commons.math.optimization.general; package org.apache.commons.math.optimization.general;
import java.io.Serializable;
import java.util.Arrays; import java.util.Arrays;
import junit.framework.Test; import junit.framework.Test;
@ -510,7 +511,7 @@ public class MinpackTest extends TestCase {
} }
private static abstract class MinpackFunction private static abstract class MinpackFunction
implements DifferentiableMultivariateVectorialFunction { implements DifferentiableMultivariateVectorialFunction, Serializable {
private static final long serialVersionUID = -6209760235478794233L; private static final long serialVersionUID = -6209760235478794233L;
protected int n; protected int n;

View File

@ -18,6 +18,7 @@
package org.apache.commons.math.optimization.general; package org.apache.commons.math.optimization.general;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import junit.framework.Test; import junit.framework.Test;
@ -363,7 +364,7 @@ extends TestCase {
assertEquals(48.135167894, center.y, 1.0e-8); assertEquals(48.135167894, center.y, 1.0e-8);
} }
private static class LinearProblem implements DifferentiableMultivariateRealFunction { private static class LinearProblem implements DifferentiableMultivariateRealFunction, Serializable {
private static final long serialVersionUID = 703247177355019415L; private static final long serialVersionUID = 703247177355019415L;
final RealMatrix factors; final RealMatrix factors;
@ -415,7 +416,7 @@ extends TestCase {
} }
private static class Circle implements DifferentiableMultivariateRealFunction { private static class Circle implements DifferentiableMultivariateRealFunction, Serializable {
private static final long serialVersionUID = -4711170319243817874L; private static final long serialVersionUID = -4711170319243817874L;