commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/java/org/apache/commons/math/stat Frequency.java
Date Sun, 22 Feb 2004 22:01:30 GMT
psteitz     2004/02/22 14:01:30

  Modified:    math/src/java/org/apache/commons/math/analysis
                        PolynomialFunction.java SecantSolver.java
                        UnivariateRealSolverFactory.java
                        UnivariateRealSolverFactoryImpl.java
               math/src/java/org/apache/commons/math/stat Frequency.java
  Log:
  javadoc.
  
  Revision  Changes    Path
  1.7       +1 -5      jakarta-commons/math/src/java/org/apache/commons/math/analysis/PolynomialFunction.java
  
  Index: PolynomialFunction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/analysis/PolynomialFunction.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PolynomialFunction.java	20 Feb 2004 06:17:54 -0000	1.6
  +++ PolynomialFunction.java	22 Feb 2004 22:01:29 -0000	1.7
  @@ -19,10 +19,6 @@
   
   import java.io.Serializable;
   
  -import java.util.Arrays;
  -
  -import org.apache.commons.math.MathException;
  -
   /**
    * Represents a polynomial function with real coefficients.
    * 
  
  
  
  1.13      +12 -8     jakarta-commons/math/src/java/org/apache/commons/math/analysis/SecantSolver.java
  
  Index: SecantSolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/analysis/SecantSolver.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SecantSolver.java	18 Feb 2004 03:24:19 -0000	1.12
  +++ SecantSolver.java	22 Feb 2004 22:01:29 -0000	1.13
  @@ -22,11 +22,15 @@
   import org.apache.commons.math.MathException;
   
   /**
  - * Provide the secant algorithm for solving for zeros of real univariate
  - * functions. Because of forced bracketing, convergence is slower than
  - * the unrestricted secant algorithm. However, slow convergence of the
  - * Regula Falsi can be avoided.
  - * It will only search for one zero in the given interval.
  + * Implements a modified version of the 
  + * <a href="http://mathworld.wolfram.com/SecantMethod.html">secant method</a>
  + * for approximating a zero of a real univariate function.  
  + * <p>
  + * The algorithm is modified to maintain bracketing of a root by subsequent approximations.

  + * Because of forced bracketing, convergence may be slower than the unrestricted secant
algorithm. 
  + * However, this implementation  should in general outperform the 
  + * <a href="http://mathworld.wolfram.com/MethodofFalsePosition.html">regula falsi
method.</a>
  + * <p>
    * The function is supposed to be continuous but not necessarily smooth.
    *  
    * @version $Revision$ $Date$
  @@ -41,7 +45,7 @@
       }
   
       /**
  -     * Solve for a zero in the given interval.
  +     * Find a zero in the given interval.
        * @param min the lower bound for the interval.
        * @param max the upper bound for the interval.
        * @param initial the start value to use (ignored).
  @@ -56,7 +60,7 @@
       }
       
       /**
  -     * Solve for a zero root in the given interval.
  +     * Find a zero in the given interval.
        * @param min the lower bound for the interval.
        * @param max the upper bound for the interval.
        * @return the value where the function is zero
  
  
  
  1.13      +24 -8     jakarta-commons/math/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactory.java
  
  Index: UnivariateRealSolverFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactory.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- UnivariateRealSolverFactory.java	21 Feb 2004 21:35:14 -0000	1.12
  +++ UnivariateRealSolverFactory.java	22 Feb 2004 22:01:29 -0000	1.13
  @@ -18,13 +18,29 @@
   import org.apache.commons.discovery.tools.DiscoverClass;
   
   /**
  - * A factory to easily get a default solver and some convenience
  - * functions.
  - * Because solvers are easily reusable, the factory does not
  - * store configuration data and creates preconfigured solvers
  - * (this may be controversial, because the configuration data
  - * may also be used for the default solver used by the static
  - * solve() method). 
  + * Abstract factory class used to create {@link UnivariateRealSolver} instances.
  + * <p>
  + * Solvers implementing the following algorithms are supported:
  + * <ul>
  + * <li>Bisection</li>
  + * <li>Brent's method</li>
  + * <li>Secant method</li>
  + * </ul>
  + * Concrete factories extending this class also specify a default solver, instances of
which
  + * are returned by <code>newDefaultSolver()</code>.
  + * <p>
  + * Common usage:<pre>
  + * SolverFactory factory = UnivariateRealSolverFactory.newInstance();
  + * 
  + * // create a Brent solver to use with a UnivariateRealFunction f
  + * BrentSolver solver = factory.newBrentSolver(f);
  + * </pre>
  + * 
  + * <a href="http://jakarta.apache.org/commons/discovery/">Jakarta Commons Discovery</a>
  + * is used to determine the concrete factory returned by 
  + * <code>UnivariateRealSolverFactory.newInstance().</code>  The default is
  + * {@link UnivariateRealSolverFactoryImpl}.
  + * 
    * @version $Revision$ $Date$
    */
   public abstract class UnivariateRealSolverFactory {
  
  
  
  1.10      +6 -8      jakarta-commons/math/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImpl.java
  
  Index: UnivariateRealSolverFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- UnivariateRealSolverFactoryImpl.java	21 Feb 2004 21:35:14 -0000	1.9
  +++ UnivariateRealSolverFactoryImpl.java	22 Feb 2004 22:01:29 -0000	1.10
  @@ -19,13 +19,11 @@
   
   
   /**
  - * A factory to easily get a default solver and some convenience
  - * functions.
  - * Because solvers are easily reusable, the factory does not
  - * store configuration data and creates preconfigured solvers
  - * (this may be controversial, because the configuration data
  - * may also be used for the default solver used by the static
  - * solve() method). 
  + * A concrete {@link  UnivariateRealSolverFactory}.  This is the default solver factory
  + * used by commons-math.
  + * <p>
  + * The default solver returned by this factory is a {@link BrentSolver}.
  + * 
    * @version $Revision$ $Date$
    */
   public class UnivariateRealSolverFactoryImpl
  
  
  
  1.16      +9 -5      jakarta-commons/math/src/java/org/apache/commons/math/stat/Frequency.java
  
  Index: Frequency.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/stat/Frequency.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Frequency.java	21 Feb 2004 21:35:15 -0000	1.15
  +++ Frequency.java	22 Feb 2004 22:01:29 -0000	1.16
  @@ -200,7 +200,8 @@
       //-------------------------------------------------------------
   
       /**
  -     * Returns the percentage of values = v (as a proportion -- i.e. between 0 and 1).
  +      * Returns the cumulative percentatge of values less than or equal to v
  +     * (as a proportion between 0 and 1).
        * @param v the value to lookup.
        * @return the proportion of values equal to v
        */
  @@ -209,7 +210,8 @@
       }
       
       /**
  -     * Returns the percentage of values = v (as a proportion -- i.e. between 0 and 1).
  +      * Returns the cumulative percentatge of values less than or equal to v
  +     * (as a proportion between 0 and 1).
        * @param v the value to lookup.
        * @return the proportion of values equal to v
        */
  @@ -218,7 +220,8 @@
       }
       
       /**
  -     * Returns the percentage of values = v (as a proportion -- i.e. between 0 and 1).
  +      * Returns the cumulative percentatge of values less than or equal to v
  +     * (as a proportion between 0 and 1).
        * @param v the value to lookup.
        * @return the proportion of values equal to v
        */
  @@ -227,7 +230,8 @@
       }
       
       /**
  -     * Returns the percentage of values = v (as a proportion -- i.e. between 0 and 1).
  +     * Returns the cumulative percentatge of values less than or equal to v
  +     * (as a proportion between 0 and 1).
        * @param v the value to lookup.
        * @return the proportion of values equal to v
        */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message