Fixed checkstyle, javadoc, findbugs and eclipse warnings.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1139915 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2011-06-26 19:13:06 +00:00
parent c56bc8fa33
commit 0a150a6718
6 changed files with 36 additions and 12 deletions

View File

@ -81,8 +81,6 @@ import org.apache.commons.math.util.MathUtils;
* @version $Id$
*/
public class KalmanFilter {
/** Serializable version identifier. */
private static final long serialVersionUID = 4878026651422612760L;
/** The process model used by this filter instance. */
private final ProcessModel processModel;
/** The measurement model used by this filter instance. */
@ -343,8 +341,8 @@ public class KalmanFilter {
*/
public void correct(final RealVector z) {
// sanity checks
if (z != null &&
z.getDimension() != measurementMatrix.getRowDimension()) {
MathUtils.checkNotNull(z);
if (z.getDimension() != measurementMatrix.getRowDimension()) {
throw new DimensionMismatchException(z.getDimension(),
measurementMatrix.getRowDimension());
}

View File

@ -345,6 +345,7 @@ public class PolygonsSet extends AbstractRegion<Euclidean2D, Euclidean1D> {
}
/** Private extension of Segment allowing comparison. */
private static class ComparableSegment extends Segment implements Comparable<ComparableSegment> {
/** Sorting key. */

View File

@ -133,9 +133,6 @@ public abstract class AbstractRegion<S extends Space, T extends Space> implement
}
/** {@inheritDoc} */
public abstract AbstractRegion<S, T> buildNew(BSPTree<S> newTree);
/** Build a convex region from an array of bounding hyperplanes.
* @param hyperplanes array of bounding hyperplanes (if null, an
* empty region will be built)
@ -164,6 +161,9 @@ public abstract class AbstractRegion<S extends Space, T extends Space> implement
}
/** {@inheritDoc} */
public abstract AbstractRegion<S, T> buildNew(BSPTree<S> newTree);
/** Recursively build a tree by inserting cut sub-hyperplanes.
* @param node current tree node (it is a leaf node at the beginning
* of the call)

View File

@ -855,6 +855,30 @@ public class CMAESOptimizer extends
public int compareTo(DoubleIndex o) {
return Double.compare(value, o.value);
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other instanceof DoubleIndex) {
return Double.compare(value, ((DoubleIndex) other).value) == 0;
}
return false;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
long bits = Double.doubleToLongBits(value);
return (int) ((1438542 ^ (bits >>> 32) ^ bits) & 0xffffffff);
}
}
/**

View File

@ -89,8 +89,9 @@ public class KMeansPlusPlusClusterer<T extends Clusterable<T>> {
*
* @param points the points to cluster
* @param k the number of clusters to split the data into
* @param maxIterations the maximum number of iterations to run the algorithm
* for. If negative, no maximum will be used
* @param numTrials number of trial runs
* @param maxIterationsPerTrial the maximum number of iterations to run the algorithm
* for at each trial run. If negative, no maximum will be used
* @return a list of clusters containing the points
* @throws MathIllegalArgumentException if the data points are null or the number
* of clusters is larger than the number of data points

View File

@ -356,7 +356,7 @@ public class ChiSquareTestImpl implements UnknownDistributionChiSquareTest {
* Check all entries of the input array are strictly positive.
*
* @param in Array to be tested.
* @exception NotStrictlyPositiveException if one entry is not positive.
* @exception MathIllegalArgumentException if one entry is not positive.
*/
private void checkPositive(double[] in) {
for (int i = 0; i < in.length; i++) {
@ -372,7 +372,7 @@ public class ChiSquareTestImpl implements UnknownDistributionChiSquareTest {
* Check all entries of the input array are >= 0.
*
* @param in Array to be tested.
* @exception NotPositiveException if one entry is negative.
* @exception MathIllegalArgumentException if one entry is negative.
*/
private void checkNonNegative(long[] in) {
for (int i = 0; i < in.length; i++) {
@ -388,7 +388,7 @@ public class ChiSquareTestImpl implements UnknownDistributionChiSquareTest {
* Check all entries of the input array are >= 0.
*
* @param in Array to be tested.
* @exception NotPositiveException if one entry is negative.
* @exception MathIllegalArgumentException if one entry is negative.
*/
private void checkNonNegative(long[][] in) {
for (int i = 0; i < in.length; i ++) {