commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r620290 - /commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java
Date Sun, 10 Feb 2008 16:28:51 GMT
Author: luc
Date: Sun Feb 10 08:28:50 2008
New Revision: 620290

URL: http://svn.apache.org/viewvc?rev=620290&view=rev
Log:
removed references to the StatisticalMultivariateSummaryValues class

Modified:
    commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java?rev=620290&r1=620289&r2=620290&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java
(original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java
Sun Feb 10 08:28:50 2008
@@ -190,28 +190,12 @@
 
     }
 
-    public void testGetSummary() throws DimensionMismatchException {
-        MultivariateSummaryStatistics u = new MultivariateSummaryStatistics(2, true);
-        StatisticalMultivariateSummary summary = u.getSummary();
-        verifySummary(u, summary);
-        u.addValue(new double[] { 1, 2 });
-        summary = u.getSummary();
-        verifySummary(u, summary);
-        u.addValue(new double[] { 2, 5 });
-        summary = u.getSummary();
-        verifySummary(u, summary);
-        u.addValue(new double[] { 2, 2 });
-        summary = u.getSummary();
-        verifySummary(u, summary);     
-    }
-
     public void testSerialization() throws DimensionMismatchException {
         MultivariateSummaryStatistics u = new MultivariateSummaryStatistics(2, true);
         // Empty test
         TestUtils.checkSerializedEquality(u);
         MultivariateSummaryStatistics s = (MultivariateSummaryStatistics) TestUtils.serializeAndRecover(u);
-        StatisticalMultivariateSummary summary = s.getSummary();
-        verifySummary(u, summary);
+        assertEquals(u, s);
 
         // Add some data
         u.addValue(new double[] { 2d, 1d });
@@ -223,8 +207,7 @@
         // Test again
         TestUtils.checkSerializedEquality(u);
         s = (MultivariateSummaryStatistics) TestUtils.serializeAndRecover(u);
-        summary = s.getSummary();
-        verifySummary(u, summary);
+        assertEquals(u, s);
 
     }
 
@@ -267,28 +250,6 @@
         assertTrue(u.equals(t));
         assertEquals(emptyHash, t.hashCode());
         assertEquals(emptyHash, u.hashCode());
-    }
-
-    private void verifySummary(MultivariateSummaryStatistics u, StatisticalMultivariateSummary
s) {
-        assertEquals(s.getN(), u.getN());
-        for (int i = 0; i < u.getDimension(); ++i) {
-            checkValue(s.getSum()[i], u.getSum()[i], 1.0e-10);
-            checkValue(s.getStandardDeviation()[i], u.getStandardDeviation()[i], 1.0e-10);
-            checkValue(s.getMean()[i], u.getMean()[i], 1.0e-10);
-            checkValue(s.getMin()[i], u.getMin()[i], 1.0e-10);
-            checkValue(s.getMax()[i], u.getMax()[i], 1.0e-10);
-            checkValue(s.getSumSq()[i], u.getSumSq()[i], 1.0e-10);
-            checkValue(s.getSumLog()[i], u.getSumLog()[i], 1.0e-10);
-            checkValue(s.getMax()[i], u.getMax()[i], 1.0e-10);
-        }
-    }
-
-    private void checkValue(double expected, double actual, double tolerance) {
-        if (Double.isNaN(expected)) {
-            assertTrue(Double.isNaN(actual));
-        } else {
-            assertEquals(expected, actual, tolerance);
-        }
     }
 
 }



Mime
View raw message