You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2015/04/11 14:58:24 UTC
[1/2] [math] Add missing @Override tags.
Repository: commons-math
Updated Branches:
refs/heads/master 8d210b4f8 -> 8e4e52215
Add missing @Override tags.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/5d549fc3
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/5d549fc3
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/5d549fc3
Branch: refs/heads/master
Commit: 5d549fc352d26290386cda47cb35aea1239a4919
Parents: 8d210b4
Author: Thomas Neidhart <th...@gmail.com>
Authored: Sat Apr 11 14:51:07 2015 +0200
Committer: Thomas Neidhart <th...@gmail.com>
Committed: Sat Apr 11 14:51:07 2015 +0200
----------------------------------------------------------------------
.../math4/fitting/AbstractCurveFitter.java | 1 +
.../math4/fitting/GaussianCurveFitter.java | 1 +
.../leastsquares/LeastSquaresFactory.java | 2 ++
.../apache/commons/math4/stat/Frequency.java | 3 +-
.../stat/correlation/KendallsCorrelation.java | 7 +++--
.../AbstractStorelessUnivariateStatistic.java | 2 ++
.../stat/descriptive/DescriptiveStatistics.java | 22 ++++++++++-----
.../MultivariateSummaryStatistics.java | 29 ++++++++++++++------
.../descriptive/StatisticalSummaryValues.java | 7 +++++
.../StorelessUnivariateStatistic.java | 1 +
.../stat/descriptive/SummaryStatistics.java | 7 +++++
.../stat/descriptive/UnivariateStatistic.java | 2 ++
.../math4/stat/descriptive/moment/Mean.java | 2 ++
.../math4/stat/descriptive/moment/Variance.java | 2 ++
.../descriptive/rank/PSquarePercentile.java | 3 ++
.../math4/stat/descriptive/summary/Product.java | 2 ++
.../math4/stat/ranking/NaturalRanking.java | 2 ++
.../regression/MillerUpdatingRegression.java | 15 +++++++---
.../math4/stat/regression/SimpleRegression.java | 9 +++++-
19 files changed, 94 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/fitting/AbstractCurveFitter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/fitting/AbstractCurveFitter.java b/src/main/java/org/apache/commons/math4/fitting/AbstractCurveFitter.java
index 84a5853..9cd184d 100644
--- a/src/main/java/org/apache/commons/math4/fitting/AbstractCurveFitter.java
+++ b/src/main/java/org/apache/commons/math4/fitting/AbstractCurveFitter.java
@@ -134,6 +134,7 @@ public abstract class AbstractCurveFitter {
*/
public MultivariateMatrixFunction getModelFunctionJacobian() {
return new MultivariateMatrixFunction() {
+ @Override
public double[][] value(double[] p) {
final int len = points.length;
final double[][] jacobian = new double[len][];
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java b/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
index 05fcf47..da6d46d 100644
--- a/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
+++ b/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java
@@ -249,6 +249,7 @@ public class GaussianCurveFitter extends AbstractCurveFitter {
final List<WeightedObservedPoint> observations = new ArrayList<WeightedObservedPoint>(unsorted);
final Comparator<WeightedObservedPoint> cmp = new Comparator<WeightedObservedPoint>() {
+ @Override
public int compare(WeightedObservedPoint p1,
WeightedObservedPoint p2) {
if (p1 == null && p2 == null) {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java b/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
index a854737..3196247 100644
--- a/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
+++ b/src/main/java/org/apache/commons/math4/fitting/leastsquares/LeastSquaresFactory.java
@@ -226,6 +226,7 @@ public class LeastSquaresFactory {
final Incrementor counter) {
return new LeastSquaresAdapter(problem) {
+ @Override
public Evaluation evaluate(final RealVector point) {
counter.incrementCount();
return super.evaluate(point);
@@ -244,6 +245,7 @@ public class LeastSquaresFactory {
*/
public static ConvergenceChecker<Evaluation> evaluationChecker(final ConvergenceChecker<PointVectorValuePair> checker) {
return new ConvergenceChecker<Evaluation>() {
+ @Override
public boolean converged(final int iteration,
final Evaluation previous,
final Evaluation current) {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/Frequency.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/Frequency.java b/src/main/java/org/apache/commons/math4/stat/Frequency.java
index 213f248..5a35883 100644
--- a/src/main/java/org/apache/commons/math4/stat/Frequency.java
+++ b/src/main/java/org/apache/commons/math4/stat/Frequency.java
@@ -20,8 +20,8 @@ import java.io.Serializable;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.Comparator;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -645,6 +645,7 @@ public class Frequency implements Serializable {
* @throws ClassCastException when <i>o1</i> is not a {@link Comparable Comparable},
* or when <code>((Comparable)o1).compareTo(o2)</code> does
*/
+ @Override
@SuppressWarnings("unchecked") // cast to (T) may throw ClassCastException, see Javadoc
public int compare(Comparable<T> o1, Comparable<T> o2) {
return o1.compareTo((T) o2);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java b/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
index f71390d..77b7d22 100644
--- a/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
+++ b/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java
@@ -16,6 +16,9 @@
*/
package org.apache.commons.math4.stat.correlation;
+import java.util.Arrays;
+import java.util.Comparator;
+
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.linear.BlockRealMatrix;
import org.apache.commons.math4.linear.MatrixUtils;
@@ -23,9 +26,6 @@ import org.apache.commons.math4.linear.RealMatrix;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.Pair;
-import java.util.Arrays;
-import java.util.Comparator;
-
/**
* Implementation of Kendall's Tau-b rank correlation</a>.
* <p>
@@ -168,6 +168,7 @@ public class KendallsCorrelation {
}
Arrays.sort(pairs, new Comparator<Pair<Double, Double>>() {
+ @Override
public int compare(Pair<Double, Double> pair1, Pair<Double, Double> pair2) {
int compareFirst = pair1.getFirst().compareTo(pair2.getFirst());
return compareFirst != 0 ? compareFirst : pair1.getSecond().compareTo(pair2.getSecond());
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/AbstractStorelessUnivariateStatistic.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/AbstractStorelessUnivariateStatistic.java b/src/main/java/org/apache/commons/math4/stat/descriptive/AbstractStorelessUnivariateStatistic.java
index 9920adf..197f93f 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/AbstractStorelessUnivariateStatistic.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/AbstractStorelessUnivariateStatistic.java
@@ -129,6 +129,7 @@ public abstract class AbstractStorelessUnivariateStatistic
* @throws MathIllegalArgumentException if values is null
* @see org.apache.commons.math4.stat.descriptive.StorelessUnivariateStatistic#incrementAll(double[])
*/
+ @Override
public void incrementAll(double[] values) throws MathIllegalArgumentException {
if (values == null) {
throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY);
@@ -148,6 +149,7 @@ public abstract class AbstractStorelessUnivariateStatistic
* @throws MathIllegalArgumentException if values is null
* @see org.apache.commons.math4.stat.descriptive.StorelessUnivariateStatistic#incrementAll(double[], int, int)
*/
+ @Override
public void incrementAll(double[] values, int begin, int length) throws MathIllegalArgumentException {
if (test(values, begin, length)) {
int k = begin + length;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java b/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
index 85f41d6..7729d87 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
@@ -41,21 +41,22 @@ import org.apache.commons.math4.util.ResizableDoubleArray;
/**
* Maintains a dataset of values of a single variable and computes descriptive
- * statistics based on stored data. The {@link #getWindowSize() windowSize}
+ * statistics based on stored data.
+ * <p>
+ * The {@link #getWindowSize() windowSize}
* property sets a limit on the number of values that can be stored in the
- * dataset. The default value, INFINITE_WINDOW, puts no limit on the size of
- * the dataset. This value should be used with caution, as the backing store
+ * dataset. The default value, INFINITE_WINDOW, puts no limit on the size of
+ * the dataset. This value should be used with caution, as the backing store
* will grow without bound in this case. For very large datasets,
* {@link SummaryStatistics}, which does not store the dataset, should be used
* instead of this class. If <code>windowSize</code> is not INFINITE_WINDOW and
* more values are added than can be stored in the dataset, new values are
* added in a "rolling" manner, with new values replacing the "oldest" values
* in the dataset.
- *
- * <p>Note: this class is not threadsafe. Use
+ * <p>
+ * Note: this class is not threadsafe. Use
* {@link SynchronizedDescriptiveStatistics} if concurrent access from multiple
- * threads is required.</p>
- *
+ * threads is required.
*/
public class DescriptiveStatistics implements StatisticalSummary, Serializable {
@@ -202,6 +203,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* arithmetic mean </a> of the available values
* @return The mean or Double.NaN if no values have been added.
*/
+ @Override
public double getMean() {
return apply(meanImpl);
}
@@ -226,6 +228,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* @return The variance, Double.NaN if no values have been added
* or 0.0 for a single value set.
*/
+ @Override
public double getVariance() {
return apply(varianceImpl);
}
@@ -246,6 +249,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* @return The standard deviation, Double.NaN if no values have been added
* or 0.0 for a single value set.
*/
+ @Override
public double getStandardDeviation() {
double stdDev = Double.NaN;
if (getN() > 0) {
@@ -294,6 +298,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* Returns the maximum of the available values
* @return The max or Double.NaN if no values have been added.
*/
+ @Override
public double getMax() {
return apply(maxImpl);
}
@@ -302,6 +307,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* Returns the minimum of the available values
* @return The min or Double.NaN if no values have been added.
*/
+ @Override
public double getMin() {
return apply(minImpl);
}
@@ -310,6 +316,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* Returns the number of available values
* @return The number of available values
*/
+ @Override
public long getN() {
return eDA.getNumElements();
}
@@ -318,6 +325,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* Returns the sum of the values that have been added to Univariate.
* @return The sum or Double.NaN if no values have been added
*/
+ @Override
public double getSum() {
return apply(sumImpl);
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java b/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java
index f1db607..eb1642c 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java
@@ -75,34 +75,34 @@ public class MultivariateSummaryStatistics
private static final long serialVersionUID = 2271900808994826718L;
/** Dimension of the data. */
- private int k;
+ private final int k;
/** Count of values that have been added */
private long n = 0;
/** Sum statistic implementation - can be reset by setter. */
- private StorelessUnivariateStatistic[] sumImpl;
+ private final StorelessUnivariateStatistic[] sumImpl;
/** Sum of squares statistic implementation - can be reset by setter. */
- private StorelessUnivariateStatistic[] sumSqImpl;
+ private final StorelessUnivariateStatistic[] sumSqImpl;
/** Minimum statistic implementation - can be reset by setter. */
- private StorelessUnivariateStatistic[] minImpl;
+ private final StorelessUnivariateStatistic[] minImpl;
/** Maximum statistic implementation - can be reset by setter. */
- private StorelessUnivariateStatistic[] maxImpl;
+ private final StorelessUnivariateStatistic[] maxImpl;
/** Sum of log statistic implementation - can be reset by setter. */
- private StorelessUnivariateStatistic[] sumLogImpl;
+ private final StorelessUnivariateStatistic[] sumLogImpl;
/** Geometric mean statistic implementation - can be reset by setter. */
- private StorelessUnivariateStatistic[] geoMeanImpl;
+ private final StorelessUnivariateStatistic[] geoMeanImpl;
/** Mean statistic implementation - can be reset by setter. */
- private StorelessUnivariateStatistic[] meanImpl;
+ private final StorelessUnivariateStatistic[] meanImpl;
/** Covariance statistic implementation - cannot be reset. */
- private VectorialCovariance covarianceImpl;
+ private final VectorialCovariance covarianceImpl;
/**
* Construct a MultivariateSummaryStatistics instance
@@ -164,6 +164,7 @@ public class MultivariateSummaryStatistics
* Returns the dimension of the data
* @return The dimension of the data
*/
+ @Override
public int getDimension() {
return k;
}
@@ -172,6 +173,7 @@ public class MultivariateSummaryStatistics
* Returns the number of available values
* @return The number of available values
*/
+ @Override
public long getN() {
return n;
}
@@ -196,6 +198,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component sums
*/
+ @Override
public double[] getSum() {
return getResults(sumImpl);
}
@@ -207,6 +210,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component sums of squares
*/
+ @Override
public double[] getSumSq() {
return getResults(sumSqImpl);
}
@@ -218,6 +222,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component log sums
*/
+ @Override
public double[] getSumLog() {
return getResults(sumLogImpl);
}
@@ -229,6 +234,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component means
*/
+ @Override
public double[] getMean() {
return getResults(meanImpl);
}
@@ -240,6 +246,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component standard deviations
*/
+ @Override
public double[] getStandardDeviation() {
double[] stdDev = new double[k];
if (getN() < 1) {
@@ -260,6 +267,7 @@ public class MultivariateSummaryStatistics
*
* @return the covariance matrix
*/
+ @Override
public RealMatrix getCovariance() {
return covarianceImpl.getResult();
}
@@ -271,6 +279,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component maxima
*/
+ @Override
public double[] getMax() {
return getResults(maxImpl);
}
@@ -282,6 +291,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component minima
*/
+ @Override
public double[] getMin() {
return getResults(minImpl);
}
@@ -293,6 +303,7 @@ public class MultivariateSummaryStatistics
*
* @return the array of component geometric means
*/
+ @Override
public double[] getGeometricMean() {
return getResults(geoMeanImpl);
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValues.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValues.java b/src/main/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValues.java
index b7071c3..a83d657 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValues.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValues.java
@@ -74,6 +74,7 @@ public class StatisticalSummaryValues implements Serializable,
/**
* @return Returns the max.
*/
+ @Override
public double getMax() {
return max;
}
@@ -81,6 +82,7 @@ public class StatisticalSummaryValues implements Serializable,
/**
* @return Returns the mean.
*/
+ @Override
public double getMean() {
return mean;
}
@@ -88,6 +90,7 @@ public class StatisticalSummaryValues implements Serializable,
/**
* @return Returns the min.
*/
+ @Override
public double getMin() {
return min;
}
@@ -95,6 +98,7 @@ public class StatisticalSummaryValues implements Serializable,
/**
* @return Returns the number of values.
*/
+ @Override
public long getN() {
return n;
}
@@ -102,6 +106,7 @@ public class StatisticalSummaryValues implements Serializable,
/**
* @return Returns the sum.
*/
+ @Override
public double getSum() {
return sum;
}
@@ -109,6 +114,7 @@ public class StatisticalSummaryValues implements Serializable,
/**
* @return Returns the standard deviation
*/
+ @Override
public double getStandardDeviation() {
return FastMath.sqrt(variance);
}
@@ -116,6 +122,7 @@ public class StatisticalSummaryValues implements Serializable,
/**
* @return Returns the variance.
*/
+ @Override
public double getVariance() {
return variance;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/StorelessUnivariateStatistic.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/StorelessUnivariateStatistic.java b/src/main/java/org/apache/commons/math4/stat/descriptive/StorelessUnivariateStatistic.java
index 4d72f38..938e093 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/StorelessUnivariateStatistic.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/StorelessUnivariateStatistic.java
@@ -82,6 +82,7 @@ public interface StorelessUnivariateStatistic extends UnivariateStatistic {
*
* @return a copy of the statistic
*/
+ @Override
StorelessUnivariateStatistic copy();
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java b/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java
index 3f0c4d7..b255805 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java
@@ -171,6 +171,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
* Returns the number of available values
* @return The number of available values
*/
+ @Override
public long getN() {
return n;
}
@@ -179,6 +180,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
* Returns the sum of the values that have been added
* @return The sum or <code>Double.NaN</code> if no values have been added
*/
+ @Override
public double getSum() {
return sumImpl.getResult();
}
@@ -201,6 +203,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
* </p>
* @return the mean
*/
+ @Override
public double getMean() {
return meanImpl.getResult();
}
@@ -212,6 +215,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
* </p>
* @return the standard deviation
*/
+ @Override
public double getStandardDeviation() {
double stdDev = Double.NaN;
if (getN() > 0) {
@@ -247,6 +251,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
*
* @return the variance
*/
+ @Override
public double getVariance() {
return varianceImpl.getResult();
}
@@ -272,6 +277,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
* </p>
* @return the maximum
*/
+ @Override
public double getMax() {
return maxImpl.getResult();
}
@@ -283,6 +289,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
* </p>
* @return the minimum
*/
+ @Override
public double getMin() {
return minImpl.getResult();
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/UnivariateStatistic.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/UnivariateStatistic.java b/src/main/java/org/apache/commons/math4/stat/descriptive/UnivariateStatistic.java
index 4b831d5..03228be 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/UnivariateStatistic.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/UnivariateStatistic.java
@@ -32,6 +32,7 @@ public interface UnivariateStatistic extends MathArrays.Function {
* @return the value of the statistic applied to the input array
* @throws MathIllegalArgumentException if values is null
*/
+ @Override
double evaluate(double[] values) throws MathIllegalArgumentException;
/**
@@ -44,6 +45,7 @@ public interface UnivariateStatistic extends MathArrays.Function {
* @return the value of the statistic applied to the included array entries
* @throws MathIllegalArgumentException if values is null or the indices are invalid
*/
+ @Override
double evaluate(double[] values, int begin, int length) throws MathIllegalArgumentException;
/**
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java
index 593eb42..46a4551 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java
@@ -208,6 +208,7 @@ public class Mean extends AbstractStorelessUnivariateStatistic
* @throws MathIllegalArgumentException if the parameters are not valid
* @since 2.1
*/
+ @Override
public double evaluate(final double[] values, final double[] weights,
final int begin, final int length) throws MathIllegalArgumentException {
if (test(values, weights, begin, length)) {
@@ -251,6 +252,7 @@ public class Mean extends AbstractStorelessUnivariateStatistic
* @throws MathIllegalArgumentException if the parameters are not valid
* @since 2.1
*/
+ @Override
public double evaluate(final double[] values, final double[] weights)
throws MathIllegalArgumentException {
return evaluate(values, weights, 0, values.length);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java
index 1800982..c7602ae 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java
@@ -314,6 +314,7 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
* @throws MathIllegalArgumentException if the parameters are not valid
* @since 2.1
*/
+ @Override
public double evaluate(final double[] values, final double[] weights,
final int begin, final int length) throws MathIllegalArgumentException {
@@ -370,6 +371,7 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
* @throws MathIllegalArgumentException if the parameters are not valid
* @since 2.1
*/
+ @Override
public double evaluate(final double[] values, final double[] weights)
throws MathIllegalArgumentException {
return evaluate(values, weights, 0, values.length);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
index 418f3c5..2e1e27b 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java
@@ -426,6 +426,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
* @param inputDataPoint is the data point passed
* @return computed percentile
*/
+ @Override
public double processDataPoint(final double inputDataPoint) {
// 1. Find cell and update minima and maxima
@@ -449,6 +450,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
*
* @return height of mid point marker
*/
+ @Override
public double getPercentileValue() {
return height(3);
}
@@ -553,6 +555,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
* @param markerIndex index of marker within (1,6)
* @return marker height
*/
+ @Override
public double height(final int markerIndex) {
if (markerIndex >= markerArray.length || markerIndex <= 0) {
throw new OutOfRangeException(markerIndex, 1,
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java
index 4336f7f..99e1fa7 100644
--- a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java
+++ b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java
@@ -159,6 +159,7 @@ public class Product extends AbstractStorelessUnivariateStatistic implements Ser
* @throws MathIllegalArgumentException if the parameters are not valid
* @since 2.1
*/
+ @Override
public double evaluate(final double[] values, final double[] weights,
final int begin, final int length) throws MathIllegalArgumentException {
double product = Double.NaN;
@@ -194,6 +195,7 @@ public class Product extends AbstractStorelessUnivariateStatistic implements Ser
* @throws MathIllegalArgumentException if the parameters are not valid
* @since 2.1
*/
+ @Override
public double evaluate(final double[] values, final double[] weights)
throws MathIllegalArgumentException {
return evaluate(values, weights, 0, values.length);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
index 6e29cb6..83b8c8f 100644
--- a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
+++ b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java
@@ -188,6 +188,7 @@ public class NaturalRanking implements RankingAlgorithm {
* @throws NotANumberException if the selected {@link NaNStrategy} is {@code FAILED}
* and a {@link Double#NaN} is encountered in the input data
*/
+ @Override
public double[] rank(double[] data) {
// Array recording initial positions of data to be ranked
@@ -449,6 +450,7 @@ public class NaturalRanking implements RankingAlgorithm {
* @param other the other pair to compare this to
* @return result of <code>Double.compare(value, other.value)</code>
*/
+ @Override
public int compareTo(IntDoublePair other) {
return Double.compare(value, other.value);
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java b/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java
index c7a1003..9782217 100644
--- a/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java
+++ b/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java
@@ -77,7 +77,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
/** summation of squared Y values */
private double sumsqy = 0.0;
/** boolean flag whether a regression constant is added */
- private boolean hasIntercept;
+ private final boolean hasIntercept;
/** zero tolerance */
private final double epsilon;
/**
@@ -98,7 +98,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* @throws ModelSpecificationException if {@code numberOfVariables is less than 1}
*/
public MillerUpdatingRegression(int numberOfVariables, boolean includeConstant, double errorTolerance)
- throws ModelSpecificationException {
+ throws ModelSpecificationException {
if (numberOfVariables < 1) {
throw new ModelSpecificationException(LocalizedFormats.NO_REGRESSORS);
}
@@ -137,7 +137,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* @throws ModelSpecificationException if {@code numberOfVariables is less than 1}
*/
public MillerUpdatingRegression(int numberOfVariables, boolean includeConstant)
- throws ModelSpecificationException {
+ throws ModelSpecificationException {
this(numberOfVariables, includeConstant, Precision.EPSILON);
}
@@ -145,6 +145,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* A getter method which determines whether a constant is included.
* @return true regression has an intercept, false no intercept
*/
+ @Override
public boolean hasIntercept() {
return this.hasIntercept;
}
@@ -153,6 +154,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* Gets the number of observations added to the regression model.
* @return number of observations
*/
+ @Override
public long getN() {
return this.nobs;
}
@@ -164,8 +166,9 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* @exception ModelSpecificationException if the length of {@code x} does not equal
* the number of independent variables in the model
*/
+ @Override
public void addObservation(final double[] x, final double y)
- throws ModelSpecificationException {
+ throws ModelSpecificationException {
if ((!this.hasIntercept && x.length != nvars) ||
(this.hasIntercept && x.length + 1 != nvars)) {
@@ -191,6 +194,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* @throws ModelSpecificationException if {@code x} is not rectangular, does not match
* the length of {@code y} or does not contain sufficient data to estimate the model
*/
+ @Override
public void addObservations(double[][] x, double[] y) throws ModelSpecificationException {
if ((x == null) || (y == null) || (x.length != y.length)) {
throw new ModelSpecificationException(
@@ -313,6 +317,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* As the name suggests, clear wipes the internals and reorders everything in the
* canonical order.
*/
+ @Override
public void clear() {
Arrays.fill(this.d, 0.0);
Arrays.fill(this.rhs, 0.0);
@@ -902,6 +907,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* @exception ModelSpecificationException - thrown if number of observations is
* less than the number of variables
*/
+ @Override
public RegressionResults regress() throws ModelSpecificationException {
return regress(this.nvars);
}
@@ -1002,6 +1008,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
* is greater than the regressors in the model or a regressor index in
* regressor array does not exist
*/
+ @Override
public RegressionResults regress(int[] variablesToInclude) throws ModelSpecificationException {
if (variablesToInclude.length > this.nvars) {
throw new ModelSpecificationException(
http://git-wip-us.apache.org/repos/asf/commons-math/blob/5d549fc3/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java b/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java
index 38f2e63..f68bc27 100644
--- a/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java
+++ b/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java
@@ -273,8 +273,9 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
* @throws ModelSpecificationException if the length of {@code x} does not equal
* the number of independent variables in the model
*/
+ @Override
public void addObservation(final double[] x,final double y)
- throws ModelSpecificationException {
+ throws ModelSpecificationException {
if( x == null || x.length == 0 ){
throw new ModelSpecificationException(LocalizedFormats.INVALID_REGRESSION_OBSERVATION,x!=null?x.length:0, 1);
}
@@ -291,6 +292,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
* @throws ModelSpecificationException if {@code x} is not rectangular, does not match
* the length of {@code y} or does not contain sufficient data to estimate the model
*/
+ @Override
public void addObservations(final double[][] x,final double[] y) throws ModelSpecificationException {
if ((x == null) || (y == null) || (x.length != y.length)) {
throw new ModelSpecificationException(
@@ -336,6 +338,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
/**
* Clears all data from the model.
*/
+ @Override
public void clear() {
sumX = 0d;
sumXX = 0d;
@@ -350,6 +353,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
*
* @return n number of observations that have been added.
*/
+ @Override
public long getN() {
return n;
}
@@ -408,6 +412,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
* @return true if the regression includes an intercept; false otherwise
* @see #SimpleRegression(boolean)
*/
+ @Override
public boolean hasIntercept() {
return hasIntercept;
}
@@ -768,6 +773,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
* @throws NoDataException if there is not sufficient data in the model to
* estimate the regression parameters
*/
+ @Override
public RegressionResults regress() throws ModelSpecificationException, NoDataException {
if (hasIntercept) {
if (n < 3) {
@@ -813,6 +819,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
* @throws MathIllegalArgumentException if the variablesToInclude array is null or zero length
* @throws OutOfRangeException if a requested variable is not present in model
*/
+ @Override
public RegressionResults regress(int[] variablesToInclude) throws MathIllegalArgumentException{
if( variablesToInclude == null || variablesToInclude.length == 0){
throw new MathIllegalArgumentException(LocalizedFormats.ARRAY_ZERO_LENGTH_OR_NULL_NOT_ALLOWED);
[2/2] [math] Add missing @Override tags, formatting.
Posted by tn...@apache.org.
Add missing @Override tags, formatting.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/8e4e5221
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/8e4e5221
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/8e4e5221
Branch: refs/heads/master
Commit: 8e4e5221515f820108f48396a18ceaed73de8dc1
Parents: 5d549fc
Author: Thomas Neidhart <th...@gmail.com>
Authored: Sat Apr 11 14:57:51 2015 +0200
Committer: Thomas Neidhart <th...@gmail.com>
Committed: Sat Apr 11 14:57:51 2015 +0200
----------------------------------------------------------------------
.../math4/linear/CholeskyDecomposition.java | 3 +-
.../math4/linear/EigenDecomposition.java | 52 +++++++++++---------
.../commons/math4/linear/LUDecomposition.java | 1 +
.../linear/SingularValueDecomposition.java | 6 ++-
4 files changed, 37 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/8e4e5221/src/main/java/org/apache/commons/math4/linear/CholeskyDecomposition.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/linear/CholeskyDecomposition.java b/src/main/java/org/apache/commons/math4/linear/CholeskyDecomposition.java
index 520c15e..06bbc83 100644
--- a/src/main/java/org/apache/commons/math4/linear/CholeskyDecomposition.java
+++ b/src/main/java/org/apache/commons/math4/linear/CholeskyDecomposition.java
@@ -56,7 +56,7 @@ public class CholeskyDecomposition {
*/
public static final double DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD = 1.0e-10;
/** Row-oriented storage for L<sup>T</sup> matrix data. */
- private double[][] lTData;
+ private final double[][] lTData;
/** Cached value of L. */
private RealMatrix cachedL;
/** Cached value of LT. */
@@ -306,6 +306,7 @@ public class CholeskyDecomposition {
*
* @return the inverse matrix.
*/
+ @Override
public RealMatrix getInverse() {
return solve(MatrixUtils.createRealIdentityMatrix(lTData.length));
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/8e4e5221/src/main/java/org/apache/commons/math4/linear/EigenDecomposition.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/linear/EigenDecomposition.java b/src/main/java/org/apache/commons/math4/linear/EigenDecomposition.java
index 332320c..9633670 100644
--- a/src/main/java/org/apache/commons/math4/linear/EigenDecomposition.java
+++ b/src/main/java/org/apache/commons/math4/linear/EigenDecomposition.java
@@ -28,47 +28,50 @@ import org.apache.commons.math4.util.Precision;
/**
* Calculates the eigen decomposition of a real matrix.
- * <p>The eigen decomposition of matrix A is a set of two matrices:
+ * <p>
+ * The eigen decomposition of matrix A is a set of two matrices:
* V and D such that A = V × D × V<sup>T</sup>.
- * A, V and D are all m × m matrices.</p>
- * <p>This class is similar in spirit to the <code>EigenvalueDecomposition</code>
+ * A, V and D are all m × m matrices.
+ * <p>
+ * This class is similar in spirit to the {@code EigenvalueDecomposition}
* class from the <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a>
- * library, with the following changes:</p>
+ * library, with the following changes:
* <ul>
* <li>a {@link #getVT() getVt} method has been added,</li>
- * <li>two {@link #getRealEigenvalue(int) getRealEigenvalue} and {@link #getImagEigenvalue(int)
- * getImagEigenvalue} methods to pick up a single eigenvalue have been added,</li>
- * <li>a {@link #getEigenvector(int) getEigenvector} method to pick up a single
- * eigenvector has been added,</li>
+ * <li>two {@link #getRealEigenvalue(int) getRealEigenvalue} and
+ * {@link #getImagEigenvalue(int) getImagEigenvalue} methods to pick up a
+ * single eigenvalue have been added,</li>
+ * <li>a {@link #getEigenvector(int) getEigenvector} method to pick up a
+ * single eigenvector has been added,</li>
* <li>a {@link #getDeterminant() getDeterminant} method has been added.</li>
* <li>a {@link #getSolver() getSolver} method has been added.</li>
* </ul>
* <p>
* As of 3.1, this class supports general real matrices (both symmetric and non-symmetric):
- * </p>
* <p>
- * If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is diagonal and the eigenvector
- * matrix V is orthogonal, i.e. A = V.multiply(D.multiply(V.transpose())) and
- * V.multiply(V.transpose()) equals the identity matrix.
+ * If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is diagonal
+ * and the eigenvector matrix V is orthogonal, i.e.
+ * {@code A = V.multiply(D.multiply(V.transpose()))} and
+ * {@code V.multiply(V.transpose())} equals the identity matrix.
* </p>
* <p>
- * If A is not symmetric, then the eigenvalue matrix D is block diagonal with the real eigenvalues
- * in 1-by-1 blocks and any complex eigenvalues, lambda + i*mu, in 2-by-2 blocks:
+ * If A is not symmetric, then the eigenvalue matrix D is block diagonal with the real
+ * eigenvalues in 1-by-1 blocks and any complex eigenvalues, lambda + i*mu, in 2-by-2
+ * blocks:
* <pre>
* [lambda, mu ]
* [ -mu, lambda]
* </pre>
- * The columns of V represent the eigenvectors in the sense that A*V = V*D,
+ * The columns of V represent the eigenvectors in the sense that {@code A*V = V*D},
* i.e. A.multiply(V) equals V.multiply(D).
- * The matrix V may be badly conditioned, or even singular, so the validity of the equation
- * A = V*D*inverse(V) depends upon the condition of V.
- * </p>
+ * The matrix V may be badly conditioned, or even singular, so the validity of the
+ * equation {@code A = V*D*inverse(V)} depends upon the condition of V.
* <p>
* This implementation is based on the paper by A. Drubrulle, R.S. Martin and
* J.H. Wilkinson "The Implicit QL Algorithm" in Wilksinson and Reinsch (1971)
* Handbook for automatic computation, vol. 2, Linear algebra, Springer-Verlag,
- * New-York
- * </p>
+ * New-York.
+ *
* @see <a href="http://mathworld.wolfram.com/EigenDecomposition.html">MathWorld</a>
* @see <a href="http://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix">Wikipedia</a>
* @since 2.0 (changed to concrete class in 3.0)
@@ -77,7 +80,7 @@ public class EigenDecomposition {
/** Internally used epsilon criteria. */
private static final double EPSILON = 1e-12;
/** Maximum number of iterations accepted in the implicit QL transformation */
- private byte maxIter = 30;
+ private final byte maxIter = 30;
/** Main diagonal of the tridiagonal matrix. */
private double[] main;
/** Secondary diagonal of the tridiagonal matrix. */
@@ -376,9 +379,9 @@ public class EigenDecomposition {
/** Specialized solver. */
private static class Solver implements DecompositionSolver {
/** Real part of the realEigenvalues. */
- private double[] realEigenvalues;
+ private final double[] realEigenvalues;
/** Imaginary part of the realEigenvalues. */
- private double[] imagEigenvalues;
+ private final double[] imagEigenvalues;
/** Eigenvectors. */
private final ArrayRealVector[] eigenvectors;
@@ -410,6 +413,7 @@ public class EigenDecomposition {
* @throws DimensionMismatchException if the matrices dimensions do not match.
* @throws SingularMatrixException if the decomposed matrix is singular.
*/
+ @Override
public RealVector solve(final RealVector b) {
if (!isNonSingular()) {
throw new SingularMatrixException();
@@ -477,6 +481,7 @@ public class EigenDecomposition {
*
* @return true if the decomposed matrix is non-singular.
*/
+ @Override
public boolean isNonSingular() {
double largestEigenvalueNorm = 0.0;
// Looping over all values (in case they are not sorted in decreasing
@@ -514,6 +519,7 @@ public class EigenDecomposition {
* @return the inverse matrix.
* @throws SingularMatrixException if the decomposed matrix is singular.
*/
+ @Override
public RealMatrix getInverse() {
if (!isNonSingular()) {
throw new SingularMatrixException();
http://git-wip-us.apache.org/repos/asf/commons-math/blob/8e4e5221/src/main/java/org/apache/commons/math4/linear/LUDecomposition.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/linear/LUDecomposition.java b/src/main/java/org/apache/commons/math4/linear/LUDecomposition.java
index 397898e..0688444 100644
--- a/src/main/java/org/apache/commons/math4/linear/LUDecomposition.java
+++ b/src/main/java/org/apache/commons/math4/linear/LUDecomposition.java
@@ -386,6 +386,7 @@ public class LUDecomposition {
* @return the inverse matrix.
* @throws SingularMatrixException if the decomposed matrix is singular.
*/
+ @Override
public RealMatrix getInverse() {
return solve(MatrixUtils.createRealIdentityMatrix(pivot.length));
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/8e4e5221/src/main/java/org/apache/commons/math4/linear/SingularValueDecomposition.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/linear/SingularValueDecomposition.java b/src/main/java/org/apache/commons/math4/linear/SingularValueDecomposition.java
index ab7e74b..65ec195 100644
--- a/src/main/java/org/apache/commons/math4/linear/SingularValueDecomposition.java
+++ b/src/main/java/org/apache/commons/math4/linear/SingularValueDecomposition.java
@@ -658,7 +658,7 @@ public class SingularValueDecomposition {
/** Pseudo-inverse of the initial matrix. */
private final RealMatrix pseudoInverse;
/** Singularity indicator. */
- private boolean nonSingular;
+ private final boolean nonSingular;
/**
* Build a solver from decomposed matrix.
@@ -699,6 +699,7 @@ public class SingularValueDecomposition {
* @throws org.apache.commons.math4.exception.DimensionMismatchException
* if the matrices dimensions do not match.
*/
+ @Override
public RealVector solve(final RealVector b) {
return pseudoInverse.operate(b);
}
@@ -715,6 +716,7 @@ public class SingularValueDecomposition {
* @throws org.apache.commons.math4.exception.DimensionMismatchException
* if the matrices dimensions do not match.
*/
+ @Override
public RealMatrix solve(final RealMatrix b) {
return pseudoInverse.multiply(b);
}
@@ -724,6 +726,7 @@ public class SingularValueDecomposition {
*
* @return {@code true} if the decomposed matrix is non-singular.
*/
+ @Override
public boolean isNonSingular() {
return nonSingular;
}
@@ -733,6 +736,7 @@ public class SingularValueDecomposition {
*
* @return the inverse matrix.
*/
+ @Override
public RealMatrix getInverse() {
return pseudoInverse;
}