commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1179928 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math: analysis/ analysis/function/ analysis/interpolation/ analysis/polynomials/ optimization/direct/ optimization/fitting/
Date Fri, 07 Oct 2011 03:20:40 GMT
Author: psteitz
Date: Fri Oct  7 03:20:39 2011
New Revision: 1179928

URL: http://svn.apache.org/viewvc?rev=1179928&view=rev
Log:
Javadoc fixes.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/FunctionUtils.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/ParametricUnivariateRealFunction.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Cbrt.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/HarmonicOscillator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Sinc.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/LoessInterpolator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/UnivariateRealPeriodicInterpolator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunction.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/GaussianFitter.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/FunctionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/FunctionUtils.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/FunctionUtils.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/FunctionUtils.java
Fri Oct  7 03:20:39 2011
@@ -32,10 +32,12 @@ public class FunctionUtils {
     private FunctionUtils() {}
 
     /**
-     * Compose functions.
+     * Compose functions.  The functions in the argument list are composed
+     * sequentially, in the order given.  For example, compose(f1,f2,f3)
+     * acts like f1(f2(f3(x))).
      *
      * @param f List of functions.
-     * @return the composed function.
+     * @return the composite function.
      */
     public static UnivariateRealFunction compose(final UnivariateRealFunction ... f) {
         return new UnivariateRealFunction() {
@@ -54,7 +56,7 @@ public class FunctionUtils {
      * Add functions.
      *
      * @param f List of functions.
-     * @return a function that computes the addition of the functions.
+     * @return a function that computes the sum of the functions.
      */
     public static UnivariateRealFunction add(final UnivariateRealFunction ... f) {
         return new UnivariateRealFunction() {
@@ -73,7 +75,7 @@ public class FunctionUtils {
      * Multiply functions.
      *
      * @param f List of functions.
-     * @return a function that computes the multiplication of the functions.
+     * @return a function that computes the product of the functions.
      */
     public static UnivariateRealFunction multiply(final UnivariateRealFunction ... f) {
         return new UnivariateRealFunction() {
@@ -89,12 +91,13 @@ public class FunctionUtils {
     }
 
     /**
-     * Combine functions.
+     * Returns the univariate function <br/>
+     * {@code h(x) = combiner(f(x), g(x))}.
      *
      * @param combiner Combiner function.
      * @param f Function.
      * @param g Function.
-     * @return the composed function.
+     * @return the composite function.
      */
     public static UnivariateRealFunction combine(final BivariateRealFunction combiner,
                                                  final UnivariateRealFunction f,
@@ -108,7 +111,9 @@ public class FunctionUtils {
     }
 
     /**
-     * Generate a collector function.
+     * Returns a MultivariateRealFunction h(x[]) defined by <pre> <code>
+     * h(x[]) = combiner(...combiner(combiner(initialValue,f(x[0])),f(x[1]))...),f(x[x.length-1]))
+     * </code></pre>
      *
      * @param combiner Combiner function.
      * @param f Function.
@@ -131,7 +136,9 @@ public class FunctionUtils {
     }
 
     /**
-     * Generate a collector function.
+     * Returns a MultivariateRealFunction h(x[]) defined by <pre> <code>
+     * h(x[]) = combiner(...combiner(combiner(initialValue,x[0]),x[1])...),x[x.length-1])
+     * </code></pre>
      *
      * @param combiner Combiner function.
      * @param initialValue Initial value.
@@ -147,7 +154,7 @@ public class FunctionUtils {
      *
      * @param f Binary function.
      * @param fixed Value to which the first argument of {@code f} is set.
-     * @return a unary function.
+     * @return the unary function h(x) = f(fixed, x)
      */
     public static UnivariateRealFunction fix1stArgument(final BivariateRealFunction f,
                                                         final double fixed) {
@@ -163,7 +170,7 @@ public class FunctionUtils {
      *
      * @param f Binary function.
      * @param fixed Value to which the second argument of {@code f} is set.
-     * @return a unary function.
+     * @return the unary function h(x) = f(x, fixed)
      */
     public static UnivariateRealFunction fix2ndArgument(final BivariateRealFunction f,
                                                         final double fixed) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/ParametricUnivariateRealFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/ParametricUnivariateRealFunction.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/ParametricUnivariateRealFunction.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/ParametricUnivariateRealFunction.java
Fri Oct  7 03:20:39 2011
@@ -21,6 +21,7 @@ package org.apache.commons.math.analysis
  * An interface representing a real function that depends on one independent
  * variable plus some extra parameters.
  *
+ * @since 3.0
  * @version $Id$
  */
 public interface ParametricUnivariateRealFunction {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Cbrt.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Cbrt.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Cbrt.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Cbrt.java
Fri Oct  7 03:20:39 2011
@@ -21,7 +21,7 @@ import org.apache.commons.math.analysis.
 import org.apache.commons.math.util.FastMath;
 
 /**
- * Cubic-root function.
+ * Cube root function.
  *
  * @version $Id$
  * @since 3.0

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/HarmonicOscillator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/HarmonicOscillator.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/HarmonicOscillator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/HarmonicOscillator.java
Fri Oct  7 03:20:39 2011
@@ -34,7 +34,7 @@ import org.apache.commons.math.util.Fast
 public class HarmonicOscillator implements DifferentiableUnivariateRealFunction {
     /** Amplitude. */
     private final double amplitude;
-    /** Angular requency. */
+    /** Angular frequency. */
     private final double omega;
     /** Phase. */
     private final double phase;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Sinc.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Sinc.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Sinc.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Sinc.java
Fri Oct  7 03:20:39 2011
@@ -21,7 +21,11 @@ import org.apache.commons.math.analysis.
 import org.apache.commons.math.util.FastMath;
 
 /**
- * Sinc function.
+ * Sinc function, defined by <pre><code>
+ *
+ * sinc(x) = 1 if abs(x) < 1e-9;
+ *           sin(x) / x; otherwise
+ * </code></pre>
  *
  * @version $Id$
  * @since 3.0

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolator.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolator.java
Fri Oct  7 03:20:39 2011
@@ -22,7 +22,7 @@ import org.apache.commons.math.analysis.
 
 /**
  * Implements the <a href="
- * "http://mathworld.wolfram.com/NewtonsDividedDifferenceInterpolationFormula.html">
+ * http://mathworld.wolfram.com/NewtonsDividedDifferenceInterpolationFormula.html">
  * Divided Difference Algorithm</a> for interpolation of real univariate
  * functions. For reference, see <b>Introduction to Numerical Analysis</b>,
  * ISBN 038795452X, chapter 2.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/LoessInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/LoessInterpolator.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/LoessInterpolator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/LoessInterpolator.java
Fri Oct  7 03:20:39 2011
@@ -40,7 +40,7 @@ import org.apache.commons.math.util.Math
  * Scatterplots</a>
  * <p/>
  * This class implements both the loess method and serves as an interpolation
- * adapter to it, allowing to build a spline on the obtained loess fit.
+ * adapter to it, allowing one to build a spline on the obtained loess fit.
  *
  * @version $Id$
  * @since 2.0

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolator.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolator.java
Fri Oct  7 03:20:39 2011
@@ -26,7 +26,7 @@ import org.apache.commons.math.analysis.
  * reference, see <b>Introduction to Numerical Analysis</b>, ISBN 038795452X,
  * chapter 2.
  * <p>
- * The actual code of Neville's evalution is in PolynomialFunctionLagrangeForm,
+ * The actual code of Neville's algorithm is in PolynomialFunctionLagrangeForm,
  * this class provides an easy-to-use interface to it.</p>
  *
  * @version $Id$

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/UnivariateRealPeriodicInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/UnivariateRealPeriodicInterpolator.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/UnivariateRealPeriodicInterpolator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/UnivariateRealPeriodicInterpolator.java
Fri Oct  7 03:20:39 2011
@@ -21,7 +21,7 @@ import org.apache.commons.math.util.Math
 import org.apache.commons.math.exception.NumberIsTooSmallException;
 
 /**
- * Adapter for class implementing the {@link UnivariateRealInterpolator}
+ * Adapter for classes implementing the {@link UnivariateRealInterpolator}
  * interface.
  * The data to be interpolated is assumed to be periodic. Thus values that are
  * outside of the range can be passed to the interpolation function: They will

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunction.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunction.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunction.java
Fri Oct  7 03:20:39 2011
@@ -366,6 +366,8 @@ public class PolynomialFunction implemen
 
     /**
      * Dedicated parametric polynomial class.
+     *
+     * @since 3.0
      */
     public static class Parametric implements ParametricUnivariateRealFunction {
         /** {@inheritDoc} */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
Fri Oct  7 03:20:39 2011
@@ -352,7 +352,7 @@ public class BOBYQAOptimizer
      * @return
      */
     private double bobyqb(
-            ArrayRealVector xbase, 
+            ArrayRealVector xbase,
             Array2DRowRealMatrix xpt,
             ArrayRealVector fval,
             ArrayRealVector xopt,
@@ -831,7 +831,7 @@ public class BOBYQAOptimizer
             }
 
             f = computeObjectiveValue(currentBest.toArray());
-            
+
             if (!isMinimize)
                 f = -f;
             if (ntrits == -1) {
@@ -1740,7 +1740,7 @@ public class BOBYQAOptimizer
                     currentBest.setEntry(j, upperBound[j]);
                 }
             }
-            
+
             final double objectiveValue = computeObjectiveValue(currentBest.toArray());
             final double f = isMinimize ? objectiveValue : -objectiveValue;
             final int numEval = getEvaluations(); // nfm + 1
@@ -1901,7 +1901,7 @@ public class BOBYQAOptimizer
         double ds;
         int iu;
         double dhd, dhs, cth, shs, sth, ssq, beta=0, sdec, blen;
-        int iact = -1; 
+        int iact = -1;
         int nact = 0;
         double angt = 0, qred;
         int isav;
@@ -2329,7 +2329,7 @@ public class BOBYQAOptimizer
                 if (pq.getEntry(k) != ZERO) {
                     for (int i = 0; i < n; i++) {
                         hs.setEntry(i, hs.getEntry(i) + tmp.getEntry(k) * xpt.getEntry(k,
i));
-                    } 
+                    }
                 }
             }
             if (crvmin != ZERO) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
Fri Oct  7 03:20:39 2011
@@ -139,6 +139,7 @@ public class CurveFitter {
      * if the number of allowed evaluations is exceeded.
      * @throws org.apache.commons.math.exception.DimensionMismatchException
      * if the start point dimension is wrong.
+     * @since 3.0
      */
     public double[] fit(int maxEval, final ParametricUnivariateRealFunction f,
                         final double[] initialGuess) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/GaussianFitter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/GaussianFitter.java?rev=1179928&r1=1179927&r2=1179928&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/GaussianFitter.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/GaussianFitter.java
Fri Oct  7 03:20:39 2011
@@ -79,6 +79,7 @@ public class GaussianFitter extends Curv
      * </ul>
      * @return the parameters of the Gaussian function that best fits the
      * observed points (in the same order as above).
+     * @since 3.0
      */
     public double[] fit(double[] initialGuess) {
         final ParametricUnivariateRealFunction f = new ParametricUnivariateRealFunction()
{



Mime
View raw message