Modified: commons/proper/math/trunk/src/site/xdoc/userguide/analysis.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/analysis.xml?rev=735449&r1=735448&r2=735449&view=diff ============================================================================== --- commons/proper/math/trunk/src/site/xdoc/userguide/analysis.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/userguide/analysis.xml Sun Jan 18 05:07:22 2009 @@ -27,34 +27,36 @@ <section name="4 Numerical Analysis"> <subsection name="4.1 Overview" href="overview"> <p> - The analysis package provides numerical root-finding and interpolation - implementations for real-valued functions of one real variable. + The analysis package is the parent package for algorithms dealing with + real-valued functions of one real variable. It contains dedicated sub-packages + providing numerical root-finding, integration, and interpolation. It also + contains a polynomials sub-package that considers polynomials with real + coefficients as differentiable real functions. </p> <p> - Possible future additions may include numerical differentiation, - integration and optimization. + Possible future additions may include numerical differentiation. </p> </subsection> <subsection name="4.2 Root-finding" href="rootfinding"> <p> - A <a href="../apidocs/org/apache/commons/math/analysis/UnivariateRealSolver.html"> - org.apache.commons.math.analysis.UnivariateRealSolver.</a> - provides the means to find roots of univariate real-valued functions. + A <a href="../apidocs/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.html"> + org.apache.commons.math.analysis.solvers.UnivariateRealSolver.</a> + provides the means to find roots of <a href="../apidocs/org/apache/commons/math/analysis/UnivariateRealFunction.html">univariate real-valued functions</a>. A root is the value where the function takes the value 0. Commons-Math includes implementations of the following root-finding algorithms: <ul> - <li><a href="../apidocs/org/apache/commons/math/analysis/BisectionSolver.html"> + <li><a href="../apidocs/org/apache/commons/math/analysis/solvers/BisectionSolver.html"> Bisection</a></li> - <li><a href="../apidocs/org/apache/commons/math/analysis/BrentSolver.html"> + <li><a href="../apidocs/org/apache/commons/math/analysis/solvers/BrentSolver.html"> Brent-Dekker</a></li> - <li><a href="../apidocs/org/apache/commons/math/analysis/NewtonSolver.html"> + <li><a href="../apidocs/org/apache/commons/math/analysis/solvers/NewtonSolver.html"> Newton's Method</a></li> - <li><a href="../apidocs/org/apache/commons/math/analysis/SecantSolver.html"> + <li><a href="../apidocs/org/apache/commons/math/analysis/solvers/SecantSolver.html"> Secant Method</a></li> - <li><a href="../apidocs/org/apache/commons/math/analysis/MullerSolver.html"> + <li><a href="../apidocs/org/apache/commons/math/analysis/solvers/MullerSolver.html"> Muller's Method</a></li> - <li><a href="../apidocs/org/apache/commons/math/analysis/LaguerreSolver.html"> + <li><a href="../apidocs/org/apache/commons/math/analysis/solvers/LaguerreSolver.html"> Laguerre's Method</a></li> - <li><a href="../apidocs/org/apache/commons/math/analysis/RidderSolver.html"> + <li><a href="../apidocs/org/apache/commons/math/analysis/solvers/RidderSolver.html"> Ridder's Method</a></li> </ul> </p> @@ -84,7 +86,7 @@ <p> In order to use the root-finding features, first a solver object must be created. It is encouraged that all solver object creation occurs - via the <code>org.apache.commons.math.analysis.UnivariateRealSolverFactory</code> + via the <code>org.apache.commons.math.analysis.solvers.UnivariateRealSolverFactory</code> class. <code>UnivariateRealSolverFactory</code> is a simple factory used to create all of the solver objects supported by Commons-Math. The typical usage of <code>UnivariateRealSolverFactory</code> @@ -237,26 +239,31 @@ </subsection> <subsection name="4.3 Interpolation" href="interpolation"> <p> - A <a href="../apidocs/org/apache/commons/math/analysis/UnivariateRealInterpolator.html"> - org.apache.commons.math.analysis.UnivariateRealInterpolator</a> + A <a href="../apidocs/org/apache/commons/math/analysis/interpolation/UnivariateRealInterpolator.html"> + org.apache.commons.math.analysis.interpolation.UnivariateRealInterpolator</a> is used to find a univariate real-valued function <code>f</code> which for a given set of ordered pairs (<code>x<sub>i</sub></code>,<code>y<sub>i</sub></code>) yields - <code>f(x<sub>i</sub>)=y<sub>i</sub></code> to the best accuracy possible. - Currently, only an interpolator for generating natural cubic splines is available. There is - no interpolator factory, mainly because the interpolation algorithm is more determined - by the kind of the interpolated function rather than the set of points to interpolate. + <code>f(x<sub>i</sub>)=y<sub>i</sub></code> to the best accuracy possible. The result + is provided as an object implementing the <a + href="../apidocs/org/apache/commons/math/analysis/UnivariateRealFunction.html"> + org.apache.commons.math.analysis.UnivariateRealFunction</a> interface. It can therefore + be evaluated at any point, including point not belonging to the original set. + Currently, only an interpolator for generating natural cubic splines and a polynomial + interpolator are available. There is no interpolator factory, mainly because the + interpolation algorithm is more determined by the kind of the interpolated function + rather than the set of points to interpolate. There aren't currently any accuracy controls either, as interpolation accuracy is in general determined by the algorithm. </p> <p>Typical usage:</p> - <source>double x[]={ 0.0, 1.0, 2.0 }; -double y[]={ 1.0, -1.0, 2.0); -UnivariateRealInterpolator interpolator = SplineInterpolator(); -UnivariateRealFunction function = interpolator.interpolate(); -double x=0.5; -double y=function.evaluate(x); -System.out println("f("+x+")="+y);</source> + <source>double x[] = { 0.0, 1.0, 2.0 }; +double y[] = { 1.0, -1.0, 2.0); +UnivariateRealInterpolator interpolator = new SplineInterpolator(); +UnivariateRealFunction function = interpolator.interpolate(x, y); +double interpolationX = 0.5; +double interpolatedY = function.evaluate(x); +System.out println("f(" + interpolationX + ") = " + interpolatedY);</source> <p> A natural cubic spline is a function consisting of a polynomial of third degree for each subinterval determined by the x-coordinates of the @@ -268,6 +275,40 @@ evaluate the function for values outside the range <code>x<sub>0</sub></code>..<code>x<sub>N</sub></code>. </p> + <p> + The polynomial function returned by the Neville's algorithm is a single + polynomial guaranteed to pass exactly through the interpolation points. + The degree of the polynomial is the number of points minus 1 (i.e. the + interpolation polynomial for a three points set will be a quadratic + polynomial). Despite the fact the interpolating polynomials is a perfect + approximation of a function at interpolation points, it may be a loose + approximation between the points. Due to <a + href="http://en.wikipedia.org/wiki/Runge's_phenomenon">Runge's phenomenom</a> + the error can get worse as the degree of the polynomial increases, so + adding more points does not always lead to a better interpolation. + </p> + </subsection> + <subsection name="4.4 Integration" href="integration"> + <p> + A <a href="../apidocs/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.html"> + org.apache.commons.math.analysis.integration.UnivariateRealIntegrator.</a> + provides the means to numerically integrate <a href="../apidocs/org/apache/commons/math/analysis/UnivariateRealFunction.html">univariate real-valued functions</a>. + Commons-Math includes implementations of the following integration algorithms: <ul> + <li><a href="../apidocs/org/apache/commons/math/analysis/integration/RombergIntegrator.html"> + Romberg's method</a></li> + <li><a href="../apidocs/org/apache/commons/math/analysis/integration/SimpsonIntegrator.html"> + Simpson's</a></li> + <li><a href="../apidocs/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.html"> + trapezoid method</a></li> + </ul> + </p> + </subsection> + <subsection name="4.5 Polynomials" href="polynomials"> + <p> + The <a href="../apidocs/org/apache/commons/math/analysis/polynomials/package.html"> + org.apache.commons.math.analysis.polynomials</a> package provides real coefficients + polynomials. + </p> </subsection> </section> </body>
Modified: commons/proper/math/trunk/src/site/xdoc/userguide/index.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/index.xml?rev=735449&r1=735448&r2=735449&view=diff ============================================================================== --- commons/proper/math/trunk/src/site/xdoc/userguide/index.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/userguide/index.xml Sun Jan 18 05:07:22 2009 @@ -60,12 +60,15 @@ <li><a href="linear.html#3.2 Real matrices">3.2 Real matrices</a></li> <li><a href="linear.html#3.3 Real vectors">3.3 Real vectors</a></li> <li><a href="linear.html#3.4 Solving linear systems">3.4 Solving linear systems</a></li> + <li><a href="linear.html#3.5 Eigenvalues/eigenvectors and singular values/singular vectors">3.5 Eigenvalues/eigenvectors and singular values/singular vectors</a></li> </ul></li> <li><a href="analysis.html">4. Numerical Analysis</a> <ul> <li><a href="analysis.html#4.1 Overview">4.1 Overview</a></li> <li><a href="analysis.html#4.2 Root-finding">4.2 Root-finding</a></li> <li><a href="analysis.html#4.3 Interpolation">4.3 Interpolation</a></li> + <li><a href="analysis.html#4.4 Integration">4.4 Integration</a></li> + <li><a href="analysis.html#4.5 Polynomials">4.5 Polynomials</a></li> </ul></li> <li><a href="special.html">5. Special Functions</a> <ul> @@ -78,8 +81,9 @@ <ul> <li><a href="utilities.html#6.1 Overview">6.1 Overview</a></li> <li><a href="utilities.html#6.2 Double array utilities">6.2 Double array utilities</a></li> - <li><a href="utilities.html#6.3 Continued Fractions">6.3 Continued Fractions</a></li> - <li><a href="utilities.html#6.4 binomial coefficients, factorials and other common math functions">6.4 binomial coefficients, factorials and other common math functions</a></li> + <li><a href="utilities.html#6.3 int/double hash map">6.3 int/double hash map</a></li> + <li><a href="utilities.html#6.4 Continued Fractions">6.4 Continued Fractions</a></li> + <li><a href="utilities.html#6.5 binomial coefficients, factorials and other common math functions">6.5 binomial coefficients, factorials and other common math functions</a></li> </ul></li> <li><a href="complex.html">7. Complex Numbers</a> <ul> Modified: commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml?rev=735449&r1=735448&r2=735449&view=diff ============================================================================== --- commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml Sun Jan 18 05:07:22 2009 @@ -74,7 +74,7 @@ Commons Math is divided into fourteen subpackages, based on functionality provided. <ol> <li><a href="stat.html">org.apache.commons.math.stat</a> - statistics, statistical tests</li> - <li><a href="analysis.html">org.apache.commons.math.analysis</a> - rootfinding and interpolation</li> + <li><a href="analysis.html">org.apache.commons.math.analysis</a> - rootfinding, integration, interpolation, polynomials</li> <li><a href="random.html">org.apache.commons.math.random</a> - random numbers, strings and data generation</li> <li><a href="special.html">org.apache.commons.math.special</a> - special functions (Gamma, Beta) </li> <li><a href="linear.html">org.apache.commons.math.linear</a> - matrices, solving linear systems </li>
