diff --git a/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.java b/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.java index 44d9079c6..b7d6f1f89 100644 --- a/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.java +++ b/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.java @@ -98,7 +98,7 @@ public interface UnivariateRealSolver extends ConvergingAlgorithm { */ double solve(int maxEval, UnivariateRealFunction f, double min, double max) throws ConvergenceException, MathUserException; - + /** * Solve for a zero root in the given interval. *

A solver may require that the interval brackets a single zero root. diff --git a/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java b/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java index b0550d2ff..15b65b971 100644 --- a/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java +++ b/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java @@ -234,7 +234,7 @@ public abstract class AbstractContinuousDistribution * @return lower bound of the support (might be Double.NEGATIVE_INFINITY) */ public abstract double getSupportLowerBound(); - + /** * Access the upper bound of the support. * diff --git a/src/main/java/org/apache/commons/math/distribution/AbstractDistribution.java b/src/main/java/org/apache/commons/math/distribution/AbstractDistribution.java index 11a4064c1..eca6be292 100644 --- a/src/main/java/org/apache/commons/math/distribution/AbstractDistribution.java +++ b/src/main/java/org/apache/commons/math/distribution/AbstractDistribution.java @@ -35,10 +35,10 @@ public abstract class AbstractDistribution private double numericalMean = Double.NaN; private boolean numericalMeanIsCalculated = false; - + private double numericalVariance = Double.NaN; private boolean numericalVarianceIsCalculated = false; - + /** * Default constructor. */ @@ -72,12 +72,12 @@ public abstract class AbstractDistribution } return cumulativeProbability(x1) - cumulativeProbability(x0); } - + /** * This method invalidates cached moments when parameters change. * Usually it is called from a sub-class when the distribution * gets its parameters updated. - * + * * @deprecated as of 2.2 (sub-classes will become immutable in 3.0) */ @Deprecated @@ -85,18 +85,18 @@ public abstract class AbstractDistribution numericalMeanIsCalculated = false; numericalVarianceIsCalculated = false; } - + /** - * Use this method to actually calculate the mean for the - * specific distribution. Use {@link #getNumericalMean()} + * Use this method to actually calculate the mean for the + * specific distribution. Use {@link #getNumericalMean()} * (which implements caching) to actually get the mean. - * + * * @return the mean or Double.NaN if it's not defined */ protected abstract double calculateNumericalMean(); - + /** - * Use this method to get the numerical value of the mean of this + * Use this method to get the numerical value of the mean of this * distribution. * * @return the mean or Double.NaN if it's not defined @@ -109,22 +109,22 @@ public abstract class AbstractDistribution return numericalMean; } - + /** - * Use this method to actually calculate the variance for the - * specific distribution. Use {@link #getNumericalVariance()} - * (which implements caching) to actually get the variance. + * Use this method to actually calculate the variance for the + * specific distribution. Use {@link #getNumericalVariance()} + * (which implements caching) to actually get the variance. * * @return the variance or Double.NaN if it's not defined */ protected abstract double calculateNumericalVariance(); - + /** - * Use this method to get the numerical value of the variance of this + * Use this method to get the numerical value of the variance of this * distribution. * - * @return the variance (possibly Double.POSITIVE_INFINITY as - * for certain cases in {@link TDistributionImpl}) or + * @return the variance (possibly Double.POSITIVE_INFINITY as + * for certain cases in {@link TDistributionImpl}) or * Double.NaN if it's not defined */ public double getNumericalVariance() { @@ -132,40 +132,40 @@ public abstract class AbstractDistribution numericalVariance = calculateNumericalVariance(); numericalVarianceIsCalculated = true; } - + return numericalVariance; - } - + } + /** - * Use this method to get information about whether the lower bound + * Use this method to get information about whether the lower bound * of the support is inclusive or not. * * @return whether the lower bound of the support is inclusive or not */ public abstract boolean isSupportLowerBoundInclusive(); - + /** - * Use this method to get information about whether the upper bound + * Use this method to get information about whether the upper bound * of the support is inclusive or not. * * @return whether the upper bound of the support is inclusive or not */ - public abstract boolean isSupportUpperBoundInclusive(); - + public abstract boolean isSupportUpperBoundInclusive(); + /** - * Use this method to get information about whether the support is connected, + * Use this method to get information about whether the support is connected, * i.e. whether all values between the lower and upper bound of the support * is included in the support. - * + * * For {@link AbstractIntegerDistribution} the support is discrete, so - * if this is true, then the support is + * if this is true, then the support is * {lower bound, lower bound + 1, ..., upper bound}. - * + * * For {@link AbstractContinuousDistribution} the support is continuous, so * if this is true, then the support is the interval * [lower bound, upper bound] - * where the limits are inclusive or not according to - * {@link #isSupportLowerBoundInclusive()} and {@link #isSupportUpperBoundInclusive()} + * where the limits are inclusive or not according to + * {@link #isSupportLowerBoundInclusive()} and {@link #isSupportUpperBoundInclusive()} * (in the example both are true). If both are false, then the support is the interval * (lower bound, upper bound) * diff --git a/src/main/java/org/apache/commons/math/distribution/AbstractIntegerDistribution.java b/src/main/java/org/apache/commons/math/distribution/AbstractIntegerDistribution.java index 63bcdf8e8..03bd7da93 100644 --- a/src/main/java/org/apache/commons/math/distribution/AbstractIntegerDistribution.java +++ b/src/main/java/org/apache/commons/math/distribution/AbstractIntegerDistribution.java @@ -291,42 +291,42 @@ public abstract class AbstractIntegerDistribution extends AbstractDistribution * P(X < upper bound) > p */ protected abstract int getDomainUpperBound(double p); - + /** * Access the lower bound of the support. * * @return lower bound of the support (Integer.MIN_VALUE for negative infinity) */ public abstract int getSupportLowerBound(); - + /** * Access the upper bound of the support. * * @return upper bound of the support (Integer.MAX_VALUE for positive infinity) */ public abstract int getSupportUpperBound(); - + /** - * Use this method to get information about whether the lower bound + * Use this method to get information about whether the lower bound * of the support is inclusive or not. For discrete support, * only true here is meaningful. * - * @return true (always but at Integer.MIN_VALUE because of the nature of discrete support) + * @return true (always but at Integer.MIN_VALUE because of the nature of discrete support) */ @Override public boolean isSupportLowerBoundInclusive() { return true; } - + /** - * Use this method to get information about whether the upper bound + * Use this method to get information about whether the upper bound * of the support is inclusive or not. For discrete support, * only true here is meaningful. * - * @return true (always but at Integer.MAX_VALUE because of the nature of discrete support) + * @return true (always but at Integer.MAX_VALUE because of the nature of discrete support) */ @Override public boolean isSupportUpperBoundInclusive() { return true; - } + } } diff --git a/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java index e67ef8b4d..3547d55b1 100644 --- a/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java +++ b/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java @@ -228,7 +228,7 @@ public class BetaDistributionImpl /** * {@inheritDoc} - * + * * The lower bound of the support is always 0 no matter the parameters. * * @return lower bound of the support (always 0) @@ -240,7 +240,7 @@ public class BetaDistributionImpl /** * {@inheritDoc} - * + * * The upper bound of the support is always 1 no matter the parameters. * * @return upper bound of the support (always 1) @@ -252,8 +252,8 @@ public class BetaDistributionImpl /** * {@inheritDoc} - * - * For first shape parameter s1 and + * + * For first shape parameter s1 and * second shape parameter s2, the mean is * s1 / (s1 + s2) * @@ -267,9 +267,9 @@ public class BetaDistributionImpl /** * {@inheritDoc} - * - * For first shape parameter s1 and - * second shape parameter s2, + * + * For first shape parameter s1 and + * second shape parameter s2, * the variance is * [ s1 * s2 ] / [ (s1 + s2)^2 * (s1 + s2 + 1) ] * @@ -278,7 +278,7 @@ public class BetaDistributionImpl @Override protected double calculateNumericalVariance() { final double alpha = getAlpha(); - final double beta = getBeta(); + final double beta = getBeta(); final double alphabetasum = alpha + beta; return (alpha * beta) / ((alphabetasum * alphabetasum) * (alphabetasum + 1)); } diff --git a/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java index 899734615..11fe7a6e7 100644 --- a/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java +++ b/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java @@ -85,7 +85,7 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution setNumberOfTrialsInternal(trials); invalidateParameterDependentMoments(); } - + /** * Change the number of trials for this distribution. * @@ -114,7 +114,7 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution setProbabilityOfSuccessInternal(p); invalidateParameterDependentMoments(); } - + /** * Change the probability of success for this distribution. * @@ -227,8 +227,8 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution /** * {@inheritDoc} - * - * The lower bound of the support is always 0 no matter the number of trials + * + * The lower bound of the support is always 0 no matter the number of trials * and probability parameter. * * @return lower bound of the support (always 0) @@ -237,10 +237,10 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution public int getSupportLowerBound() { return 0; } - + /** * {@inheritDoc} - * + * * The upper bound of the support is the number of trials. * * @return upper bound of the support (equal to number of trials) @@ -252,8 +252,8 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution /** * {@inheritDoc} - * - * For n number of trials and + * + * For n number of trials and * probability parameter p, the mean is * n * p * @@ -266,8 +266,8 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution /** * {@inheritDoc} - * - * For n number of trials and + * + * For n number of trials and * probability parameter p, the variance is * n * p * (1 - p) * diff --git a/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java index 4be6e3bd0..9d7617b06 100644 --- a/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java +++ b/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java @@ -159,7 +159,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution setMedianInternal(median); invalidateParameterDependentMoments(); } - + /** * Modify the median. * @param newMedian for this distribution @@ -179,7 +179,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution setScaleInternal(s); invalidateParameterDependentMoments(); } - + /** * Modify the scale parameter. * @param s scale parameter for this distribution @@ -274,8 +274,8 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * - * The lower bound of the support is always negative infinity no matter + * + * The lower bound of the support is always negative infinity no matter * the parameters. * * @return lower bound of the support (always Double.NEGATIVE_INFINITY) @@ -287,8 +287,8 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * - * The upper bound of the support is always positive infinity no matter + * + * The upper bound of the support is always positive infinity no matter * the parameters. * * @return upper bound of the support (always Double.POSITIVE_INFINITY) @@ -300,7 +300,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * + * * The mean is always undefined no matter the parameters. * * @return mean (always Double.NaN) @@ -312,7 +312,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * + * * The variance is always undefined no matter the parameters. * * @return variance (always Double.NaN) diff --git a/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java index bbe3884dd..98fd6cc16 100644 --- a/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java +++ b/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java @@ -273,8 +273,8 @@ public class ChiSquaredDistributionImpl /** * {@inheritDoc} - * - * The lower bound of the support is always 0 no matter the + * + * The lower bound of the support is always 0 no matter the * degrees of freedom. * * @return lower bound of the support (always 0) @@ -286,8 +286,8 @@ public class ChiSquaredDistributionImpl /** * {@inheritDoc} - * - * The upper bound of the support is always positive infinity no matter the + * + * The upper bound of the support is always positive infinity no matter the * degrees of freedom. * * @return upper bound of the support (always Double.POSITIVE_INFINITY) @@ -299,7 +299,7 @@ public class ChiSquaredDistributionImpl /** * {@inheritDoc} - * + * * For k degrees of freedom, the mean is * k * @@ -312,7 +312,7 @@ public class ChiSquaredDistributionImpl /** * {@inheritDoc} - * + * * For k degrees of freedom, the variance is * 2 * k * diff --git a/src/main/java/org/apache/commons/math/distribution/Distribution.java b/src/main/java/org/apache/commons/math/distribution/Distribution.java index 3edc3a4d2..2b58d8588 100644 --- a/src/main/java/org/apache/commons/math/distribution/Distribution.java +++ b/src/main/java/org/apache/commons/math/distribution/Distribution.java @@ -52,55 +52,55 @@ public interface Distribution { * @throws IllegalArgumentException if x0 > x1 */ double cumulativeProbability(double x0, double x1) throws MathException; - + /** - * Use this method to get the numerical value of the mean of this + * Use this method to get the numerical value of the mean of this * distribution. * * @return the mean or Double.NaN if it's not defined */ double getNumericalMean(); - + /** - * Use this method to get the numerical value of the variance of this + * Use this method to get the numerical value of the variance of this * distribution. * - * @return the variance (possibly Double.POSITIVE_INFINITY as - * for certain cases in {@link TDistributionImpl}) or + * @return the variance (possibly Double.POSITIVE_INFINITY as + * for certain cases in {@link TDistributionImpl}) or * Double.NaN if it's not defined */ - double getNumericalVariance(); - + double getNumericalVariance(); + /** - * Use this method to get information about whether the lower bound + * Use this method to get information about whether the lower bound * of the support is inclusive or not. * * @return whether the lower bound of the support is inclusive or not */ boolean isSupportLowerBoundInclusive(); - + /** - * Use this method to get information about whether the upper bound + * Use this method to get information about whether the upper bound * of the support is inclusive or not. * * @return whether the upper bound of the support is inclusive or not */ - boolean isSupportUpperBoundInclusive(); - + boolean isSupportUpperBoundInclusive(); + /** - * Use this method to get information about whether the support is connected, + * Use this method to get information about whether the support is connected, * i.e. whether all values between the lower and upper bound of the support * is included in the support. - * + * * For {@link AbstractIntegerDistribution} the support is discrete, so - * if this is true, then the support is + * if this is true, then the support is * {lower bound, lower bound + 1, ..., upper bound}. - * + * * For {@link AbstractContinuousDistribution} the support is continuous, so * if this is true, then the support is the interval * [lower bound, upper bound] - * where the limits are inclusive or not according to - * {@link #isSupportLowerBoundInclusive()} and {@link #isSupportUpperBoundInclusive()} + * where the limits are inclusive or not according to + * {@link #isSupportLowerBoundInclusive()} and {@link #isSupportUpperBoundInclusive()} * (in the example both are true). If both are false, then the support is the interval * (lower bound, upper bound) * diff --git a/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java index d434c2eab..e5fc2340d 100644 --- a/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java +++ b/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java @@ -267,7 +267,7 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * + * * The lower bound of the support is always 0 no matter the mean parameter. * * @return lower bound of the support (always 0) @@ -279,8 +279,8 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * - * The upper bound of the support is always positive infinity + * + * The upper bound of the support is always positive infinity * no matter the mean parameter. * * @return upper bound of the support (always Double.POSITIVE_INFINITY) @@ -292,7 +292,7 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * + * * For mean parameter k, the mean is * k * @@ -305,7 +305,7 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution /** * {@inheritDoc} - * + * * For mean parameter k, the variance is * k^2 * diff --git a/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java index db8d48c66..06ce190c9 100644 --- a/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java +++ b/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java @@ -280,10 +280,10 @@ public class FDistributionImpl protected double getSolverAbsoluteAccuracy() { return solverAbsoluteAccuracy; } - + /** * {@inheritDoc} - * + * * The lower bound of the support is always 0 no matter the parameters. * * @return lower bound of the support (always 0) @@ -295,8 +295,8 @@ public class FDistributionImpl /** * {@inheritDoc} - * - * The upper bound of the support is always positive infinity + * + * The upper bound of the support is always positive infinity * no matter the parameters. * * @return upper bound of the support (always Double.POSITIVE_INFINITY) @@ -308,8 +308,8 @@ public class FDistributionImpl /** * {@inheritDoc} - * - * For denominator degrees of freedom parameter b, + * + * For denominator degrees of freedom parameter b, * the mean is *

* * @return {@inheritDoc} - */ + */ @Override - protected double calculateNumericalMean() { + protected double calculateNumericalMean() { final double denominatorDF = getDenominatorDegreesOfFreedom(); if (denominatorDF > 2) { - return denominatorDF / (denominatorDF - 2); + return denominatorDF / (denominatorDF - 2); } - + return Double.NaN; } /** * {@inheritDoc} - * - * For numerator degrees of freedom parameter a - * and denominator degrees of freedom parameter b, + * + * For numerator degrees of freedom parameter a + * and denominator degrees of freedom parameter b, * the variance is *