commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1540392 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java
Date Sat, 09 Nov 2013 20:31:52 GMT
Author: psteitz
Date: Sat Nov  9 20:31:52 2013
New Revision: 1540392

URL: http://svn.apache.org/r1540392
Log:
Added test to verify that zero variance in either array leads to NaN.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java?rev=1540392&r1=1540391&r2=1540392&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java
Sat Nov  9 20:31:52 2013
@@ -194,6 +194,7 @@ public class PearsonsCorrelationTest {
         double[] noVariance = new double[] {1, 1, 1, 1};
         double[] values = new double[] {1, 2, 3, 4};
         Assert.assertTrue(Double.isNaN(new PearsonsCorrelation().correlation(noVariance,
values)));
+        Assert.assertTrue(Double.isNaN(new PearsonsCorrelation().correlation(values, noVariance)));
     }
 
 



Mime
View raw message