hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r684697 - /incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java
Date Mon, 11 Aug 2008 10:02:15 GMT
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)";
-  }
 }



Mime
View raw message