You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2008/08/11 12:02:15 UTC

svn commit: r684697 - /incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java

Author: edwardyoon
Date: Mon Aug 11 03:02:13 2008
New Revision: 684697

URL: http://svn.apache.org/viewvc?rev=684697&view=rev
Log: (empty)

Modified:
    incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java?rev=684697&r1=684696&r2=684697&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java Mon Aug 11 03:02:13 2008
@@ -38,20 +38,27 @@
     Matrix a = Matrix.random(conf, row, column);
     Matrix b = Matrix.random(conf, row, column);
 
-    long start = System.currentTimeMillis();
     Matrix c = a.add(b);
-    long end = System.currentTimeMillis();
-    System.out.println(executeTime(start, end));
+
+    System.out.println("Matrix A");
+    for(int i =  0; i < row; i++) {
+      for(int j =  0; j < row; j++) {
+        System.out.println(a.get(i, j));
+      }
+    }
+    
+    System.out.println("Matrix B");
+    for(int i =  0; i < row; i++) {
+      for(int j =  0; j < row; j++) {
+        System.out.println(b.get(i, j));
+      }
+    }
     
+    System.out.println("Matrix C");
     for(int i =  0; i < row; i++) {
       for(int j =  0; j < row; j++) {
         System.out.println(c.get(i, j));
       }
     }
   }
-
-  public static String executeTime(long start, long end) {
-    return "(" + String.format("%.2f", Double.valueOf((end - start) * 0.001))
-        + " sec)";
-  }
 }