incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r783255 - in /incubator/hama/trunk: CHANGES.txt src/test/org/apache/hama/TestDenseMatrix.java
Date Wed, 10 Jun 2009 08:48:41 GMT
Author: edwardyoon
Date: Wed Jun 10 08:48:41 2009
New Revision: 783255

URL: http://svn.apache.org/viewvc?rev=783255&view=rev
Log:
Add matrix subtraction test case

Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=783255&r1=783254&r2=783255&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Wed Jun 10 08:48:41 2009
@@ -38,6 +38,7 @@
 
   IMPROVEMENTS
 
+    HAMA-187: Add matrix subtraction test case (edwardyoon)
     HAMA-186: Add density option for random matrix (edwardyoon)
     HAMA-171: Implementation of Matrix.Norm (samuel)
     HAMA-178: Add example of norm (edwardyoon)

Modified: incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java?rev=783255&r1=783254&r2=783255&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/TestDenseMatrix.java Wed Jun 10 08:48:41
2009
@@ -178,6 +178,15 @@
         assertEquals(result.get(i, j), m1.get(i, j) + m2.get(i, j));
       }
     }
+
+    Matrix subtract = result.add(-1.0, m2);
+
+    for (int i = 0; i < SIZE; i++) {
+      for (int j = 0; j < SIZE; j++) {
+        double gap = (subtract.get(i, j) - m1.get(i, j));
+        assertTrue(-0.00001 < gap && gap < 0.00001);
+      }
+    }
   }
 
   public void testMultiMatrixAdd() throws IOException {



Mime
View raw message