Added missing javadoc.
This commit is contained in:
parent
ab908d64bf
commit
2272f5cce7
|
@ -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} */
|
||||
@Override
|
||||
public double value(double x)
|
||||
throws MathIllegalArgumentException, TooManyEvaluationsException {
|
||||
|
|
|
@ -97,6 +97,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] ||
|
||||
|
|
|
@ -125,6 +125,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] ||
|
||||
|
|
|
@ -116,6 +116,7 @@ public class UnivariatePeriodicInterpolator
|
|||
|
||||
final UnivariateFunction f = interpolator.interpolate(x, y);
|
||||
return new UnivariateFunction() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double value(final double x) throws MathIllegalArgumentException {
|
||||
return f.value(MathUtils.reduce(x, period, offset));
|
||||
|
|
|
@ -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} */
|
||||
@Override
|
||||
|
|
|
@ -163,7 +163,7 @@ implements RealDistribution, Serializable {
|
|||
}
|
||||
|
||||
final UnivariateFunction toSolve = new UnivariateFunction() {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double value(final double x) {
|
||||
return cumulativeProbability(x) - p;
|
||||
|
|
|
@ -54,6 +54,7 @@ public class ConstantRealDistribution extends AbstractRealDistribution {
|
|||
return x < value ? 0 : 1;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double inverseCumulativeProbability(final double p)
|
||||
throws OutOfRangeException {
|
||||
|
|
|
@ -118,6 +118,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) {
|
||||
|
|
|
@ -111,6 +111,7 @@ public class LaplaceDistribution extends AbstractRealDistribution {
|
|||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double inverseCumulativeProbability(double p) throws OutOfRangeException {
|
||||
if (p < 0.0 || p > 1.0) {
|
||||
|
|
|
@ -112,6 +112,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) {
|
||||
|
|
|
@ -130,6 +130,7 @@ public class NakagamiDistribution extends AbstractRealDistribution {
|
|||
return omega;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected double getSolverAbsoluteAccuracy() {
|
||||
return inverseAbsoluteAccuracy;
|
||||
|
|
|
@ -259,6 +259,7 @@ public class TriangularDistribution extends AbstractRealDistribution {
|
|||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double inverseCumulativeProbability(double p)
|
||||
throws OutOfRangeException {
|
||||
|
|
|
@ -119,6 +119,7 @@ public class UniformRealDistribution extends AbstractRealDistribution {
|
|||
return (x - lower) / (upper - lower);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double inverseCumulativeProbability(final double p)
|
||||
throws OutOfRangeException {
|
||||
|
|
|
@ -271,6 +271,7 @@ public class ZipfDistribution extends AbstractIntegerDistribution {
|
|||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int sample() {
|
||||
if (sampler == null) {
|
||||
|
|
|
@ -134,6 +134,7 @@ public abstract class AbstractCurveFitter {
|
|||
*/
|
||||
public MultivariateMatrixFunction getModelFunctionJacobian() {
|
||||
return new MultivariateMatrixFunction() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double[][] value(double[] p) {
|
||||
final int len = points.length;
|
||||
|
|
|
@ -72,6 +72,7 @@ import org.apache.commons.math4.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} */
|
||||
@Override
|
||||
public int compare(WeightedObservedPoint p1,
|
||||
WeightedObservedPoint p2) {
|
||||
|
|
|
@ -248,6 +248,7 @@ public class GaussNewtonOptimizer implements LeastSquaresOptimizer {
|
|||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GaussNewtonOptimizer{" +
|
||||
|
|
|
@ -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} */
|
||||
@Override
|
||||
public Evaluation evaluate(final RealVector point) {
|
||||
counter.incrementCount();
|
||||
|
@ -245,6 +247,7 @@ public class LeastSquaresFactory {
|
|||
*/
|
||||
public static ConvergenceChecker<Evaluation> evaluationChecker(final ConvergenceChecker<PointVectorValuePair> checker) {
|
||||
return new ConvergenceChecker<Evaluation>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean converged(final int iteration,
|
||||
final Evaluation previous,
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -74,6 +74,7 @@ public abstract class BinaryChromosome extends AbstractListChromosome<Integer> {
|
|||
return rList;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected boolean isSame(Chromosome another) {
|
||||
// type check
|
||||
|
|
|
@ -58,6 +58,7 @@ public class ChromosomePair {
|
|||
return second;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("(%s,%s)", getFirst(), getSecond());
|
||||
|
|
|
@ -278,6 +278,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);
|
||||
|
|
|
@ -75,6 +75,7 @@ public class TournamentSelection implements SelectionPolicy {
|
|||
}
|
||||
// auxiliary population
|
||||
ListPopulation tournamentPopulation = new ListPopulation(this.arity) {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Population nextGeneration() {
|
||||
// not useful here
|
||||
|
|
|
@ -452,7 +452,6 @@ 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 final double cXX;
|
||||
|
||||
|
@ -471,10 +470,14 @@ public class Line implements Hyperplane<Euclidean2D>, Embedding<Euclidean2D, Euc
|
|||
/** Transform addendum for output ordinate. */
|
||||
private final double cY1;
|
||||
|
||||
/** cXY * cY1 - cYY * cX1. */
|
||||
private final double c1Y;
|
||||
|
||||
/** cXX * cY1 - cYX * cX1. */
|
||||
private final double c1X;
|
||||
|
||||
/** cXX * cYY - cYX * cXY. */
|
||||
private final 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
|
||||
|
|
|
@ -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} */
|
||||
@Override
|
||||
public int compare(final Vector2D o1, final Vector2D o2) {
|
||||
final double tolerance = getTolerance();
|
||||
|
|
|
@ -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} */
|
||||
@Override
|
||||
public int compare(final SubHyperplane<S> o1, final SubHyperplane<S> o2) {
|
||||
final double size1 = o1.getSize();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -236,6 +236,8 @@ public class EventState {
|
|||
final double h = dt / n;
|
||||
|
||||
final UnivariateFunction f = new UnivariateFunction() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double value(final double t) throws LocalMaxCountExceededException {
|
||||
try {
|
||||
interpolator.setInterpolatedTime(t);
|
||||
|
|
|
@ -183,6 +183,7 @@ public class LinearConstraint implements Serializable {
|
|||
return value;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
|
@ -197,6 +198,7 @@ public class LinearConstraint implements Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return relationship.hashCode() ^
|
||||
|
|
|
@ -107,6 +107,7 @@ public class LinearObjectiveFunction
|
|||
return coefficients.dotProduct(point) + constantTerm;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
|
@ -120,6 +121,7 @@ public class LinearObjectiveFunction
|
|||
return false;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Double.valueOf(constantTerm).hashCode() ^ coefficients.hashCode();
|
||||
|
|
|
@ -41,6 +41,7 @@ public enum Relationship {
|
|||
this.stringValue = stringValue;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String toString() {
|
||||
return stringValue;
|
||||
|
|
|
@ -674,6 +674,7 @@ class SimplexTableau implements Serializable {
|
|||
return tableau.getData();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
|
||||
|
@ -696,6 +697,7 @@ class SimplexTableau implements Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Boolean.valueOf(restrictToNonNegative).hashCode() ^
|
||||
|
|
|
@ -112,6 +112,7 @@ public class LineSearch {
|
|||
final double[] direction) {
|
||||
final int n = startPoint.length;
|
||||
final UnivariateFunction f = new UnivariateFunction() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double value(double alpha) {
|
||||
final double[] x = new double[n];
|
||||
|
|
|
@ -94,6 +94,7 @@ public class MultiStartMultivariateOptimizer
|
|||
*/
|
||||
private Comparator<PointValuePair> getPairComparator() {
|
||||
return new Comparator<PointValuePair>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compare(final PointValuePair o1,
|
||||
final PointValuePair o2) {
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -131,6 +131,7 @@ public class SimplexOptimizer extends MultivariateOptimizer {
|
|||
// evaluations counter.
|
||||
final MultivariateFunction evalFunc
|
||||
= new MultivariateFunction() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double value(double[] point) {
|
||||
return computeObjectiveValue(point);
|
||||
|
@ -140,6 +141,7 @@ public class SimplexOptimizer extends MultivariateOptimizer {
|
|||
final boolean isMinim = getGoalType() == GoalType.MINIMIZE;
|
||||
final Comparator<PointValuePair> comparator
|
||||
= new Comparator<PointValuePair>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compare(final PointValuePair o1,
|
||||
final PointValuePair o2) {
|
||||
|
|
|
@ -211,6 +211,7 @@ public class MultiStartUnivariateOptimizer
|
|||
*/
|
||||
private void sortPairs(final GoalType goal) {
|
||||
Arrays.sort(optima, new Comparator<UnivariatePointValuePair>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compare(final UnivariatePointValuePair o1,
|
||||
final UnivariatePointValuePair o2) {
|
||||
|
|
|
@ -195,6 +195,7 @@ public class Beta {
|
|||
} else {
|
||||
ContinuedFraction fraction = new ContinuedFraction() {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected double getB(int n, double x) {
|
||||
double ret;
|
||||
|
@ -211,6 +212,7 @@ public class Beta {
|
|||
return ret;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected double getA(int n, double x) {
|
||||
return 1.0;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -168,6 +168,7 @@ public class KendallsCorrelation {
|
|||
}
|
||||
|
||||
Arrays.sort(pairs, new Comparator<Pair<Double, Double>>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compare(Pair<Double, Double> pair1, Pair<Double, Double> pair2) {
|
||||
int compareFirst = pair1.getFirst().compareTo(pair2.getFirst());
|
||||
|
|
|
@ -825,6 +825,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
|
|||
return result;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Arrays.hashCode(new double[] {markerHeight, intMarkerPosition,
|
||||
|
|
|
@ -846,12 +846,14 @@ public class MathArrays {
|
|||
final Comparator<PairDoubleInteger> comp
|
||||
= dir == MathArrays.OrderDirection.INCREASING ?
|
||||
new Comparator<PairDoubleInteger>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compare(PairDoubleInteger o1,
|
||||
PairDoubleInteger o2) {
|
||||
return Double.compare(o1.getKey(), o2.getKey());
|
||||
}
|
||||
} : new Comparator<PairDoubleInteger>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compare(PairDoubleInteger o1,
|
||||
PairDoubleInteger o2) {
|
||||
|
|
|
@ -133,6 +133,7 @@ public class Pair<K, V> {
|
|||
return result;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[" + getKey() + ", " + getValue() + "]";
|
||||
|
|
Loading…
Reference in New Issue