Author: erans
Date: Sat Aug  4 19:24:56 2012
New Revision: 1369415

URL: http://svn.apache.org/viewvc?rev=1369415&view=rev
Log:
MATH-839
Created new method "probability(double,double)" in implementations were
it it overridden, and deprecated "cumulativeProbability(double,double)".

Modified:
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/LogNormalDistribution.java
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/NormalDistribution.java

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/LogNormalDistribution.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/LogNormalDistribution.java?rev=1369415&r1=1369414&r2=1369415&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/LogNormalDistribution.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/LogNormalDistribution.java
 Sat Aug  4 19:24:56 2012
@@ -201,16 +201,28 @@ public class LogNormalDistribution exten
         return 0.5 + 0.5 * Erf.erf(dev / (shape * SQRT2));
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * @deprecated See {@link 
RealDistribution#cumulativeProbability(double,double)}
+     */
+    @Override@Deprecated
+    public double cumulativeProbability(double x0, double x1)
+        throws NumberIsTooLargeException {
+        return probability(x0, x1);
+    }
+
     /** {@inheritDoc} */
     @Override
-    public double cumulativeProbability(double x0, double x1)
+    public double probability(double x0,
+                              double x1)
         throws NumberIsTooLargeException {
         if (x0 > x1) {
             throw new 
NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT,
                                                 x0, x1, true);
         }
         if (x0 <= 0 || x1 <= 0) {
-            return super.cumulativeProbability(x0, x1);
+            return super.probability(x0, x1);
         }
         final double denom = shape * SQRT2;
         final double v0 = (FastMath.log(x0) - scale) / denom;

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/NormalDistribution.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/NormalDistribution.java?rev=1369415&r1=1369414&r2=1369415&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/NormalDistribution.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/NormalDistribution.java
 Sat Aug  4 19:24:56 2012
@@ -152,9 +152,21 @@ public class NormalDistribution extends 
         return 0.5 * (1 + Erf.erf(dev / (standardDeviation * SQRT2)));
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * @deprecated See {@link 
RealDistribution#cumulativeProbability(double,double)}
+     */
+    @Override@Deprecated
+    public double cumulativeProbability(double x0, double x1)
+        throws NumberIsTooLargeException {
+        return probability(x0, x1);
+    }
+
     /** {@inheritDoc} */
     @Override
-    public double cumulativeProbability(double x0, double x1)
+    public double probability(double x0,
+                              double x1)
         throws NumberIsTooLargeException {
         if (x0 > x1) {
             throw new 
NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT,


Reply via email to