Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 5315 invoked from network); 17 Jan 2011 23:01:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jan 2011 23:01:20 -0000 Received: (qmail 64998 invoked by uid 500); 17 Jan 2011 23:01:20 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 64928 invoked by uid 500); 17 Jan 2011 23:01:19 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 64921 invoked by uid 99); 17 Jan 2011 23:01:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jan 2011 23:01:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jan 2011 23:01:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DBA1F2388A77; Mon, 17 Jan 2011 23:00:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1060124 - /commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java Date: Mon, 17 Jan 2011 23:00:52 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110117230052.DBA1F2388A77@eris.apache.org> Author: sebb Date: Mon Jan 17 23:00:52 2011 New Revision: 1060124 URL: http://svn.apache.org/viewvc?rev=1060124&view=rev Log: Tab and trailing space removal Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java?rev=1060124&r1=1060123&r2=1060124&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java Mon Jan 17 23:00:52 2011 @@ -423,46 +423,46 @@ public final class StatUtilsTest extends } - /** - * Run the test with the values 50 and 100 and assume standardized values - */ - - public void testNormalize1() { - double sample[] = { 50, 100 }; - double expectedSample[] = { -25 / Math.sqrt(1250), 25 / Math.sqrt(1250) }; - double[] out = StatUtils.normalize(sample); - for (int i = 0; i < out.length; i++) { - assertEquals(out[i], expectedSample[i]); - } - - } - - /** - * Run with 77 random values, assuming that the outcome has a mean of 0 and a standard deviation of 1 with a - * precision of 1E-10. - */ - - public void testNormalize2() { - // create an sample with 77 values - int length = 77; - double sample[] = new double[length]; - for (int i = 0; i < length; i++) { - sample[i] = Math.random(); - } - // normalize this sample - double standardizedSample[] = StatUtils.normalize(sample); - - DescriptiveStatistics stats = new DescriptiveStatistics(); - // Add the data from the array - for (int i = 0; i < length; i++) { - stats.addValue(standardizedSample[i]); - } - // the calculations do have a limited precision - double distance = 1E-10; - // check the mean an standard deviation - assertEquals(0.0, stats.getMean(), distance); - assertEquals(1.0, stats.getStandardDeviation(), distance); + /** + * Run the test with the values 50 and 100 and assume standardized values + */ + + public void testNormalize1() { + double sample[] = { 50, 100 }; + double expectedSample[] = { -25 / Math.sqrt(1250), 25 / Math.sqrt(1250) }; + double[] out = StatUtils.normalize(sample); + for (int i = 0; i < out.length; i++) { + assertEquals(out[i], expectedSample[i]); + } - } + } + + /** + * Run with 77 random values, assuming that the outcome has a mean of 0 and a standard deviation of 1 with a + * precision of 1E-10. + */ + + public void testNormalize2() { + // create an sample with 77 values + int length = 77; + double sample[] = new double[length]; + for (int i = 0; i < length; i++) { + sample[i] = Math.random(); + } + // normalize this sample + double standardizedSample[] = StatUtils.normalize(sample); + + DescriptiveStatistics stats = new DescriptiveStatistics(); + // Add the data from the array + for (int i = 0; i < length; i++) { + stats.addValue(standardizedSample[i]); + } + // the calculations do have a limited precision + double distance = 1E-10; + // check the mean an standard deviation + assertEquals(0.0, stats.getMean(), distance); + assertEquals(1.0, stats.getStandardDeviation(), distance); + + } }