commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: [math] cvs commit: jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate/moment Variance.java
Date Sun, 11 Jul 2004 22:50:49 GMT
Phil,

I wanted to point out there is a "test(...)" method in the
AbstractUnivariateStatistic class for validation of the input, this 
provides three test conditions for the incoming array and its 
starting/ending indicies. Most of the UnivariateStatistics reuse this 
for consistent validation. I'd recommend using it here:

> +    public double evaluate(final double[] values, final double mean) {
> +        if (values == null) { 
> +            throw new IllegalArgumentException("input values array  is null");
> +        } 
> +        return evaluate(values, mean, 0, values.length); 
> +    }

Heres a reference to it in the xref:

http://jakarta.apache.org/commons/math/xref/org/apache/commons/math/stat/univariate/AbstractUnivariateStatistic.html#54

and an example where I've used it:

http://jakarta.apache.org/commons/math/xref/org/apache/commons/math/stat/univariate/rank/Percentile.html#121


-Mark

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu

---------------------------------------------------------------------
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