Added missing javadoc.

This commit is contained in:
Luc Maisonobe 2015-11-03 20:52:28 +01:00
parent 99cbfc28e2
commit 85dd630c0c
59 changed files with 129 additions and 7 deletions

View File

@ -559,6 +559,7 @@ public class FunctionUtils {
};
}
/** {@inheritDoc} */
public MultivariateVectorFunction gradient() {
return new MultivariateVectorFunction() {
/** {@inheritDoc} */
@ -680,6 +681,7 @@ public class FunctionUtils {
return f.value(x);
}
/** {@inheritDoc} */
public MultivariateMatrixFunction jacobian() {
return new MultivariateMatrixFunction() {
/** {@inheritDoc} */

View File

@ -158,6 +158,7 @@ public class IterativeLegendreGaussIntegrator
throws TooManyEvaluationsException {
// Function to be integrated is stored in the base class.
final UnivariateFunction f = new UnivariateFunction() {
/** {@inheritDoc} */
public double value(double x)
throws MathIllegalArgumentException, TooManyEvaluationsException {
return computeObjectiveValue(x);

View File

@ -96,6 +96,7 @@ public class BicubicInterpolator
// Create the interpolating function.
return new BicubicInterpolatingFunction(xval, yval, fval,
dFdX, dFdY, d2FdXdY) {
/** {@inheritDoc} */
@Override
public boolean isValidPoint(double x, double y) {
if (x < xval[1] ||

View File

@ -497,6 +497,7 @@ class BicubicSplineFunction implements BivariateFunction {
}
partialDerivativeX = new BivariateFunction() {
/** {@inheritDoc} */
public double value(double x, double y) {
final double x2 = x * x;
final double[] pX = {0, 1, x, x2};
@ -509,6 +510,7 @@ class BicubicSplineFunction implements BivariateFunction {
}
};
partialDerivativeY = new BivariateFunction() {
/** {@inheritDoc} */
public double value(double x, double y) {
final double x2 = x * x;
final double x3 = x2 * x;
@ -521,6 +523,7 @@ class BicubicSplineFunction implements BivariateFunction {
}
};
partialDerivativeXX = new BivariateFunction() {
/** {@inheritDoc} */
public double value(double x, double y) {
final double[] pX = {0, 0, 1, x};
@ -532,6 +535,7 @@ class BicubicSplineFunction implements BivariateFunction {
}
};
partialDerivativeYY = new BivariateFunction() {
/** {@inheritDoc} */
public double value(double x, double y) {
final double x2 = x * x;
final double x3 = x2 * x;
@ -543,6 +547,7 @@ class BicubicSplineFunction implements BivariateFunction {
}
};
partialDerivativeXY = new BivariateFunction() {
/** {@inheritDoc} */
public double value(double x, double y) {
final double x2 = x * x;
final double[] pX = {0, 1, x, x2};

View File

@ -124,6 +124,7 @@ public class TricubicInterpolator
dFdX, dFdY, dFdZ,
d2FdXdY, d2FdXdZ, d2FdYdZ,
d3FdXdYdZ) {
/** {@inheritDoc} */
@Override
public boolean isValidPoint(double x, double y, double z) {
if (x < xval[1] ||

View File

@ -115,6 +115,7 @@ public class UnivariatePeriodicInterpolator
final UnivariateFunction f = interpolator.interpolate(x, y);
return new UnivariateFunction() {
/** {@inheritDoc} */
public double value(final double x) throws MathIllegalArgumentException {
return f.value(MathUtils.reduce(x, period, offset));
}

View File

@ -104,6 +104,7 @@ public class PolynomialsUtils {
public static PolynomialFunction createChebyshevPolynomial(final int degree) {
return buildPolynomial(degree, CHEBYSHEV_COEFFICIENTS,
new RecurrenceCoefficientsGenerator() {
/** Fixed recurrence coefficients. */
private final BigFraction[] coeffs = { BigFraction.ZERO, BigFraction.TWO, BigFraction.ONE };
/** {@inheritDoc} */
public BigFraction[] generate(int k) {

View File

@ -196,7 +196,7 @@ implements RealDistribution, Serializable {
}
final UnivariateFunction toSolve = new UnivariateFunction() {
/** {@inheritDoc} */
public double value(final double x) {
return cumulativeProbability(x) - p;
}

View File

@ -52,6 +52,7 @@ public class ConstantRealDistribution extends AbstractRealDistribution {
return x < value ? 0 : 1;
}
/** {@inheritDoc} */
@Override
public double inverseCumulativeProbability(final double p)
throws OutOfRangeException {

View File

@ -116,6 +116,7 @@ public class GumbelDistribution extends AbstractRealDistribution {
return FastMath.exp(-FastMath.exp(-z));
}
/** {@inheritDoc} */
@Override
public double inverseCumulativeProbability(double p) throws OutOfRangeException {
if (p < 0.0 || p > 1.0) {

View File

@ -109,6 +109,7 @@ public class LaplaceDistribution extends AbstractRealDistribution {
}
}
/** {@inheritDoc} */
@Override
public double inverseCumulativeProbability(double p) throws OutOfRangeException {
if (p < 0.0 || p > 1.0) {

View File

@ -110,6 +110,7 @@ public class LogisticDistribution extends AbstractRealDistribution {
return 1.0 / (1.0 + FastMath.exp(-z));
}
/** {@inheritDoc} */
@Override
public double inverseCumulativeProbability(double p) throws OutOfRangeException {
if (p < 0.0 || p > 1.0) {

View File

@ -130,6 +130,7 @@ public class NakagamiDistribution extends AbstractRealDistribution {
return omega;
}
/** {@inheritDoc} */
@Override
protected double getSolverAbsoluteAccuracy() {
return inverseAbsoluteAccuracy;

View File

@ -262,6 +262,7 @@ public class TriangularDistribution extends AbstractRealDistribution {
return true;
}
/** {@inheritDoc} */
@Override
public double inverseCumulativeProbability(double p)
throws OutOfRangeException {

View File

@ -159,6 +159,7 @@ public class UniformRealDistribution extends AbstractRealDistribution {
return (x - lower) / (upper - lower);
}
/** {@inheritDoc} */
@Override
public double inverseCumulativeProbability(final double p)
throws OutOfRangeException {

View File

@ -133,6 +133,7 @@ public abstract class AbstractCurveFitter {
*/
public MultivariateMatrixFunction getModelFunctionJacobian() {
return new MultivariateMatrixFunction() {
/** {@inheritDoc} */
public double[][] value(double[] p) {
final int len = points.length;
final double[][] jacobian = new double[len][];

View File

@ -218,6 +218,7 @@ public class CurveFitter<T extends ParametricUnivariateFunction> {
*/
public ModelFunctionJacobian getModelFunctionJacobian() {
return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
/** {@inheritDoc} */
public double[][] value(double[] point) {
final double[][] jacobian = new double[observations.size()][];
int i = 0;

View File

@ -72,6 +72,7 @@ import org.apache.commons.math3.util.FastMath;
public class GaussianCurveFitter extends AbstractCurveFitter {
/** Parametric function to be fitted. */
private static final Gaussian.Parametric FUNCTION = new Gaussian.Parametric() {
/** {@inheritDoc} */
@Override
public double value(double x, double ... p) {
double v = Double.POSITIVE_INFINITY;
@ -83,6 +84,7 @@ public class GaussianCurveFitter extends AbstractCurveFitter {
return v;
}
/** {@inheritDoc} */
@Override
public double[] gradient(double x, double ... p) {
double[] v = { Double.POSITIVE_INFINITY,
@ -249,6 +251,7 @@ public class GaussianCurveFitter extends AbstractCurveFitter {
final List<WeightedObservedPoint> observations = new ArrayList<WeightedObservedPoint>(unsorted);
final Comparator<WeightedObservedPoint> cmp = new Comparator<WeightedObservedPoint>() {
/** {@inheritDoc} */
public int compare(WeightedObservedPoint p1,
WeightedObservedPoint p2) {
if (p1 == null && p2 == null) {

View File

@ -81,6 +81,7 @@ public class GaussianFitter extends CurveFitter<Gaussian.Parametric> {
*/
public double[] fit(double[] initialGuess) {
final Gaussian.Parametric f = new Gaussian.Parametric() {
/** {@inheritDoc} */
@Override
public double value(double x, double ... p) {
double v = Double.POSITIVE_INFINITY;
@ -92,6 +93,7 @@ public class GaussianFitter extends CurveFitter<Gaussian.Parametric> {
return v;
}
/** {@inheritDoc} */
@Override
public double[] gradient(double x, double ... p) {
double[] v = { Double.POSITIVE_INFINITY,
@ -183,6 +185,7 @@ public class GaussianFitter extends CurveFitter<Gaussian.Parametric> {
final WeightedObservedPoint[] observations = unsorted.clone();
final Comparator<WeightedObservedPoint> cmp
= new Comparator<WeightedObservedPoint>() {
/** {@inheritDoc} */
public int compare(WeightedObservedPoint p1,
WeightedObservedPoint p2) {
if (p1 == null && p2 == null) {

View File

@ -247,6 +247,7 @@ public class GaussNewtonOptimizer implements LeastSquaresOptimizer {
}
}
/** {@inheritDoc} */
@Override
public String toString() {
return "GaussNewtonOptimizer{" +

View File

@ -192,6 +192,7 @@ public class LeastSquaresFactory {
final RealMatrix weights) {
final RealMatrix weightSquareRoot = squareRoot(weights);
return new LeastSquaresAdapter(problem) {
/** {@inheritDoc} */
@Override
public Evaluation evaluate(final RealVector point) {
return new DenseWeightedEvaluation(super.evaluate(point), weightSquareRoot);
@ -226,6 +227,7 @@ public class LeastSquaresFactory {
final Incrementor counter) {
return new LeastSquaresAdapter(problem) {
/** {@inheritDoc} */
public Evaluation evaluate(final RealVector point) {
counter.incrementCount();
return super.evaluate(point);
@ -244,6 +246,7 @@ public class LeastSquaresFactory {
*/
public static ConvergenceChecker<Evaluation> evaluationChecker(final ConvergenceChecker<PointVectorValuePair> checker) {
return new ConvergenceChecker<Evaluation>() {
/** {@inheritDoc} */
public boolean converged(final int iteration,
final Evaluation previous,
final Evaluation current) {

View File

@ -98,6 +98,7 @@ public abstract class AbstractListChromosome<T> extends Chromosome {
*/
public abstract AbstractListChromosome<T> newFixedLengthChromosome(final List<T> chromosomeRepresentation);
/** {@inheritDoc} */
@Override
public String toString() {
return String.format("(f=%s %s)", getFitness(), getRepresentation());

View File

@ -73,6 +73,7 @@ public abstract class BinaryChromosome extends AbstractListChromosome<Integer> {
return rList;
}
/** {@inheritDoc} */
@Override
protected boolean isSame(Chromosome another) {
// type check

View File

@ -58,6 +58,7 @@ public class ChromosomePair {
return second;
}
/** {@inheritDoc} */
@Override
public String toString() {
return String.format("(%s,%s)", getFirst(), getSecond());

View File

@ -277,6 +277,7 @@ public abstract class RandomKey<T> extends AbstractListChromosome<Double> implem
return Arrays.asList(res);
}
/** {@inheritDoc} */
@Override
public String toString() {
return String.format("(f=%s pi=(%s))", getFitness(), baseSeqPermutation);

View File

@ -74,6 +74,7 @@ public class TournamentSelection implements SelectionPolicy {
}
// auxiliary population
ListPopulation tournamentPopulation = new ListPopulation(this.arity) {
/** {@inheritDoc} */
public Population nextGeneration() {
// not useful here
return null;

View File

@ -491,18 +491,32 @@ public class Line implements Hyperplane<Euclidean2D>, Embedding<Euclidean2D, Euc
*/
private static class LineTransform implements Transform<Euclidean2D, Euclidean1D> {
// CHECKSTYLE: stop JavadocVariable check
/** Transform factor between input abscissa and output abscissa. */
private double cXX;
private double cXY;
private double cX1;
/** Transform factor between input abscissa and output ordinate. */
private double cYX;
/** Transform factor between input ordinate and output abscissa. */
private double cXY;
/** Transform factor between input ordinate and output ordinate. */
private double cYY;
/** Transform addendum for output abscissa. */
private double cX1;
/** Transform addendum for output ordinate. */
private double cY1;
/** cXY * cY1 - cYY * cX1. */
private double c1Y;
/** cXX * cY1 - cYX * cX1. */
private double c1X;
/** cXX * cYY - cYX * cXY. */
private double c11;
// CHECKSTYLE: resume JavadocVariable check
/** Build an affine line transform from a n {@code AffineTransform}.
* @param cXX transform factor between input abscissa and output abscissa

View File

@ -73,6 +73,7 @@ public class MonotoneChain extends AbstractConvexHullGenerator2D {
super(includeCollinearPoints, tolerance);
}
/** {@inheritDoc} */
@Override
public Collection<Vector2D> findHullVertices(final Collection<Vector2D> points) {
@ -80,6 +81,7 @@ public class MonotoneChain extends AbstractConvexHullGenerator2D {
// sort the points in increasing order on the x-axis
Collections.sort(pointsSortedByXAxis, new Comparator<Vector2D>() {
/** {@inheritDoc} */
public int compare(final Vector2D o1, final Vector2D o2) {
final double tolerance = getTolerance();
// need to take the tolerance value into account, otherwise collinear points

View File

@ -110,6 +110,7 @@ public abstract class AbstractRegion<S extends Space, T extends Space> implement
// (we don't want equal size elements to be removed, so
// we use a trick to fool the TreeSet)
final TreeSet<SubHyperplane<S>> ordered = new TreeSet<SubHyperplane<S>>(new Comparator<SubHyperplane<S>>() {
/** {@inheritDoc} */
public int compare(final SubHyperplane<S> o1, final SubHyperplane<S> o2) {
final double size1 = o1.getSize();
final double size2 = o2.getSize();

View File

@ -45,6 +45,7 @@ public class SumOfClusterVariances<T extends Clusterable> extends ClusterEvaluat
super(measure);
}
/** {@inheritDoc} */
@Override
public double score(final List<? extends Cluster<T>> clusters) {
double varianceSum = 0.0;

View File

@ -236,6 +236,7 @@ public class EventState {
final double h = dt / n;
final UnivariateFunction f = new UnivariateFunction() {
/** {@inheritDoc} */
public double value(final double t) throws LocalMaxCountExceededException {
try {
interpolator.setInterpolatedTime(t);

View File

@ -182,6 +182,7 @@ public class LinearConstraint implements Serializable {
return value;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
if (this == other) {
@ -196,6 +197,7 @@ public class LinearConstraint implements Serializable {
return false;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return relationship.hashCode() ^

View File

@ -105,6 +105,7 @@ public class LinearObjectiveFunction
return coefficients.dotProduct(point) + constantTerm;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
if (this == other) {
@ -118,6 +119,7 @@ public class LinearObjectiveFunction
return false;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return Double.valueOf(constantTerm).hashCode() ^ coefficients.hashCode();

View File

@ -41,6 +41,7 @@ public enum Relationship {
this.stringValue = stringValue;
}
/** {@inheritDoc} */
@Override
public String toString() {
return stringValue;

View File

@ -651,6 +651,7 @@ class SimplexTableau implements Serializable {
return tableau.getData();
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
@ -673,6 +674,7 @@ class SimplexTableau implements Serializable {
return false;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return Boolean.valueOf(restrictToNonNegative).hashCode() ^

View File

@ -112,6 +112,7 @@ public class LineSearch {
final double[] direction) {
final int n = startPoint.length;
final UnivariateFunction f = new UnivariateFunction() {
/** {@inheritDoc} */
public double value(double alpha) {
final double[] x = new double[n];
for (int i = 0; i < n; i++) {

View File

@ -93,6 +93,7 @@ public class MultiStartMultivariateOptimizer
*/
private Comparator<PointValuePair> getPairComparator() {
return new Comparator<PointValuePair>() {
/** {@inheritDoc} */
public int compare(final PointValuePair o1,
final PointValuePair o2) {
if (o1 == null) {

View File

@ -54,18 +54,29 @@ public class BOBYQAOptimizer
public static final double DEFAULT_INITIAL_RADIUS = 10.0;
/** Default value for {@link #stoppingTrustRegionRadius}: {@value} . */
public static final double DEFAULT_STOPPING_RADIUS = 1E-8;
/** Constant 0. */
private static final double ZERO = 0d;
/** Constant 1. */
private static final double ONE = 1d;
/** Constant 2. */
private static final double TWO = 2d;
/** Constant 10. */
private static final double TEN = 10d;
/** Constant 16. */
private static final double SIXTEEN = 16d;
/** Constant 250. */
private static final double TWO_HUNDRED_FIFTY = 250d;
/** Constant -1. */
private static final double MINUS_ONE = -ONE;
/** Constant 1/2. */
private static final double HALF = ONE / 2;
/** Constant 1/4. */
private static final double ONE_OVER_FOUR = ONE / 4;
/** Constant 1/8. */
private static final double ONE_OVER_EIGHT = ONE / 8;
/** Constant 1/10. */
private static final double ONE_OVER_TEN = ONE / 10;
/** Constant 1/1000. */
private static final double ONE_OVER_A_THOUSAND = ONE / 1000;
/**
@ -2447,8 +2458,10 @@ public class BOBYQAOptimizer
* If the path becomes explored, it should just be removed from the code.
*/
private static class PathIsExploredException extends RuntimeException {
/** Serializable UID. */
private static final long serialVersionUID = 745350979634801853L;
/** Message string. */
private static final String PATH_IS_EXPLORED
= "If this exception is thrown, just remove it from the code";

View File

@ -130,6 +130,7 @@ public class SimplexOptimizer extends MultivariateOptimizer {
// evaluations counter.
final MultivariateFunction evalFunc
= new MultivariateFunction() {
/** {@inheritDoc} */
public double value(double[] point) {
return computeObjectiveValue(point);
}
@ -138,6 +139,7 @@ public class SimplexOptimizer extends MultivariateOptimizer {
final boolean isMinim = getGoalType() == GoalType.MINIMIZE;
final Comparator<PointValuePair> comparator
= new Comparator<PointValuePair>() {
/** {@inheritDoc} */
public int compare(final PointValuePair o1,
final PointValuePair o2) {
final double v1 = o1.getValue();

View File

@ -97,9 +97,12 @@ public class MultiStartMultivariateVectorOptimizer
*/
private Comparator<PointVectorValuePair> getPairComparator() {
return new Comparator<PointVectorValuePair>() {
/** Observed value to be matched. */
private final RealVector target = new ArrayRealVector(optimizer.getTarget(), false);
/** Observations weights. */
private final RealMatrix weight = optimizer.getWeight();
/** {@inheritDoc} */
public int compare(final PointVectorValuePair o1,
final PointVectorValuePair o2) {
if (o1 == null) {

View File

@ -210,6 +210,7 @@ public class MultiStartUnivariateOptimizer
*/
private void sortPairs(final GoalType goal) {
Arrays.sort(optima, new Comparator<UnivariatePointValuePair>() {
/** {@inheritDoc} */
public int compare(final UnivariatePointValuePair o1,
final UnivariatePointValuePair o2) {
if (o1 == null) {

View File

@ -175,6 +175,7 @@ public class BaseMultivariateMultiStartOptimizer<FUNC extends MultivariateFuncti
*/
private void sortPairs(final GoalType goal) {
Arrays.sort(optima, new Comparator<PointValuePair>() {
/** {@inheritDoc} */
public int compare(final PointValuePair o1,
final PointValuePair o2) {
if (o1 == null) {

View File

@ -181,6 +181,7 @@ public class BaseMultivariateVectorMultiStartOptimizer<FUNC extends Multivariate
private void sortPairs(final double[] target,
final double[] weights) {
Arrays.sort(optima, new Comparator<PointVectorValuePair>() {
/** {@inheritDoc} */
public int compare(final PointVectorValuePair o1,
final PointVectorValuePair o2) {
if (o1 == null) {

View File

@ -59,18 +59,29 @@ public class BOBYQAOptimizer
public static final double DEFAULT_INITIAL_RADIUS = 10.0;
/** Default value for {@link #stoppingTrustRegionRadius}: {@value} . */
public static final double DEFAULT_STOPPING_RADIUS = 1E-8;
/** Constant 0. */
private static final double ZERO = 0d;
/** Constant 1. */
private static final double ONE = 1d;
/** Constant 2. */
private static final double TWO = 2d;
/** Constant 10. */
private static final double TEN = 10d;
/** Constant 16. */
private static final double SIXTEEN = 16d;
/** Constant 250. */
private static final double TWO_HUNDRED_FIFTY = 250d;
/** Constant -1. */
private static final double MINUS_ONE = -ONE;
/** Constant 1/2. */
private static final double HALF = ONE / 2;
/** Constant 1/4. */
private static final double ONE_OVER_FOUR = ONE / 4;
/** Constant 1/8. */
private static final double ONE_OVER_EIGHT = ONE / 8;
/** Constant 1/10. */
private static final double ONE_OVER_TEN = ONE / 10;
/** Constant 1/1000. */
private static final double ONE_OVER_A_THOUSAND = ONE / 1000;
/**
@ -2452,8 +2463,10 @@ public class BOBYQAOptimizer
* If the path becomes explored, it should just be removed from the code.
*/
private static class PathIsExploredException extends RuntimeException {
/** Serializable UID. */
private static final long serialVersionUID = 745350979634801853L;
/** Message string. */
private static final String PATH_IS_EXPLORED
= "If this exception is thrown, just remove it from the code";

View File

@ -330,6 +330,7 @@ public class PowellOptimizer
public UnivariatePointValuePair search(final double[] p, final double[] d) {
final int n = p.length;
final UnivariateFunction f = new UnivariateFunction() {
/** {@inheritDoc} */
public double value(double alpha) {
final double[] x = new double[n];
for (int i = 0; i < n; i++) {

View File

@ -187,6 +187,7 @@ public class SimplexOptimizer
// evaluations counter.
final MultivariateFunction evalFunc
= new MultivariateFunction() {
/** {@inheritDoc} */
public double value(double[] point) {
return computeObjectiveValue(point);
}
@ -195,6 +196,7 @@ public class SimplexOptimizer
final boolean isMinim = getGoalType() == GoalType.MINIMIZE;
final Comparator<PointValuePair> comparator
= new Comparator<PointValuePair>() {
/** {@inheritDoc} */
public int compare(final PointValuePair o1,
final PointValuePair o2) {
final double v1 = o1.getValue();

View File

@ -214,6 +214,7 @@ public class CurveFitter<T extends ParametricUnivariateFunction> {
/** {@inheritDoc} */
public MultivariateMatrixFunction jacobian() {
return new MultivariateMatrixFunction() {
/** {@inheritDoc} */
public double[][] value(double[] point) {
final double[][] jacobian = new double[observations.size()][];

View File

@ -82,6 +82,7 @@ public class GaussianFitter extends CurveFitter<Gaussian.Parametric> {
*/
public double[] fit(double[] initialGuess) {
final Gaussian.Parametric f = new Gaussian.Parametric() {
/** {@inheritDoc} */
@Override
public double value(double x, double ... p) {
double v = Double.POSITIVE_INFINITY;
@ -93,6 +94,7 @@ public class GaussianFitter extends CurveFitter<Gaussian.Parametric> {
return v;
}
/** {@inheritDoc} */
@Override
public double[] gradient(double x, double ... p) {
double[] v = { Double.POSITIVE_INFINITY,
@ -184,6 +186,7 @@ public class GaussianFitter extends CurveFitter<Gaussian.Parametric> {
final WeightedObservedPoint[] observations = unsorted.clone();
final Comparator<WeightedObservedPoint> cmp
= new Comparator<WeightedObservedPoint>() {
/** {@inheritDoc} */
public int compare(WeightedObservedPoint p1,
WeightedObservedPoint p2) {
if (p1 == null && p2 == null) {

View File

@ -185,6 +185,7 @@ public class LinearConstraint implements Serializable {
return value;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
@ -201,6 +202,7 @@ public class LinearConstraint implements Serializable {
return false;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return relationship.hashCode() ^

View File

@ -102,6 +102,7 @@ public class LinearObjectiveFunction implements Serializable {
return coefficients.dotProduct(point) + constantTerm;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
@ -117,6 +118,7 @@ public class LinearObjectiveFunction implements Serializable {
return false;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return Double.valueOf(constantTerm).hashCode() ^ coefficients.hashCode();

View File

@ -44,6 +44,7 @@ public enum Relationship {
this.stringValue = stringValue;
}
/** {@inheritDoc} */
@Override
public String toString() {
return stringValue;

View File

@ -575,6 +575,7 @@ class SimplexTableau implements Serializable {
return tableau.getData();
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
@ -597,6 +598,7 @@ class SimplexTableau implements Serializable {
return false;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return Boolean.valueOf(restrictToNonNegative).hashCode() ^

View File

@ -185,6 +185,7 @@ public class UnivariateMultiStartOptimizer<FUNC extends UnivariateFunction>
*/
private void sortPairs(final GoalType goal) {
Arrays.sort(optima, new Comparator<UnivariatePointValuePair>() {
/** {@inheritDoc} */
public int compare(final UnivariatePointValuePair o1,
final UnivariatePointValuePair o2) {
if (o1 == null) {

View File

@ -197,6 +197,7 @@ public class Beta {
} else {
ContinuedFraction fraction = new ContinuedFraction() {
/** {@inheritDoc} */
@Override
protected double getB(int n, double x) {
double ret;
@ -213,6 +214,7 @@ public class Beta {
return ret;
}
/** {@inheritDoc} */
@Override
protected double getA(int n, double x) {
return 1.0;

View File

@ -402,11 +402,13 @@ public class Gamma {
// create continued fraction
ContinuedFraction cf = new ContinuedFraction() {
/** {@inheritDoc} */
@Override
protected double getA(int n, double x) {
return ((2.0 * n) + 1.0) - a + x;
}
/** {@inheritDoc} */
@Override
protected double getB(int n, double x) {
return n * (a - n);

View File

@ -168,6 +168,7 @@ public class KendallsCorrelation {
}
Arrays.sort(pairs, new Comparator<Pair<Double, Double>>() {
/** {@inheritDoc} */
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());

View File

@ -829,6 +829,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
return result;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return Arrays.hashCode(new double[] {markerHeight, intMarkerPosition,

View File

@ -846,11 +846,13 @@ public class MathArrays {
final Comparator<PairDoubleInteger> comp
= dir == MathArrays.OrderDirection.INCREASING ?
new Comparator<PairDoubleInteger>() {
/** {@inheritDoc} */
public int compare(PairDoubleInteger o1,
PairDoubleInteger o2) {
return Double.compare(o1.getKey(), o2.getKey());
}
} : new Comparator<PairDoubleInteger>() {
/** {@inheritDoc} */
public int compare(PairDoubleInteger o1,
PairDoubleInteger o2) {
return Double.compare(o2.getKey(), o1.getKey());

View File

@ -133,6 +133,7 @@ public class Pair<K, V> {
return result;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "[" + getKey() + ", " + getValue() + "]";