incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r731847 - /incubator/hama/trunk/src/java/org/apache/hama/mapred/RandomMatrixMap.java
Date Tue, 06 Jan 2009 06:44:16 GMT
Author: edwardyoon
Date: Mon Jan  5 22:44:16 2009
New Revision: 731847

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

Modified:
    incubator/hama/trunk/src/java/org/apache/hama/mapred/RandomMatrixMap.java

Modified: incubator/hama/trunk/src/java/org/apache/hama/mapred/RandomMatrixMap.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/mapred/RandomMatrixMap.java?rev=731847&r1=731846&r2=731847&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/mapred/RandomMatrixMap.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/mapred/RandomMatrixMap.java Mon Jan  5 22:44:16
2009
@@ -30,9 +30,8 @@
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.Reporter;
 import org.apache.hama.DenseMatrix;
-import org.apache.hama.DenseVector;
 import org.apache.hama.HamaConfiguration;
-import org.apache.hama.Matrix;
+import org.apache.hama.io.VectorUpdate;
 import org.apache.hama.util.RandomVariable;
 import org.apache.log4j.Logger;
 
@@ -42,20 +41,20 @@
 public class RandomMatrixMap extends MapReduceBase implements
     Mapper<IntWritable, IntWritable, BooleanWritable, LongWritable> {
   static final Logger LOG = Logger.getLogger(RandomMatrixMap.class);
-  protected Matrix matrix;
+  protected DenseMatrix matrix;
   protected int column;
-
+  protected VectorUpdate batchUpdate;
+  
   @Override
   public void map(IntWritable key, IntWritable value,
       OutputCollector<BooleanWritable, LongWritable> output, Reporter report)
       throws IOException {
-    DenseVector vector = new DenseVector();
     for (int i = key.get(); i <= value.get(); i++) {
-      vector.clear();
+      batchUpdate = new VectorUpdate(i);
       for (int j = 0; j < column; j++) {
-        vector.set(j, RandomVariable.rand());
+        batchUpdate.put(j, RandomVariable.rand());
       }
-      matrix.setRow(i, vector);
+      matrix.getHTable().commit(batchUpdate.getBatchUpdate());
     }
   }
 



Mime
View raw message