commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1042596 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math: analysis/solvers/ distribution/
Date Mon, 06 Dec 2010 11:56:26 GMT
Author: erans
Date: Mon Dec  6 11:56:26 2010
New Revision: 1042596

URL: http://svn.apache.org/viewvc?rev=1042596&view=rev
Log:
MATH-452
Made all static variables (accuracies) "private".

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseAbstractUnivariateRealSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/LaguerreSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver2.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/NewtonSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/RiddersSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/SecantSolver.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseAbstractUnivariateRealSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseAbstractUnivariateRealSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseAbstractUnivariateRealSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseAbstractUnivariateRealSolver.java
Mon Dec  6 11:56:26 2010
@@ -34,12 +34,10 @@ import org.apache.commons.math.analysis.
  */
 public abstract class BaseAbstractUnivariateRealSolver<FUNC extends UnivariateRealFunction>
     implements BaseUnivariateRealSolver<FUNC> {
-    /** Default absolute accuracy */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
     /** Default relative accuracy. */
-    public static final double DEFAULT_RELATIVE_ACCURACY = 1e-14;
+    private static final double DEFAULT_RELATIVE_ACCURACY = 1e-14;
     /** Default function value accuracy. */
-    public static final double DEFAULT_FUNCTION_VALUE_ACCURACY = 1e-15;
+    private static final double DEFAULT_FUNCTION_VALUE_ACCURACY = 1e-15;
     /** Function value accuracy. */
     private final double functionValueAccuracy;
     /** Absolute accuracy. */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
Mon Dec  6 11:56:26 2010
@@ -28,10 +28,10 @@ import org.apache.commons.math.util.Fast
  */
 public class BisectionSolver extends AbstractUnivariateRealSolver {
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
 
     /**
-     * Construct a solver with default accuracy.
+     * Construct a solver with default accuracy (1e-6).
      */
     public BisectionSolver() {
         this(DEFAULT_ABSOLUTE_ACCURACY);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
Mon Dec  6 11:56:26 2010
@@ -37,10 +37,10 @@ public class BrentSolver extends Abstrac
     /** Serializable version identifier */
     private static final long serialVersionUID = 7694577816772532779L;
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
 
     /**
-     * Construct a solver with default accuracies.
+     * Construct a solver with default accuracy (1e-6).
      */
     public BrentSolver() {
         this(DEFAULT_ABSOLUTE_ACCURACY);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/LaguerreSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/LaguerreSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/LaguerreSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/LaguerreSolver.java
Mon Dec  6 11:56:26 2010
@@ -40,12 +40,12 @@ import org.apache.commons.math.util.Fast
  */
 public class LaguerreSolver extends AbstractPolynomialSolver {
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
     /** Complex solver. */
     protected ComplexSolver complexSolver = new ComplexSolver();
 
     /**
-     * Construct a solver with default accuracies.
+     * Construct a solver with default accuracy (1e-6).
      */
     public LaguerreSolver() {
         this(DEFAULT_ABSOLUTE_ACCURACY);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver.java
Mon Dec  6 11:56:26 2010
@@ -49,10 +49,10 @@ public class MullerSolver extends Abstra
     /** Serializable version identifier */
     private static final long serialVersionUID = 7694577816772532779L;
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
 
     /**
-     * Construct a solver with default accuracies.
+     * Construct a solver with default accuracy (1e-6).
      */
     public MullerSolver() {
         this(DEFAULT_ABSOLUTE_ACCURACY);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver2.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver2.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver2.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/MullerSolver2.java
Mon Dec  6 11:56:26 2010
@@ -49,10 +49,10 @@ public class MullerSolver2 extends Abstr
     /** Serializable version identifier */
     private static final long serialVersionUID = 7694577816772532779L;
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
 
     /**
-     * Construct a solver with default accuracies.
+     * Construct a solver with default accuracy (1e-6).
      */
     public MullerSolver2() {
         this(DEFAULT_ABSOLUTE_ACCURACY);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/NewtonSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/NewtonSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/NewtonSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/NewtonSolver.java
Mon Dec  6 11:56:26 2010
@@ -30,7 +30,7 @@ import org.apache.commons.math.util.Fast
  */
 public class NewtonSolver extends AbstractDifferentiableUnivariateRealSolver {
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
 
     /**
      * Construct a solver.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/RiddersSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/RiddersSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/RiddersSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/RiddersSolver.java
Mon Dec  6 11:56:26 2010
@@ -33,10 +33,10 @@ import org.apache.commons.math.util.Math
  */
 public class RiddersSolver extends AbstractUnivariateRealSolver {
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
 
     /**
-     * Construct a solver with default accuracy.
+     * Construct a solver with default accuracy (1e-6).
      */
     public RiddersSolver() {
         this(DEFAULT_ABSOLUTE_ACCURACY);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/SecantSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/SecantSolver.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/SecantSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/SecantSolver.java
Mon Dec  6 11:56:26 2010
@@ -38,10 +38,10 @@ import org.apache.commons.math.util.Fast
  */
 public class SecantSolver extends AbstractUnivariateRealSolver {
     /** Default absolute accuracy. */
-    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
+    private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
 
     /**
-     * Construct a solver with default accuracy.
+     * Construct a solver with default accuracy (1e-6).
      */
     public SecantSolver() {
         this(DEFAULT_ABSOLUTE_ACCURACY);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java?rev=1042596&r1=1042595&r2=1042596&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
Mon Dec  6 11:56:26 2010
@@ -42,16 +42,18 @@ public abstract class AbstractContinuous
     implements ContinuousDistribution, Serializable {
     /** Serializable version identifier */
     private static final long serialVersionUID = -38038050983108802L;
+    /** Default accuracy. */
+    public static final double SOLVER_DEFAULT_ABSOLUTE_ACCURACY = 1e-6;
     /**
      * RandomData instance used to generate samples from the distribution
      * @since 2.2
      */
     protected final RandomDataImpl randomData = new RandomDataImpl();
     /**
-     * Solver absolute accuracy for inverse cumulative computation
+     * Solver absolute accuracy for inverse cumulative computation.
      * @since 2.1
      */
-    private double solverAbsoluteAccuracy = BrentSolver.DEFAULT_ABSOLUTE_ACCURACY;
+    private double solverAbsoluteAccuracy = SOLVER_DEFAULT_ABSOLUTE_ACCURACY;
     /**
      * Default constructor.
      */
@@ -125,7 +127,7 @@ public abstract class AbstractContinuous
         // find root
         double root = UnivariateRealSolverUtils.solve(rootFindingFunction,
                 // override getSolverAbsoluteAccuracy() to use a Brent solver with
-                // absolute accuracy different from BrentSolver default
+                // absolute accuracy different from the default.
                 bracket[0],bracket[1], getSolverAbsoluteAccuracy());
         return root;
     }
@@ -209,6 +211,8 @@ public abstract class AbstractContinuous
 
     /**
      * Returns the solver absolute accuracy for inverse cumulative computation.
+     * You can override this method in order to use a Brent solver with an
+     * absolute accuracy different from the default.
      *
      * @return the maximum absolute error in inverse cumulative probability estimates
      * @since 2.1
@@ -216,5 +220,4 @@ public abstract class AbstractContinuous
     protected double getSolverAbsoluteAccuracy() {
         return solverAbsoluteAccuracy;
     }
-
 }



Mime
View raw message