MATH-1594: Remove "Serializable".
This commit is contained in:
parent
eac2e8b627
commit
aa0bee3055
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -39,10 +38,7 @@ import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
|
|||
*
|
||||
* @param <T> a comparable type used in the frequency distribution
|
||||
*/
|
||||
public class Frequency<T extends Comparable<T>> implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 605878194679954450L;
|
||||
public class Frequency<T extends Comparable<T>> {
|
||||
/** underlying collection. */
|
||||
private final SortedMap<T, Long> freqTable;
|
||||
|
||||
|
@ -334,11 +330,7 @@ public class Frequency<T extends Comparable<T>> implements Serializable {
|
|||
*
|
||||
* @param <U> the type of the objects compared
|
||||
*/
|
||||
private static class NaturalComparator<U extends Comparable<U>> implements Comparator<U>, Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = -3852193713161395148L;
|
||||
|
||||
private static class NaturalComparator<U extends Comparable<U>> implements Comparator<U> {
|
||||
/**
|
||||
* Compare the two {@link Comparable Comparable} arguments.
|
||||
* This method is equivalent to:
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package org.apache.commons.math4.legacy.stat.descriptive;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
|
@ -50,13 +49,7 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
|||
* @since 2.0
|
||||
*
|
||||
*/
|
||||
public class AggregateSummaryStatistics implements StatisticalSummary,
|
||||
Serializable {
|
||||
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = -8207112444016386906L;
|
||||
|
||||
public class AggregateSummaryStatistics implements StatisticalSummary {
|
||||
/**
|
||||
* A SummaryStatistics serving as a prototype for creating SummaryStatistics.
|
||||
* contributing to this aggregate
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
@ -56,7 +55,7 @@ import org.apache.commons.math4.core.jdkmath.JdkMath;
|
|||
* {@link SynchronizedDescriptiveStatistics} if concurrent access from multiple
|
||||
* threads is required.
|
||||
*/
|
||||
public class DescriptiveStatistics implements StatisticalSummary, Serializable {
|
||||
public class DescriptiveStatistics implements StatisticalSummary {
|
||||
|
||||
/**
|
||||
* Represents an infinite window size. When the {@link #getWindowSize()}
|
||||
|
@ -65,9 +64,6 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
|
|||
*/
|
||||
public static final int INFINITE_WINDOW = -1;
|
||||
|
||||
/** Serialization UID. */
|
||||
private static final long serialVersionUID = 4133067267405273064L;
|
||||
|
||||
/** Name of the setQuantile method. */
|
||||
private static final String SET_QUANTILE_METHOD_NAME = "setQuantile";
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
|
||||
|
@ -68,11 +67,7 @@ import org.apache.commons.numbers.core.Precision;
|
|||
* @since 1.2
|
||||
*/
|
||||
public class MultivariateSummaryStatistics
|
||||
implements StatisticalMultivariateSummary, Serializable {
|
||||
|
||||
/** Serialization UID. */
|
||||
private static final long serialVersionUID = 2271900808994826718L;
|
||||
|
||||
implements StatisticalMultivariateSummary {
|
||||
/** Dimension of the data. */
|
||||
private final int k;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
|
@ -75,10 +74,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* <p>
|
||||
* <b>Note:</b> this class is <b>NOT</b> thread-safe.
|
||||
*/
|
||||
class ResizableDoubleArray implements DoubleArray, Serializable { // Not in public API.
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = -3485529955529426875L;
|
||||
|
||||
class ResizableDoubleArray implements DoubleArray { // Not in public API.
|
||||
/** Default value for initial capacity. */
|
||||
private static final int DEFAULT_INITIAL_CAPACITY = 16;
|
||||
/** Default value for array size modifier. */
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.core.jdkmath.JdkMath;
|
||||
import org.apache.commons.numbers.core.Precision;
|
||||
|
||||
|
@ -25,12 +23,8 @@ import org.apache.commons.numbers.core.Precision;
|
|||
* Value object representing the results of a univariate statistical summary.
|
||||
*
|
||||
*/
|
||||
public class StatisticalSummaryValues implements Serializable,
|
||||
StatisticalSummary {
|
||||
|
||||
/** Serialization id. */
|
||||
private static final long serialVersionUID = -5108854841843722536L;
|
||||
|
||||
public class StatisticalSummaryValues
|
||||
implements StatisticalSummary {
|
||||
/** The sample mean. */
|
||||
private final double mean;
|
||||
|
||||
|
@ -188,5 +182,4 @@ public class StatisticalSummaryValues implements Serializable,
|
|||
outBuffer.append("sum: ").append(getSum()).append(endl);
|
||||
return outBuffer.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalStateException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
|
||||
|
@ -56,11 +54,7 @@ import org.apache.commons.numbers.core.Precision;
|
|||
* threads is required.
|
||||
* </p>
|
||||
*/
|
||||
public class SummaryStatistics implements StatisticalSummary, Serializable {
|
||||
|
||||
/** Serialization UID. */
|
||||
private static final long serialVersionUID = -2021321786743555871L;
|
||||
|
||||
public class SummaryStatistics implements StatisticalSummary {
|
||||
/** count of values that have been added. */
|
||||
private long n;
|
||||
|
||||
|
|
|
@ -32,10 +32,6 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
|||
* @since 1.2
|
||||
*/
|
||||
public class SynchronizedDescriptiveStatistics extends DescriptiveStatistics {
|
||||
|
||||
/** Serialization UID. */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Construct an instance with infinite window.
|
||||
*/
|
||||
|
|
|
@ -33,10 +33,6 @@ import org.apache.commons.math4.legacy.linear.RealMatrix;
|
|||
*/
|
||||
public class SynchronizedMultivariateSummaryStatistics
|
||||
extends MultivariateSummaryStatistics {
|
||||
|
||||
/** Serialization UID. */
|
||||
private static final long serialVersionUID = 7099834153347155363L;
|
||||
|
||||
/**
|
||||
* Construct a SynchronizedMultivariateSummaryStatistics instance.
|
||||
* @param k dimension of the data
|
||||
|
|
|
@ -32,10 +32,6 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
|||
* @since 1.2
|
||||
*/
|
||||
public class SynchronizedSummaryStatistics extends SummaryStatistics {
|
||||
|
||||
/** Serialization UID. */
|
||||
private static final long serialVersionUID = 1909861009042253704L;
|
||||
|
||||
/**
|
||||
* Construct a SynchronizedSummaryStatistics instance.
|
||||
*/
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
||||
|
@ -45,12 +43,7 @@ import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivari
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
class FirstMoment extends AbstractStorelessUnivariateStatistic
|
||||
implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
class FirstMoment extends AbstractStorelessUnivariateStatistic {
|
||||
/** Count of values that have been added. */
|
||||
protected long n;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
|
||||
/**
|
||||
|
@ -52,11 +50,7 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally. </p>
|
||||
*/
|
||||
class FourthMoment extends ThirdMoment implements Serializable{
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
class FourthMoment extends ThirdMoment {
|
||||
/** fourth moment of values that have been added. */
|
||||
private double m4;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalStateException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
|
@ -48,11 +46,7 @@ import org.apache.commons.math4.core.jdkmath.JdkMath;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class GeometricMean extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class GeometricMean extends AbstractStorelessUnivariateStatistic {
|
||||
/** Wrapped SumOfLogs instance. */
|
||||
private StorelessUnivariateStatistic sumOfLogs;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -45,11 +43,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Kurtosis extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Kurtosis extends AbstractStorelessUnivariateStatistic {
|
||||
/**Fourth Moment on which this statistic is based. */
|
||||
protected FourthMoment moment;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -60,11 +58,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* <code>clear()</code> method, it must be synchronized externally.
|
||||
*/
|
||||
public class Mean extends AbstractStorelessUnivariateStatistic
|
||||
implements Serializable, WeightedEvaluation {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
implements WeightedEvaluation {
|
||||
/** First moment on which this statistic is based. */
|
||||
protected FirstMoment moment;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
|
||||
/**
|
||||
|
@ -44,11 +42,7 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class SecondMoment extends FirstMoment implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class SecondMoment extends FirstMoment {
|
||||
/** second moment of values that have been added. */
|
||||
protected double m2;
|
||||
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractUnivariateStatistic;
|
||||
|
@ -51,7 +49,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public class SemiVariance extends AbstractUnivariateStatistic implements Serializable {
|
||||
public class SemiVariance extends AbstractUnivariateStatistic {
|
||||
|
||||
/**
|
||||
* The UPSIDE Direction is used to specify that the observations above the
|
||||
|
@ -65,9 +63,6 @@ public class SemiVariance extends AbstractUnivariateStatistic implements Seriali
|
|||
*/
|
||||
public static final Direction DOWNSIDE_VARIANCE = Direction.DOWNSIDE;
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
/**
|
||||
* Determines whether or not bias correction is applied when computing the
|
||||
* value of the statistic. True means that bias is corrected.
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -44,11 +42,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally. </p>
|
||||
*/
|
||||
public class Skewness extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Skewness extends AbstractStorelessUnivariateStatistic {
|
||||
/** The value below which the variance is considered zero and thus skewness is zero. */
|
||||
private static final double ZERO_VARIANCE_THRESHOLD = 10E-20;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -38,12 +36,7 @@ import org.apache.commons.math4.core.jdkmath.JdkMath;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class StandardDeviation extends AbstractStorelessUnivariateStatistic
|
||||
implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class StandardDeviation extends AbstractStorelessUnivariateStatistic {
|
||||
/** Wrapped Variance instance. */
|
||||
private Variance variance;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
|
||||
|
||||
|
@ -47,11 +45,7 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
|||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*
|
||||
*/
|
||||
class ThirdMoment extends SecondMoment implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
class ThirdMoment extends SecondMoment {
|
||||
/** third moment of values that have been added. */
|
||||
protected double m3;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
|
||||
|
@ -65,11 +63,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Variance extends AbstractStorelessUnivariateStatistic implements Serializable, WeightedEvaluation {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Variance extends AbstractStorelessUnivariateStatistic implements WeightedEvaluation {
|
||||
/** SecondMoment is used in incremental calculation of Variance. */
|
||||
protected SecondMoment moment;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
|
||||
|
@ -27,11 +26,7 @@ import org.apache.commons.math4.legacy.linear.RealMatrix;
|
|||
* Returns the covariance matrix of the available vectors.
|
||||
* @since 1.2
|
||||
*/
|
||||
public class VectorialCovariance implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 4118372414238930270L;
|
||||
|
||||
public class VectorialCovariance {
|
||||
/** Sums for each component. */
|
||||
private final double[] sums;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.moment;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
|
||||
|
@ -25,11 +24,7 @@ import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
|
|||
* Returns the arithmetic mean of the available vectors.
|
||||
* @since 1.2
|
||||
*/
|
||||
public class VectorialMean implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 8223009086481006892L;
|
||||
|
||||
public class VectorialMean {
|
||||
/** Means for each component. */
|
||||
private final Mean[] means;
|
||||
|
||||
|
|
|
@ -16,18 +16,13 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.core.MathArrays;
|
||||
|
||||
/**
|
||||
* A mid point strategy based on the average of begin and end indices.
|
||||
* @since 3.4
|
||||
*/
|
||||
public class CentralPivotingStrategy implements PivotingStrategy, Serializable {
|
||||
/** Serializable UID. */
|
||||
private static final long serialVersionUID = 20140713L;
|
||||
|
||||
public class CentralPivotingStrategy implements PivotingStrategy {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* This in particular picks a average of begin and end indices
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
|
@ -28,10 +27,7 @@ import org.apache.commons.math4.core.jdkmath.JdkMath;
|
|||
* numbers.
|
||||
* @since 3.4
|
||||
*/
|
||||
public class KthSelector implements Serializable {
|
||||
/** Serializable UID. */
|
||||
private static final long serialVersionUID = 20140713L;
|
||||
|
||||
public class KthSelector {
|
||||
/** Minimum selection size for insertion sort rather than selection. */
|
||||
private static final int MIN_SELECT_SIZE = 15;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -37,11 +35,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Max extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Max extends AbstractStorelessUnivariateStatistic {
|
||||
/** Number of values that have been added. */
|
||||
private long n;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.ranking.NaNStrategy;
|
||||
|
@ -32,11 +30,7 @@ import org.apache.commons.math4.legacy.stat.ranking.NaNStrategy;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Median extends Percentile implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Median extends Percentile {
|
||||
/** Fixed quantile. */
|
||||
private static final double FIXED_QUANTILE_50 = 50.0;
|
||||
|
||||
|
|
|
@ -16,18 +16,13 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.core.MathArrays;
|
||||
|
||||
/**
|
||||
* Classic median of 3 strategy given begin and end indices.
|
||||
* @since 3.4
|
||||
*/
|
||||
public class MedianOf3PivotingStrategy implements PivotingStrategy, Serializable {
|
||||
/** Serializable UID. */
|
||||
private static final long serialVersionUID = 20140713L;
|
||||
|
||||
public class MedianOf3PivotingStrategy implements PivotingStrategy {
|
||||
/**{@inheritDoc}
|
||||
* This in specific makes use of median of 3 pivoting.
|
||||
* @return The index corresponding to a pivot chosen between the
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -37,11 +35,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Min extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Min extends AbstractStorelessUnivariateStatistic {
|
||||
/**Number of values that have been added. */
|
||||
private long n;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.BitSet;
|
||||
|
||||
|
@ -90,10 +89,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Percentile extends AbstractUnivariateStatistic implements Serializable {
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Percentile extends AbstractUnivariateStatistic {
|
||||
/** Maximum number of partitioning pivots cached (each level double the number of pivots). */
|
||||
private static final int MAX_CACHED_LEVELS = 10;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.rank;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
|
@ -30,9 +29,7 @@ import org.apache.commons.rng.core.RandomProviderDefaultState;
|
|||
*
|
||||
* @since 3.4
|
||||
*/
|
||||
public class RandomPivotingStrategy implements PivotingStrategy, Serializable {
|
||||
/** Serializable UID. */
|
||||
private static final long serialVersionUID = 20160517L;
|
||||
public class RandomPivotingStrategy implements PivotingStrategy {
|
||||
/** Source of randomness. */
|
||||
private final RandomSource randomSource;
|
||||
/** Random generator to use for selecting pivot. */
|
||||
|
@ -66,35 +63,4 @@ public class RandomPivotingStrategy implements PivotingStrategy, Serializable {
|
|||
MathArrays.verifyValues(work, begin, end - begin);
|
||||
return begin + random.nextInt(end - begin - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param out Output stream.
|
||||
* @throws IOException if an error occurs.
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out)
|
||||
throws IOException {
|
||||
// Write non-transient fields.
|
||||
out.defaultWriteObject();
|
||||
|
||||
// Save current state.
|
||||
out.writeObject(((RandomProviderDefaultState) random.saveState()).getState());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param in Input stream.
|
||||
* @throws IOException if an error occurs.
|
||||
* @throws ClassNotFoundException if an error occurs.
|
||||
*/
|
||||
private void readObject(ObjectInputStream in)
|
||||
throws IOException,
|
||||
ClassNotFoundException {
|
||||
// Read non-transient fields.
|
||||
in.defaultReadObject();
|
||||
|
||||
// Recreate the "delegate" from serialized info.
|
||||
random = randomSource.create();
|
||||
// And restore its state.
|
||||
final RandomProviderDefaultState state = new RandomProviderDefaultState((byte[]) in.readObject());
|
||||
random.restoreState(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.summary;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -37,11 +35,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Product extends AbstractStorelessUnivariateStatistic implements Serializable, WeightedEvaluation {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Product extends AbstractStorelessUnivariateStatistic implements WeightedEvaluation {
|
||||
/**The number of values that have been added. */
|
||||
private long n;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.summary;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -36,11 +34,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class Sum extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class Sum extends AbstractStorelessUnivariateStatistic {
|
||||
/** */
|
||||
private long n;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.summary;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -44,11 +42,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class SumOfLogs extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class SumOfLogs extends AbstractStorelessUnivariateStatistic {
|
||||
/** Number of values that have been added. */
|
||||
private int n;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.descriptive.summary;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
import org.apache.commons.math4.legacy.exception.NullArgumentException;
|
||||
import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
|
||||
|
@ -35,11 +33,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
|
|||
* one of the threads invokes the <code>increment()</code> or
|
||||
* <code>clear()</code> method, it must be synchronized externally.</p>
|
||||
*/
|
||||
public class SumOfSquares extends AbstractStorelessUnivariateStatistic implements Serializable {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 20150412L;
|
||||
|
||||
public class SumOfSquares extends AbstractStorelessUnivariateStatistic {
|
||||
/** Number of values that have been added. */
|
||||
private long n;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.commons.math4.legacy.stat.regression;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math4.legacy.exception.OutOfRangeException;
|
||||
|
@ -27,7 +26,7 @@ import org.apache.commons.math4.core.jdkmath.JdkMath;
|
|||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public class RegressionResults implements Serializable {
|
||||
public class RegressionResults {
|
||||
|
||||
/** INDEX of Sum of Squared Errors. */
|
||||
private static final int SSE_IDX = 0;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
|
||||
package org.apache.commons.math4.legacy.stat.regression;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.statistics.distribution.TDistribution;
|
||||
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
|
||||
|
@ -60,11 +59,7 @@ import org.apache.commons.numbers.core.Precision;
|
|||
* </ul>
|
||||
*
|
||||
*/
|
||||
public class SimpleRegression implements Serializable, UpdatingMultipleLinearRegression {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = -3004689053607543335L;
|
||||
|
||||
public class SimpleRegression implements UpdatingMultipleLinearRegression {
|
||||
/** sum of x values. */
|
||||
private double sumX;
|
||||
|
||||
|
|
|
@ -194,14 +194,6 @@ public final class FrequencyTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerial() {
|
||||
Frequency<Integer> f = new Frequency<>();
|
||||
f.addValue(ONE);
|
||||
f.addValue(TWO);
|
||||
Assert.assertEquals(f, TestUtils.serializeAndRecover(f));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetUniqueCount() {
|
||||
Frequency<Long> f = new Frequency<>();
|
||||
|
|
|
@ -255,28 +255,6 @@ public class MultivariateSummaryStatisticsTest {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerialization() {
|
||||
MultivariateSummaryStatistics u = createMultivariateSummaryStatistics(2, true);
|
||||
// Empty test
|
||||
TestUtils.checkSerializedEquality(u);
|
||||
MultivariateSummaryStatistics s = (MultivariateSummaryStatistics) TestUtils.serializeAndRecover(u);
|
||||
Assert.assertEquals(u, s);
|
||||
|
||||
// Add some data
|
||||
u.addValue(new double[] { 2d, 1d });
|
||||
u.addValue(new double[] { 1d, 1d });
|
||||
u.addValue(new double[] { 3d, 1d });
|
||||
u.addValue(new double[] { 4d, 1d });
|
||||
u.addValue(new double[] { 5d, 1d });
|
||||
|
||||
// Test again
|
||||
TestUtils.checkSerializedEquality(u);
|
||||
s = (MultivariateSummaryStatistics) TestUtils.serializeAndRecover(u);
|
||||
Assert.assertEquals(u, s);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEqualsAndHashCode() {
|
||||
MultivariateSummaryStatistics u = createMultivariateSummaryStatistics(2, true);
|
||||
|
|
|
@ -29,14 +29,6 @@ import org.junit.Test;
|
|||
|
||||
public final class StatisticalSummaryValuesTest {
|
||||
|
||||
@Test
|
||||
public void testSerialization() {
|
||||
StatisticalSummaryValues u = new StatisticalSummaryValues(1, 2, 3, 4, 5, 6);
|
||||
TestUtils.checkSerializedEquality(u);
|
||||
StatisticalSummaryValues t = (StatisticalSummaryValues) TestUtils.serializeAndRecover(u);
|
||||
verifyEquality(u, t);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEqualsAndHashCode() {
|
||||
StatisticalSummaryValues u = new StatisticalSummaryValues(1, 2, 3, 4, 5, 6);
|
||||
|
|
|
@ -155,30 +155,6 @@ public class SummaryStatisticsTest {
|
|||
verifySummary(u, summary);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerialization() {
|
||||
SummaryStatistics u = createSummaryStatistics();
|
||||
// Empty test
|
||||
TestUtils.checkSerializedEquality(u);
|
||||
SummaryStatistics s = (SummaryStatistics) TestUtils.serializeAndRecover(u);
|
||||
StatisticalSummary summary = s.getSummary();
|
||||
verifySummary(u, summary);
|
||||
|
||||
// Add some data
|
||||
u.addValue(2d);
|
||||
u.addValue(1d);
|
||||
u.addValue(3d);
|
||||
u.addValue(4d);
|
||||
u.addValue(5d);
|
||||
|
||||
// Test again
|
||||
TestUtils.checkSerializedEquality(u);
|
||||
s = (SummaryStatistics) TestUtils.serializeAndRecover(u);
|
||||
summary = s.getSummary();
|
||||
verifySummary(u, summary);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEqualsAndHashCode() {
|
||||
SummaryStatistics u = createSummaryStatistics();
|
||||
|
|
|
@ -82,10 +82,4 @@ public class VectorialCovarianceTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerial(){
|
||||
VectorialCovariance stat = new VectorialCovariance(points[0].length, true);
|
||||
Assert.assertEquals(stat, TestUtils.serializeAndRecover(stat));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,13 +74,4 @@ public class VectorialMeanTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerial() {
|
||||
VectorialMean stat = new VectorialMean(points[0].length);
|
||||
for (int i = 0; i < points.length; ++i) {
|
||||
stat.increment(points[i]);
|
||||
}
|
||||
Assert.assertEquals(stat, TestUtils.serializeAndRecover(stat));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue