From 609917a77cd495b8955122c9bbf2b5858168579f Mon Sep 17 00:00:00 2001 From: Joerg Pietschmann Date: Fri, 26 Sep 2003 19:30:33 +0000 Subject: [PATCH] Fixed JavaDoc warnings. Fixed a few TODOs in the interpolation code. Updated project TODO list. Promoted myself to "developer". git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140998 13f79535-47bb-0310-9956-ffa450edef68 --- project.xml | 12 ++-- .../math/analysis/SplineInterpolator.java | 63 ++++++++++--------- .../AbstractDiscreteDistribution.java | 6 +- .../distribution/GammaDistributionImpl.java | 11 ++-- .../math/stat/AbstractStoreUnivariate.java | 4 +- .../commons/math/stat/AbstractUnivariate.java | 8 +-- .../apache/commons/math/stat/Applyable.java | 56 +++++++++++++++-- .../math/stat/BeanListUnivariateImpl.java | 4 +- .../commons/math/stat/ListUnivariateImpl.java | 12 ++-- .../math/stat/StoreUnivariateImpl.java | 14 ++--- .../commons/math/stat/UnivariateImpl.java | 4 +- .../math/util/ContractableDoubleArray.java | 6 +- .../math/util/ExpandableDoubleArray.java | 4 +- .../commons/math/util/FixedDoubleArray.java | 14 ++--- .../commons/math/random/RandomDataTest.java | 4 +- xdocs/tasks.xml | 7 ++- 16 files changed, 140 insertions(+), 89 deletions(-) diff --git a/project.xml b/project.xml index c2264de38..6149153ca 100644 --- a/project.xml +++ b/project.xml @@ -1,5 +1,5 @@ - + ../../jakarta-commons/project.xml Math @@ -36,6 +36,12 @@ mdiggory mdiggory@apache.org + + J.Pietschmann + pietsch + pietsch@apache.org + j3322ptm@yahoo.de + @@ -54,10 +60,6 @@ Albert Davidson Chou hotfusionman@yahoo.com - - J.Pietschmann - j3322ptm@yahoo.de - diff --git a/src/java/org/apache/commons/math/analysis/SplineInterpolator.java b/src/java/org/apache/commons/math/analysis/SplineInterpolator.java index 00d73e158..ec0241547 100644 --- a/src/java/org/apache/commons/math/analysis/SplineInterpolator.java +++ b/src/java/org/apache/commons/math/analysis/SplineInterpolator.java @@ -56,7 +56,7 @@ package org.apache.commons.math.analysis; /** * Computes a natural spline interpolation for the data set. * - * @version $Revision: 1.4 $ $Date: 2003/09/07 03:12:56 $ + * @version $Revision: 1.5 $ $Date: 2003/09/26 19:30:32 $ * */ public class SplineInterpolator implements UnivariateRealInterpolator { @@ -71,8 +71,7 @@ public class SplineInterpolator implements UnivariateRealInterpolator { */ public UnivariateRealFunction interpolate(double[] xval, double[] yval) { if (xval.length != yval.length) { - throw new IllegalArgumentException( - "Dataset arrays must have same length."); + throw new IllegalArgumentException("Dataset arrays must have same length."); } if (c == null) { @@ -82,8 +81,7 @@ public class SplineInterpolator implements UnivariateRealInterpolator { // Separation should be checked too (not implemented: which criteria?). for (int i = 0; i < n; i++) { if (xval[i] >= xval[i + 1]) { - throw new IllegalArgumentException( - "Dataset must specify sorted, ascending x values."); + throw new IllegalArgumentException("Dataset must specify sorted, ascending x values."); } } // Vectors for the equation system. There are n-1 equations for the unknowns s[i] (1<=i<=N-1), @@ -95,36 +93,39 @@ public class SplineInterpolator implements UnivariateRealInterpolator { // ... // l[N-4]*s[N-3]+d[N-3]*s[N-2]+u[N-3]*s[N-1] = b[N-3] // l[N-3]*s[N-2]+d[N-2]*s[N-1] = b[N-2] - // Vector b is the right hand side of the system. + // Vector b is the right hand side (RHS) of the system. double b[] = new double[n - 1]; // Vector d is diagonal of the matrix and also holds the computed solution. double d[] = new double[n - 1]; - // u[] and l[] are not really needed, the computation can be folded into the - // system solving loops. - //double u[] = new double[n - 2]; // upper diagonal - //double l[] = new double[n - 2]; // lower diagonal - // Setup RHS and diagonal. + // Setup right hand side and diagonal. + double dquot = (yval[1] - yval[0]) / (xval[1] - xval[0]); for (int i = 0; i < n - 1; i++) { // TODO avoid recomputing the term // (yval[i + 2] - yval[i + 1]) / (xval[i + 2] - xval[i + 1]) // take it from the previous loop pass. Note: the interesting part of performance // loss is the range check in the array access, not the computation itself. - b[i] = 6.0 * ((yval[i + 2] - yval[i + 1]) / (xval[i + 2] - - xval[i + 1]) - (yval[i + 1] - yval[i]) / (xval[i + 1] - - xval[i])); + double dquotNext = + (yval[i + 2] - yval[i + 1]) / (xval[i + 2] - xval[i + 1]); + b[i] = 6.0 * (dquotNext - dquot); d[i] = 2.0 * (xval[i + 2] - xval[i]); + dquot = dquotNext; } + // u[] and l[] (for the upper and lower diagonal respectively) are not + // really needed, the computation is folded into the system solving loops. + // Keep this for documentation purposes: + //double u[] = new double[n - 2]; // upper diagonal + //double l[] = new double[n - 2]; // lower diagonal // Set up upper and lower diagonal. Keep the offsets in mind. //for (int i = 0; i < n - 2; i++) { - //u[i] = xval[i + 2] - xval[i + 1]; - //l[i] = xval[i + 2] - xval[i + 1]; + // u[i] = xval[i + 2] - xval[i + 1]; + // l[i] = xval[i + 2] - xval[i + 1]; //} // Solve the system: forward pass. for (int i = 0; i < n - 2; i++) { - // TODO: This relies on compiler for CSE of delta/d[i]. Is this a reasonable assumption? double delta = xval[i + 2] - xval[i + 1]; - d[i + 1] -= delta * delta / d[i]; - b[i + 1] -= b[i] * delta / d[i]; + double deltaquot = delta / d[i]; + d[i + 1] -= delta * deltaquot; + b[i + 1] -= b[i] * deltaquot; } // Solve the system: backward pass. d[n - 2] = b[n - 2] / d[n - 2]; @@ -134,23 +135,23 @@ public class SplineInterpolator implements UnivariateRealInterpolator { // Compute coefficients as usual polynomial coefficients. // Not the best with respect to roundoff on evaluation, but simple. c = new double[n][4]; - c[0][3] = d[0] / (xval[1] - xval[0]) / 6.0; + double delta = xval[1] - xval[0]; + c[0][3] = d[0] / delta / 6.0; c[0][2] = 0.0; - c[0][1] = (yval[1] - yval[0]) / (xval[1] - xval[0]) - d[0] * - (xval[1] - xval[0]) / 6.0; + c[0][1] = (yval[1] - yval[0]) / delta - d[0] * delta / 6.0; for (int i = 1; i < n - 2; i++) { - // TODO: This relies on compiler for CSE of xval[i + 1] - xval[i]. Is this a reasonable assumption? - c[i][3] = (d[i] - d[i - 1]) / (xval[i + 1] - xval[i]) / 6.0; + delta = xval[i + 1] - xval[i]; + c[i][3] = (d[i] - d[i - 1]) / delta / 6.0; c[i][2] = d[i - 1] / 2.0; - c[i][1] = (yval[i + 1] - yval[i]) / (xval[i + 1] - xval[i]) - - d[i] * (xval[i + 1] - xval[i]) / 6.0 - d[i - 1] * - (xval[i + 1] - xval[i]) / 3.0; + c[i][1] = + (yval[i + 1] - yval[i]) / delta + - (d[i] / 2.0 - d[i - 1]) * delta / 3.0; } - // TODO: again, CSE aspects. - c[n - 1][3] = -d[n - 2] / (xval[n] - xval[n - 1]) / 6.0; + delta = (xval[n] - xval[n - 1]); + c[n - 1][3] = -d[n - 2] / delta / 6.0; c[n - 1][2] = d[n - 2] / 2.0; - c[n - 1][1] = (yval[n] - yval[n - 1]) / (xval[n] - xval[n - 1]) - - d[n - 2] * (xval[n] - xval[n - 1]) / 3.0; + c[n - 1][1] = + (yval[n] - yval[n - 1]) / delta - d[n - 2] * delta / 3.0; for (int i = 0; i < n; i++) { c[i][0] = yval[i]; } diff --git a/src/java/org/apache/commons/math/distribution/AbstractDiscreteDistribution.java b/src/java/org/apache/commons/math/distribution/AbstractDiscreteDistribution.java index 491b1c3b5..9b2187fd8 100644 --- a/src/java/org/apache/commons/math/distribution/AbstractDiscreteDistribution.java +++ b/src/java/org/apache/commons/math/distribution/AbstractDiscreteDistribution.java @@ -59,7 +59,7 @@ package org.apache.commons.math.stat.distribution; * implementations for some of the methods that do not vary from distribution * to distribution. * - * @version $Revision: 1.1 $ $Date: 2003/08/16 17:06:15 $ + * @version $Revision: 1.2 $ $Date: 2003/09/26 19:30:33 $ */ public abstract class AbstractDiscreteDistribution implements DiscreteDistribution { @@ -139,7 +139,7 @@ public abstract class AbstractDiscreteDistribution /** * Access the domain value lower bound, based on p, used to * bracket a PDF root. This method is used by - * {@link #inverseCummulativeProbability(int)} to find critical values. + * {@link #inverseCummulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return domain value lower bound, i.e. @@ -150,7 +150,7 @@ public abstract class AbstractDiscreteDistribution /** * Access the domain value upper bound, based on p, used to * bracket a PDF root. This method is used by - * {@link #inverseCummulativeProbability(int)} to find critical values. + * {@link #inverseCummulativeProbability(double)} to find critical values. * * @param p the desired probability for the critical value * @return domain value upper bound, i.e. diff --git a/src/java/org/apache/commons/math/distribution/GammaDistributionImpl.java b/src/java/org/apache/commons/math/distribution/GammaDistributionImpl.java index fdf416585..3f7a94240 100644 --- a/src/java/org/apache/commons/math/distribution/GammaDistributionImpl.java +++ b/src/java/org/apache/commons/math/distribution/GammaDistributionImpl.java @@ -58,7 +58,7 @@ import org.apache.commons.math.special.Gamma; /** * The default implementation of {@link GammaDistribution} * - * @version $Revision: 1.6 $ $Date: 2003/09/17 19:29:28 $ + * @version $Revision: 1.7 $ $Date: 2003/09/26 19:30:33 $ */ public class GammaDistributionImpl extends AbstractContinuousDistribution implements GammaDistribution { @@ -153,7 +153,7 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution * @param p the desired probability for the critical value * @return domain value lower bound, i.e. * P(X < lower bound) < p - * @todo try to improve on this estimate + * TODO: try to improve on this estimate */ protected double getDomainLowerBound(double p) { return Double.MIN_VALUE; @@ -167,7 +167,7 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution * @param p the desired probability for the critical value * @return domain value upper bound, i.e. * P(X < upper bound) > p - * @todo try to improve on this estimate + * TODO: try to improve on this estimate */ protected double getDomainUpperBound(double p) { // NOTE: gamma is skewed to the left @@ -193,11 +193,10 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution * * @param p the desired probability for the critical value * @return initial domain value - * @todo try to improve on this estimate + * TODO: try to improve on this estimate */ protected double getInitialDomain(double p) { - // NOTE: gamma is skewed to the left - // NOTE: therefore, P(X < μ) > .5 + // Gamma is skewed to the left, therefore, P(X < μ) > .5 double ret; diff --git a/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java b/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java index 7e2776069..6310e3dc9 100644 --- a/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java +++ b/src/java/org/apache/commons/math/stat/AbstractStoreUnivariate.java @@ -59,7 +59,7 @@ import org.apache.commons.math.stat.univariate.rank.Percentile; /** * Provides univariate measures for an array of doubles. - * @version $Revision: 1.10 $ $Date: 2003/07/15 03:45:10 $ + * @version $Revision: 1.11 $ $Date: 2003/09/26 19:30:32 $ */ public abstract class AbstractStoreUnivariate extends AbstractUnivariate @@ -92,7 +92,7 @@ public abstract class AbstractStoreUnivariate } /** - * @see org.apache.commons.math.stat2.AbstractStoreUnivariate#getSortedValues() + * @see org.apache.commons.math.stat.StoreUnivariate#getSortedValues() */ public double[] getSortedValues() { double[] sort = getValues(); diff --git a/src/java/org/apache/commons/math/stat/AbstractUnivariate.java b/src/java/org/apache/commons/math/stat/AbstractUnivariate.java index 014dbb4ab..e63f86897 100644 --- a/src/java/org/apache/commons/math/stat/AbstractUnivariate.java +++ b/src/java/org/apache/commons/math/stat/AbstractUnivariate.java @@ -68,7 +68,7 @@ import org.apache.commons.math.stat.univariate.summary.SumOfSquares; /** * Provides univariate measures for an array of doubles. - * @version $Revision: 1.2 $ $Date: 2003/07/15 03:45:10 $ + * @version $Revision: 1.3 $ $Date: 2003/09/26 19:30:32 $ */ public abstract class AbstractUnivariate implements Univariate { @@ -294,7 +294,7 @@ public abstract class AbstractUnivariate implements Univariate { } /** - * @see org.apache.commons.math.Univariate#clear() + * @see org.apache.commons.math.stat.Univariate#clear() */ public void clear() { this.n = 0; @@ -313,14 +313,14 @@ public abstract class AbstractUnivariate implements Univariate { } /** - * @see org.apache.commons.math.Univariate#getWindowSize() + * @see org.apache.commons.math.stat.Univariate#getWindowSize() */ public int getWindowSize() { return windowSize; } /** - * @see org.apache.commons.math.Univariate#setWindowSize(int) + * @see org.apache.commons.math.stat.Univariate#setWindowSize(int) */ public void setWindowSize(int windowSize) { clear(); diff --git a/src/java/org/apache/commons/math/stat/Applyable.java b/src/java/org/apache/commons/math/stat/Applyable.java index fd9414ddd..1aca5361a 100644 --- a/src/java/org/apache/commons/math/stat/Applyable.java +++ b/src/java/org/apache/commons/math/stat/Applyable.java @@ -1,6 +1,55 @@ -/* - * Created on Jul 15, 2003 +/* ==================================================================== + * The Apache Software License, Version 1.1 * + * Copyright (c) 2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package org.apache.commons.math.stat; @@ -9,8 +58,7 @@ import org.apache.commons.math.stat.univariate.UnivariateStatistic; /** * Applyable.java * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments + * TODO: add javadocs * */ public interface Applyable { diff --git a/src/java/org/apache/commons/math/stat/BeanListUnivariateImpl.java b/src/java/org/apache/commons/math/stat/BeanListUnivariateImpl.java index 916258638..11263915c 100644 --- a/src/java/org/apache/commons/math/stat/BeanListUnivariateImpl.java +++ b/src/java/org/apache/commons/math/stat/BeanListUnivariateImpl.java @@ -62,7 +62,7 @@ import org.apache.commons.math.util.BeanTransformer; * univariate statistics for a List of Java Beans by property. This * implementation uses beanutils' PropertyUtils to get a simple, nested, * indexed, mapped, or combined property from an element of a List. - * @version $Revision: 1.5 $ $Date: 2003/09/07 03:12:56 $ + * @version $Revision: 1.6 $ $Date: 2003/09/26 19:30:32 $ */ public class BeanListUnivariateImpl extends ListUnivariateImpl { @@ -109,7 +109,7 @@ public class BeanListUnivariateImpl extends ListUnivariateImpl { } /** - * @see org.apache.commons.math.Univariate#addValue(double) + * @see org.apache.commons.math.stat.Univariate#addValue(double) */ public void addValue(double v) { String msg = diff --git a/src/java/org/apache/commons/math/stat/ListUnivariateImpl.java b/src/java/org/apache/commons/math/stat/ListUnivariateImpl.java index 4870f258f..0cbc71752 100644 --- a/src/java/org/apache/commons/math/stat/ListUnivariateImpl.java +++ b/src/java/org/apache/commons/math/stat/ListUnivariateImpl.java @@ -60,7 +60,7 @@ import org.apache.commons.math.util.DefaultTransformer; import org.apache.commons.math.util.NumberTransformer; /** - * @version $Revision: 1.5 $ $Date: 2003/09/07 03:12:56 $ + * @version $Revision: 1.6 $ $Date: 2003/09/26 19:30:32 $ */ public class ListUnivariateImpl extends AbstractStoreUnivariate @@ -97,7 +97,7 @@ public class ListUnivariateImpl } /** - * @see org.apache.commons.math.StoreUnivariate#getValues() + * @see org.apache.commons.math.stat.StoreUnivariate#getValues() */ public double[] getValues() { @@ -124,7 +124,7 @@ public class ListUnivariateImpl } /** - * @see org.apache.commons.math.StoreUnivariate#getElement(int) + * @see org.apache.commons.math.stat.StoreUnivariate#getElement(int) */ public double getElement(int index) { @@ -148,7 +148,7 @@ public class ListUnivariateImpl } /** - * @see org.apache.commons.math.Univariate#getN() + * @see org.apache.commons.math.stat.Univariate#getN() */ public int getN() { int n = 0; @@ -166,7 +166,7 @@ public class ListUnivariateImpl } /** - * @see org.apache.commons.math.Univariate#addValue(double) + * @see org.apache.commons.math.stat.Univariate#addValue(double) */ public void addValue(double v) { list.add(new Double(v)); @@ -181,7 +181,7 @@ public class ListUnivariateImpl } /** - * @see org.apache.commons.math.Univariate#clear() + * @see org.apache.commons.math.stat.Univariate#clear() */ public void clear() { super.clear(); diff --git a/src/java/org/apache/commons/math/stat/StoreUnivariateImpl.java b/src/java/org/apache/commons/math/stat/StoreUnivariateImpl.java index 8c0439371..e74269b23 100644 --- a/src/java/org/apache/commons/math/stat/StoreUnivariateImpl.java +++ b/src/java/org/apache/commons/math/stat/StoreUnivariateImpl.java @@ -57,7 +57,7 @@ import org.apache.commons.math.stat.univariate.UnivariateStatistic; import org.apache.commons.math.util.ContractableDoubleArray; /** - * @version $Revision: 1.6 $ $Date: 2003/09/07 03:12:56 $ + * @version $Revision: 1.7 $ $Date: 2003/09/26 19:30:32 $ */ public class StoreUnivariateImpl extends AbstractStoreUnivariate { @@ -74,7 +74,7 @@ public class StoreUnivariateImpl extends AbstractStoreUnivariate { } /** - * @see org.apache.commons.math.StoreUnivariate#getValues() + * @see org.apache.commons.math.stat.StoreUnivariate#getValues() */ public double[] getValues() { @@ -89,21 +89,21 @@ public class StoreUnivariateImpl extends AbstractStoreUnivariate { } /** - * @see org.apache.commons.math.StoreUnivariate#getElement(int) + * @see org.apache.commons.math.stat.StoreUnivariate#getElement(int) */ public double getElement(int index) { return eDA.getElement(index); } /** - * @see org.apache.commons.math.Univariate#getN() + * @see org.apache.commons.math.stat.Univariate#getN() */ public int getN() { return eDA.getNumElements(); } /** - * @see org.apache.commons.math.Univariate#addValue(double) + * @see org.apache.commons.math.stat.Univariate#addValue(double) */ public synchronized void addValue(double v) { if (windowSize != Univariate.INFINITE_WINDOW) { @@ -123,7 +123,7 @@ public class StoreUnivariateImpl extends AbstractStoreUnivariate { } /** - * @see org.apache.commons.math.Univariate#clear() + * @see org.apache.commons.math.stat.Univariate#clear() */ public synchronized void clear() { super.clear(); @@ -131,7 +131,7 @@ public class StoreUnivariateImpl extends AbstractStoreUnivariate { } /** - * @see org.apache.commons.math.Univariate#setWindowSize(int) + * @see org.apache.commons.math.stat.Univariate#setWindowSize(int) */ public synchronized void setWindowSize(int windowSize) { this.windowSize = windowSize; diff --git a/src/java/org/apache/commons/math/stat/UnivariateImpl.java b/src/java/org/apache/commons/math/stat/UnivariateImpl.java index 28e16595f..7ea0df94a 100644 --- a/src/java/org/apache/commons/math/stat/UnivariateImpl.java +++ b/src/java/org/apache/commons/math/stat/UnivariateImpl.java @@ -67,7 +67,7 @@ import org.apache.commons.math.util.FixedDoubleArray; * Integers, floats and longs can be added, but they will be converted * to doubles by addValue(). * - * @version $Revision: 1.19 $ $Date: 2003/07/15 03:45:10 $ + * @version $Revision: 1.20 $ $Date: 2003/09/26 19:30:32 $ */ public class UnivariateImpl extends AbstractUnivariate @@ -152,7 +152,7 @@ public class UnivariateImpl } /** - * @see org.apache.commons.math.Univariate#clear() + * @see org.apache.commons.math.stat.Univariate#clear() */ public void clear() { super.clear(); diff --git a/src/java/org/apache/commons/math/util/ContractableDoubleArray.java b/src/java/org/apache/commons/math/util/ContractableDoubleArray.java index 35dcb2275..5519b1a17 100644 --- a/src/java/org/apache/commons/math/util/ContractableDoubleArray.java +++ b/src/java/org/apache/commons/math/util/ContractableDoubleArray.java @@ -88,7 +88,7 @@ import java.io.Serializable; * internal storage array is swapped. *

* - * @version $Revision: 1.4 $ $Date: 2003/09/07 03:12:56 $ + * @version $Revision: 1.5 $ $Date: 2003/09/26 19:30:33 $ */ public class ContractableDoubleArray extends ExpandableDoubleArray @@ -246,7 +246,7 @@ public class ContractableDoubleArray * must validate the combination of expansionFactor and * contractionCriteria. * - * @see org.apache.commons.math.ExpandableDoubleArray#setExpansionFactor(float) + * @see org.apache.commons.math.util.ExpandableDoubleArray#setExpansionFactor(float) */ public void setExpansionFactor(float expansionFactor) { checkContractExpand(getContractionCriteria(), expansionFactor); @@ -318,7 +318,7 @@ public class ContractableDoubleArray } /** - * @see org.apache.commons.math.ExpandableDoubleArray#discardFrontElements(int) + * @see org.apache.commons.math.util.ExpandableDoubleArray#discardFrontElements(int) */ public synchronized void discardFrontElements(int i) { super.discardFrontElements(i); diff --git a/src/java/org/apache/commons/math/util/ExpandableDoubleArray.java b/src/java/org/apache/commons/math/util/ExpandableDoubleArray.java index 57a0cecfa..8c0ef8427 100644 --- a/src/java/org/apache/commons/math/util/ExpandableDoubleArray.java +++ b/src/java/org/apache/commons/math/util/ExpandableDoubleArray.java @@ -88,7 +88,7 @@ import java.io.Serializable; * expand the array 10 times - first from 2 -> 4. then 4 -> 8, 8 -> 16, * and so on until we reach 4096 which is sufficient to hold 3546 elements. *

- * @version $Revision: 1.5 $ $Date: 2003/09/07 03:12:56 $ + * @version $Revision: 1.6 $ $Date: 2003/09/26 19:30:33 $ */ public class ExpandableDoubleArray implements Serializable, DoubleArray { @@ -415,7 +415,7 @@ public class ExpandableDoubleArray implements Serializable, DoubleArray { } /** - * @see org.apache.commons.math.DoubleArray#getElements() + * @see org.apache.commons.math.util.DoubleArray#getElements() */ public double[] getElements() { double[] elementArray = new double[numElements]; diff --git a/src/java/org/apache/commons/math/util/FixedDoubleArray.java b/src/java/org/apache/commons/math/util/FixedDoubleArray.java index 3010ec9e2..5a569e10f 100644 --- a/src/java/org/apache/commons/math/util/FixedDoubleArray.java +++ b/src/java/org/apache/commons/math/util/FixedDoubleArray.java @@ -82,7 +82,7 @@ package org.apache.commons.math.util; * "fixed" in memory, this implementation will never allocate, or copy * the internal storage array to a new array instance. *

- * @version $Revision: 1.6 $ $Date: 2003/09/07 03:12:56 $ + * @version $Revision: 1.7 $ $Date: 2003/09/26 19:30:33 $ */ public class FixedDoubleArray implements DoubleArray { @@ -144,7 +144,7 @@ public class FixedDoubleArray implements DoubleArray { /** * Retrieves the current size of the array. - * @see org.apache.commons.math.DoubleArray#getNumElements() + * @see org.apache.commons.math.util.DoubleArray#getNumElements() */ public int getNumElements() { return size; @@ -159,7 +159,7 @@ public class FixedDoubleArray implements DoubleArray { * 2 - trying to retrieve an element outside of the current element * array will throw an ArrayIndexOutOfBoundsException. * - * @see org.apache.commons.math.DoubleArray#getElement(int) + * @see org.apache.commons.math.util.DoubleArray#getElement(int) */ public double getElement(int index) { if (index > (size - 1)) { @@ -198,7 +198,7 @@ public class FixedDoubleArray implements DoubleArray { * *

* - * @see org.apache.commons.math.DoubleArray#setElement(int, double) + * @see org.apache.commons.math.util.DoubleArray#setElement(int, double) */ public void setElement(int index, double value) { if (index > (size - 1)) { @@ -215,7 +215,7 @@ public class FixedDoubleArray implements DoubleArray { * this array has already met or exceeded the maximum number * of elements * - * @see org.apache.commons.math.DoubleArray#addElement(double) + * @see org.apache.commons.math.util.DoubleArray#addElement(double) */ public void addElement(double value) { if (size < internalArray.length) { @@ -305,7 +305,7 @@ public class FixedDoubleArray implements DoubleArray { * * @return The array of elements added to this DoubleArray * implementation. - * @see org.apache.commons.math.DoubleArray#getElements() + * @see org.apache.commons.math.util.DoubleArray#getElements() */ public double[] getElements() { double[] copy = new double[size]; @@ -336,7 +336,7 @@ public class FixedDoubleArray implements DoubleArray { * setting the size of the array back to zero, and reinitializing * the internal storage array. * - * @see org.apache.commons.math.DoubleArray#clear() + * @see org.apache.commons.math.util.DoubleArray#clear() */ public void clear() { size = 0; diff --git a/src/test/org/apache/commons/math/random/RandomDataTest.java b/src/test/org/apache/commons/math/random/RandomDataTest.java index d9846ef4f..0264b9ce3 100644 --- a/src/test/org/apache/commons/math/random/RandomDataTest.java +++ b/src/test/org/apache/commons/math/random/RandomDataTest.java @@ -14,7 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the - * distribution. + * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: @@ -68,7 +68,7 @@ import org.apache.commons.math.stat.UnivariateImpl; /** * Test cases for the RandomData class. * - * @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:21 $ + * @version $Revision: 1.3 $ $Date: 2003/09/26 19:30:33 $ */ public final class RandomDataTest extends TestCase { diff --git a/xdocs/tasks.xml b/xdocs/tasks.xml index a753d980d..cf272fe34 100644 --- a/xdocs/tasks.xml +++ b/xdocs/tasks.xml @@ -1,5 +1,5 @@ - + Tasks: Done And To Do @@ -40,8 +40,7 @@
Analysis.
    -
  • Framework and implementation strategie(s) for finding roots or real-valued functions of one (real) variable.
  • -
  • Cubic spline interpolation.
  • +
  • Rework unit tests for root finding and spline interpolation.
  • CheckStyle with modified properties still shows many errors. Try to clean these up.
@@ -62,6 +61,8 @@
    +
  • Framework and implementation strategie(s) for finding roots or real-valued functions of one (real) variable. Implemented algorithms: Brent-Dekker, secant, simple bisection.
  • +
  • Cubic spline interpolation.
  • Bivariate Regression, correlation.
  • Sampling from Collections
  • Add higher order moments to Univariate implementations.