Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1DCD398B8 for ; Tue, 6 Dec 2011 02:58:11 +0000 (UTC) Received: (qmail 58321 invoked by uid 500); 6 Dec 2011 02:58:10 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 58215 invoked by uid 500); 6 Dec 2011 02:58:10 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 58207 invoked by uid 99); 6 Dec 2011 02:58:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 02:58:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 02:58:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F0F4B23889B8 for ; Tue, 6 Dec 2011 02:57:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1210756 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution: BetaDistribution.java ChiSquaredDistribution.java FDistribution.java GammaDistribution.java NormalDistribution.java TDistribution.java Date: Tue, 06 Dec 2011 02:57:46 -0000 To: commits@commons.apache.org From: celestin@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111206025746.F0F4B23889B8@eris.apache.org> Author: celestin Date: Tue Dec 6 02:57:46 2011 New Revision: 1210756 URL: http://svn.apache.org/viewvc?rev=1210756&view=rev Log: In distribution.AbstractRealDistribution.inverseCumulativeProbability(double), boundary cases (p == 0 and p == 1) are now handled correctly: concrete instances no longer need to override this method, which is removed (MATH-699). Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java Tue Dec 6 02:57:46 2011 @@ -134,18 +134,6 @@ public class BetaDistribution extends Ab } /** {@inheritDoc} */ - @Override - public double inverseCumulativeProbability(double p) { - if (p == 0) { - return 0; - } else if (p == 1) { - return 1; - } else { - return super.inverseCumulativeProbability(p); - } - } - - /** {@inheritDoc} */ public double cumulativeProbability(double x) { if (x <= 0) { return 0; Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java Tue Dec 6 02:57:46 2011 @@ -91,23 +91,6 @@ public class ChiSquaredDistribution exte return gamma.cumulativeProbability(x); } - /** - * {@inheritDoc} - * - * Returns {@code 0} when {@code p == 0} and - * {@code Double.POSITIVE_INFINITY} when {@code p == 1}. - */ - @Override - public double inverseCumulativeProbability(final double p) { - if (p == 0) { - return 0d; - } - if (p == 1) { - return Double.POSITIVE_INFINITY; - } - return super.inverseCumulativeProbability(p); - } - /** {@inheritDoc} */ @Override protected double getSolverAbsoluteAccuracy() { Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java Tue Dec 6 02:57:46 2011 @@ -18,7 +18,6 @@ package org.apache.commons.math.distribution; import org.apache.commons.math.exception.NotStrictlyPositiveException; -import org.apache.commons.math.exception.OutOfRangeException; import org.apache.commons.math.exception.util.LocalizedFormats; import org.apache.commons.math.special.Beta; import org.apache.commons.math.util.FastMath; @@ -156,23 +155,6 @@ public class FDistribution extends Abstr } /** - * {@inheritDoc} - * - * Returns {@code 0} when {@code p == 0} and - * {@code Double.POSITIVE_INFINITY} when {@code p == 1}. - */ - @Override - public double inverseCumulativeProbability(final double p) throws OutOfRangeException { - if (p == 0) { - return 0; - } - if (p == 1) { - return Double.POSITIVE_INFINITY; - } - return super.inverseCumulativeProbability(p); - } - - /** * Access the numerator degrees of freedom. * * @return the numerator degrees of freedom. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java Tue Dec 6 02:57:46 2011 @@ -144,23 +144,6 @@ public class GammaDistribution extends A return ret; } - /** - * {@inheritDoc} - * - * Returns {@code 0} when {@code p == 0} and - * {@code Double.POSITIVE_INFINITY} when {@code p == 1}. - */ - @Override - public double inverseCumulativeProbability(final double p) { - if (p == 0) { - return 0; - } - if (p == 1) { - return Double.POSITIVE_INFINITY; - } - return super.inverseCumulativeProbability(p); - } - /** {@inheritDoc} */ @Override protected double getSolverAbsoluteAccuracy() { Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java Tue Dec 6 02:57:46 2011 @@ -155,23 +155,6 @@ public class NormalDistribution extends return 0.5 * Erf.erf(v0, v1); } - /** - * {@inheritDoc} - * - * Returns {@code Double.NEGATIVE_INFINITY} when {@code p == 0} - * and {@code Double.POSITIVE_INFINITY} for {@code p == 1}. - */ - @Override - public double inverseCumulativeProbability(final double p) { - if (p == 0) { - return Double.NEGATIVE_INFINITY; - } - if (p == 1) { - return Double.POSITIVE_INFINITY; - } - return super.inverseCumulativeProbability(p); - } - /** {@inheritDoc} */ @Override protected double getSolverAbsoluteAccuracy() { Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java Tue Dec 6 02:57:46 2011 @@ -126,23 +126,6 @@ public class TDistribution extends Abstr return ret; } - /** - * {@inheritDoc} - * - * Returns {@code Double.NEGATIVE_INFINITY} when {@code p = 0} - * and {@code Double.POSITIVE_INFINITY} when {@code p = 1}. - */ - @Override - public double inverseCumulativeProbability(final double p) { - if (p == 0) { - return Double.NEGATIVE_INFINITY; - } - if (p == 1) { - return Double.POSITIVE_INFINITY; - } - return super.inverseCumulativeProbability(p); - } - /** {@inheritDoc} */ @Override protected double getSolverAbsoluteAccuracy() {