hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r751948 - in /incubator/hama/trunk: ./ src/examples/org/apache/hama/examples/
Date Tue, 10 Mar 2009 01:47:30 GMT
Author: edwardyoon
Date: Tue Mar 10 01:47:30 2009
New Revision: 751948

URL: http://svn.apache.org/viewvc?rev=751948&view=rev
Log:
Example for C = Alpha*B + A

Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/src/examples/org/apache/hama/examples/FileMatrixBlockMult.java
    incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixAddition.java
    incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixMultiplication.java
    incubator/hama/trunk/src/examples/org/apache/hama/examples/RandomMatrix.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=751948&r1=751947&r2=751948&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Tue Mar 10 01:47:30 2009
@@ -36,6 +36,7 @@
     
   IMPROVEMENTS
 
+    HAMA-164: Example for C = Alpha*B + A (edwardyoon)
     HAMA-154: Combine multi-mapreduce jobs into a single mapreduce job 
                 while computing (samuel via edwardyoon)
     HAMA-152: Replace MapWritable to hadoop.io.MapWritable (edwardyoon)

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/FileMatrixBlockMult.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/FileMatrixBlockMult.java?rev=751948&r1=751947&r2=751948&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/FileMatrixBlockMult.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/FileMatrixBlockMult.java Tue
Mar 10 01:47:30 2009
@@ -118,7 +118,7 @@
   public static void main(String[] args) throws IOException {
     if (args.length < 5) {
       System.out
-          .println("multfiles  [-m maps] [-r reduces] <seqfile1> <seqfile1> <blocks>
<rows> <columns>");
+          .println("multfiles [-m maps] [-r reduces] <seqfile1> <seqfile1> <blocks>
<rows> <columns>");
       System.exit(-1);
     } else {
       parseArgs(args);

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=751948&r1=751947&r2=751948&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 Tue Mar
10 01:47:30 2009
@@ -27,7 +27,8 @@
 public class MatrixAddition extends AbstractExample {
   public static void main(String[] args) throws IOException {
     if (args.length < 2) {
-      System.out.println("add  [-m maps] [-r reduces] <row_m> <column_n>");
+      System.out
+          .println("add [-m maps] [-r reduces] <matrix A> <matrix B> [alpha]");
       System.exit(-1);
     } else {
       parseArgs(args);
@@ -35,11 +36,19 @@
 
     String matrixA = ARGS.get(0);
     String matrixB = ARGS.get(1);
-    
+
     DenseMatrix a = new DenseMatrix(conf, matrixA, false);
     DenseMatrix b = new DenseMatrix(conf, matrixB, false);
 
-    Matrix c = a.add(b);
+    Matrix c;
+    if (ARGS.size() > 2) {
+      System.out.println("C = A + B");
+      c = a.add(b);
+    } else {
+      System.out.println("C = "+ Double.parseDouble(ARGS.get(2)) +" * B + A");
+      c = a.add(Double.parseDouble(ARGS.get(2)), b);
+    }
+    
     c.close();
   }
 }

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixMultiplication.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixMultiplication.java?rev=751948&r1=751947&r2=751948&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixMultiplication.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/MatrixMultiplication.java Tue
Mar 10 01:47:30 2009
@@ -28,7 +28,7 @@
   public static void main(String[] args) throws IOException {
     if (args.length < 2) {
       System.out
-          .println("mult  [-m maps] [-r reduces] <matrix_A> <matrix_B> [blocks]");
+          .println("mult [-m maps] [-r reduces] <matrix A> <matrix B> [blocks]");
       System.exit(-1);
     } else {
       parseArgs(args);

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/RandomMatrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/RandomMatrix.java?rev=751948&r1=751947&r2=751948&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/RandomMatrix.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/RandomMatrix.java Tue Mar 10
01:47:30 2009
@@ -28,7 +28,7 @@
   public static void main(String[] args) throws IOException {
     if (args.length < 3) {
       System.out
-          .println("rand  [-m maps] [-r reduces] <rows> <columns> <matrix_name>");
+          .println("rand [-m maps] [-r reduces] <rows> <columns> <matrix_name>");
       System.exit(-1);
     } else {
       parseArgs(args);



Mime
View raw message