You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ce...@apache.org on 2012/01/28 09:50:10 UTC
svn commit: r1237026 -
/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TriangularDistribution.java
Author: celestin
Date: Sat Jan 28 08:50:09 2012
New Revision: 1237026
URL: http://svn.apache.org/viewvc?rev=1237026&view=rev
Log:
In TriangularDistribution, changed the value of the solver absolute accuracy, and updated Javadoc accordingly (MATH-731).
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TriangularDistribution.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TriangularDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TriangularDistribution.java?rev=1237026&r1=1237025&r2=1237026&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TriangularDistribution.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TriangularDistribution.java Sat Jan 28 08:50:09 2012
@@ -77,7 +77,7 @@ public class TriangularDistribution exte
this.a = a;
this.c = c;
this.b = b;
- solverAbsoluteAccuracy = FastMath.ulp(c);
+ solverAbsoluteAccuracy = FastMath.max(FastMath.ulp(a), FastMath.ulp(b));
}
/**
@@ -89,7 +89,19 @@ public class TriangularDistribution exte
return c;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ *
+ * <p>
+ * For this distribution, the returned value is not really meaningful,
+ * since exact formulas are implemented for the computation of the
+ * {@link #inverseCumulativeProbability(double)} (no solver is invoked).
+ * </p>
+ * <p>
+ * For lower limit {@code a} and upper limit {@code b}, the current
+ * implementation returns {@code max(ulp(a), ulp(b)}.
+ * </p>
+ */
@Override
protected double getSolverAbsoluteAccuracy() {
return solverAbsoluteAccuracy;