From ece7c6fc67c0d584f4884c5b17ddf491a397fdfe Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Tue, 24 Feb 2015 23:08:40 +0100 Subject: [PATCH] [MATH-859] Remove deprecated isSupportXXXInclusive methods from RealDistribution. --- .../math4/distribution/BetaDistribution.java | 10 ------ .../distribution/CauchyDistribution.java | 10 ------ .../distribution/ChiSquaredDistribution.java | 10 ------ .../ConstantRealDistribution.java | 10 ------ .../EnumeratedRealDistribution.java | 22 ------------- .../distribution/ExponentialDistribution.java | 10 ------ .../math4/distribution/FDistribution.java | 10 ------ .../math4/distribution/GammaDistribution.java | 10 ------ .../distribution/GumbelDistribution.java | 10 ------ .../distribution/LaplaceDistribution.java | 10 ------ .../math4/distribution/LevyDistribution.java | 13 -------- .../distribution/LogNormalDistribution.java | 10 ------ .../distribution/LogisticDistribution.java | 10 ------ .../distribution/NakagamiDistribution.java | 10 ------ .../distribution/NormalDistribution.java | 10 ------ .../distribution/ParetoDistribution.java | 10 ------ .../math4/distribution/RealDistribution.java | 26 --------------- .../math4/distribution/TDistribution.java | 10 ------ .../distribution/TriangularDistribution.java | 10 ------ .../distribution/UniformRealDistribution.java | 10 ------ .../distribution/WeibullDistribution.java | 10 ------ .../EnumeratedRealDistributionTest.java | 18 ----------- .../RealDistributionAbstractTest.java | 32 ------------------- 23 files changed, 291 deletions(-) diff --git a/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java b/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java index f2fb03c7d..408762db1 100644 --- a/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java @@ -246,16 +246,6 @@ public class BetaDistribution extends AbstractRealDistribution { return 1; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/CauchyDistribution.java b/src/main/java/org/apache/commons/math4/distribution/CauchyDistribution.java index 33d908e3f..d38b77139 100644 --- a/src/main/java/org/apache/commons/math4/distribution/CauchyDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/CauchyDistribution.java @@ -233,16 +233,6 @@ public class CauchyDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/ChiSquaredDistribution.java b/src/main/java/org/apache/commons/math4/distribution/ChiSquaredDistribution.java index 2627c33e8..a591b0fd4 100644 --- a/src/main/java/org/apache/commons/math4/distribution/ChiSquaredDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/ChiSquaredDistribution.java @@ -173,16 +173,6 @@ public class ChiSquaredDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/ConstantRealDistribution.java b/src/main/java/org/apache/commons/math4/distribution/ConstantRealDistribution.java index 6149b3189..7f1b8bdf7 100644 --- a/src/main/java/org/apache/commons/math4/distribution/ConstantRealDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/ConstantRealDistribution.java @@ -89,16 +89,6 @@ public class ConstantRealDistribution extends AbstractRealDistribution { return value; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return true; - } - /** * {@inheritDoc} */ diff --git a/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java b/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java index fabfe0014..8e5e5f69d 100644 --- a/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/EnumeratedRealDistribution.java @@ -239,28 +239,6 @@ public class EnumeratedRealDistribution extends AbstractRealDistribution { return max; } - /** - * {@inheritDoc} - * - * The support of this distribution includes the lower bound. - * - * @return {@code true} - */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** - * {@inheritDoc} - * - * The support of this distribution includes the upper bound. - * - * @return {@code true} - */ - public boolean isSupportUpperBoundInclusive() { - return true; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/ExponentialDistribution.java b/src/main/java/org/apache/commons/math4/distribution/ExponentialDistribution.java index abb99852d..8b25680cc 100644 --- a/src/main/java/org/apache/commons/math4/distribution/ExponentialDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/ExponentialDistribution.java @@ -328,16 +328,6 @@ public class ExponentialDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/FDistribution.java b/src/main/java/org/apache/commons/math4/distribution/FDistribution.java index c34d45fb6..12e59dc9e 100644 --- a/src/main/java/org/apache/commons/math4/distribution/FDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/FDistribution.java @@ -305,16 +305,6 @@ public class FDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java b/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java index daa9ef93d..8709ce05d 100644 --- a/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java @@ -385,16 +385,6 @@ public class GammaDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/GumbelDistribution.java b/src/main/java/org/apache/commons/math4/distribution/GumbelDistribution.java index 9ab0ef2ee..7d54ed870 100644 --- a/src/main/java/org/apache/commons/math4/distribution/GumbelDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/GumbelDistribution.java @@ -148,16 +148,6 @@ public class GumbelDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** {@inheritDoc} */ public boolean isSupportConnected() { return true; diff --git a/src/main/java/org/apache/commons/math4/distribution/LaplaceDistribution.java b/src/main/java/org/apache/commons/math4/distribution/LaplaceDistribution.java index d3f21bb9f..1555f40f8 100644 --- a/src/main/java/org/apache/commons/math4/distribution/LaplaceDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/LaplaceDistribution.java @@ -142,16 +142,6 @@ public class LaplaceDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** {@inheritDoc} */ public boolean isSupportConnected() { return true; diff --git a/src/main/java/org/apache/commons/math4/distribution/LevyDistribution.java b/src/main/java/org/apache/commons/math4/distribution/LevyDistribution.java index a2bbab1b1..084156290 100644 --- a/src/main/java/org/apache/commons/math4/distribution/LevyDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/LevyDistribution.java @@ -171,19 +171,6 @@ public class LevyDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - // there is a division by x-mu in the computation, so density - // is not finite at lower bound, bound must be excluded - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - // upper bound is infinite, so it must be excluded - return false; - } - /** {@inheritDoc} */ public boolean isSupportConnected() { return true; diff --git a/src/main/java/org/apache/commons/math4/distribution/LogNormalDistribution.java b/src/main/java/org/apache/commons/math4/distribution/LogNormalDistribution.java index ec43db557..1d246a2c0 100644 --- a/src/main/java/org/apache/commons/math4/distribution/LogNormalDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/LogNormalDistribution.java @@ -336,16 +336,6 @@ public class LogNormalDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/LogisticDistribution.java b/src/main/java/org/apache/commons/math4/distribution/LogisticDistribution.java index ee29d3f74..d996345b0 100644 --- a/src/main/java/org/apache/commons/math4/distribution/LogisticDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/LogisticDistribution.java @@ -142,16 +142,6 @@ public class LogisticDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** {@inheritDoc} */ public boolean isSupportConnected() { return true; diff --git a/src/main/java/org/apache/commons/math4/distribution/NakagamiDistribution.java b/src/main/java/org/apache/commons/math4/distribution/NakagamiDistribution.java index 94f57dfb6..7849bbd77 100644 --- a/src/main/java/org/apache/commons/math4/distribution/NakagamiDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/NakagamiDistribution.java @@ -170,16 +170,6 @@ public class NakagamiDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** {@inheritDoc} */ public boolean isSupportConnected() { return true; diff --git a/src/main/java/org/apache/commons/math4/distribution/NormalDistribution.java b/src/main/java/org/apache/commons/math4/distribution/NormalDistribution.java index e0332234e..efb828ee4 100644 --- a/src/main/java/org/apache/commons/math4/distribution/NormalDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/NormalDistribution.java @@ -282,16 +282,6 @@ public class NormalDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java b/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java index d788d959c..8da23e7d2 100644 --- a/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java @@ -288,16 +288,6 @@ public class ParetoDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} *

diff --git a/src/main/java/org/apache/commons/math4/distribution/RealDistribution.java b/src/main/java/org/apache/commons/math4/distribution/RealDistribution.java index d7b2499dc..d4ed51893 100644 --- a/src/main/java/org/apache/commons/math4/distribution/RealDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/RealDistribution.java @@ -135,32 +135,6 @@ public interface RealDistribution { */ double getSupportUpperBound(); - /** - * Whether or not the lower bound of support is in the domain of the density - * function. Returns true iff {@code getSupporLowerBound()} is finite and - * {@code density(getSupportLowerBound())} returns a non-NaN, non-infinite - * value. - * - * @return true if the lower bound of support is finite and the density - * function returns a non-NaN, non-infinite value there - * @deprecated to be removed in 4.0 - */ - @Deprecated - boolean isSupportLowerBoundInclusive(); - - /** - * Whether or not the upper bound of support is in the domain of the density - * function. Returns true iff {@code getSupportUpperBound()} is finite and - * {@code density(getSupportUpperBound())} returns a non-NaN, non-infinite - * value. - * - * @return true if the upper bound of support is finite and the density - * function returns a non-NaN, non-infinite value there - * @deprecated to be removed in 4.0 - */ - @Deprecated - boolean isSupportUpperBoundInclusive(); - /** * 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 diff --git a/src/main/java/org/apache/commons/math4/distribution/TDistribution.java b/src/main/java/org/apache/commons/math4/distribution/TDistribution.java index 6aa15f0e9..70c6f7db3 100644 --- a/src/main/java/org/apache/commons/math4/distribution/TDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/TDistribution.java @@ -249,16 +249,6 @@ public class TDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return false; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/TriangularDistribution.java b/src/main/java/org/apache/commons/math4/distribution/TriangularDistribution.java index 5ac6800dc..0f2f83351 100644 --- a/src/main/java/org/apache/commons/math4/distribution/TriangularDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/TriangularDistribution.java @@ -241,16 +241,6 @@ public class TriangularDistribution extends AbstractRealDistribution { return b; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return true; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/UniformRealDistribution.java b/src/main/java/org/apache/commons/math4/distribution/UniformRealDistribution.java index 92913bd9a..9079894c3 100644 --- a/src/main/java/org/apache/commons/math4/distribution/UniformRealDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/UniformRealDistribution.java @@ -213,16 +213,6 @@ public class UniformRealDistribution extends AbstractRealDistribution { return upper; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return true; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/apache/commons/math4/distribution/WeibullDistribution.java b/src/main/java/org/apache/commons/math4/distribution/WeibullDistribution.java index 0cb6f110d..8397ecb2f 100644 --- a/src/main/java/org/apache/commons/math4/distribution/WeibullDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/WeibullDistribution.java @@ -329,16 +329,6 @@ public class WeibullDistribution extends AbstractRealDistribution { return Double.POSITIVE_INFINITY; } - /** {@inheritDoc} */ - public boolean isSupportLowerBoundInclusive() { - return true; - } - - /** {@inheritDoc} */ - public boolean isSupportUpperBoundInclusive() { - return false; - } - /** * {@inheritDoc} * diff --git a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java index af8aed3e6..9a0204594 100644 --- a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java +++ b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java @@ -161,24 +161,6 @@ public class EnumeratedRealDistributionTest { Assert.assertEquals(7, testDistribution.getSupportUpperBound(), 0); } - /** - * Tests if the distribution returns properly that the support includes the - * lower bound. - */ - @Test - public void testIsSupportLowerBoundInclusive() { - Assert.assertTrue(testDistribution.isSupportLowerBoundInclusive()); - } - - /** - * Tests if the distribution returns properly that the support includes the - * upper bound. - */ - @Test - public void testIsSupportUpperBoundInclusive() { - Assert.assertTrue(testDistribution.isSupportUpperBoundInclusive()); - } - /** * Tests if the distribution returns properly that the support is connected. */ diff --git a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java index 5d1af10d4..e6907bdbd 100644 --- a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java +++ b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java @@ -384,38 +384,6 @@ public abstract class RealDistributionAbstractTest { } } - /** - * Verify that isSupportLowerBoundInclusvie returns true iff the lower bound - * is finite and density is non-NaN, non-infinite there. - */ - @Test - public void testIsSupportLowerBoundInclusive() { - final double lowerBound = distribution.getSupportLowerBound(); - double result = Double.NaN; - result = distribution.density(lowerBound); - Assert.assertEquals( - !Double.isInfinite(lowerBound) && !Double.isNaN(result) && - !Double.isInfinite(result), - distribution.isSupportLowerBoundInclusive()); - - } - - /** - * Verify that isSupportUpperBoundInclusvie returns true iff the upper bound - * is finite and density is non-NaN, non-infinite there. - */ - @Test - public void testIsSupportUpperBoundInclusive() { - final double upperBound = distribution.getSupportUpperBound(); - double result = Double.NaN; - result = distribution.density(upperBound); - Assert.assertEquals( - !Double.isInfinite(upperBound) && !Double.isNaN(result) && - !Double.isInfinite(result), - distribution.isSupportUpperBoundInclusive()); - - } - @Test public void testDistributionClone() throws IOException,