incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r696330 - /incubator/hama/trunk/src/java/org/apache/hama/DenseVector.java
Date Wed, 17 Sep 2008 14:49:35 GMT
Author: edwardyoon
Date: Wed Sep 17 07:49:34 2008
New Revision: 696330

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

Modified:
    incubator/hama/trunk/src/java/org/apache/hama/DenseVector.java

Modified: incubator/hama/trunk/src/java/org/apache/hama/DenseVector.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/DenseVector.java?rev=696330&r1=696329&r2=696330&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/DenseVector.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/DenseVector.java Wed Sep 17 07:49:34 2008
@@ -35,13 +35,10 @@
   static final Logger LOG = Logger.getLogger(Vector.class);
 
   public DenseVector() {
-    this(-1, new VectorMapWritable<Integer, VectorEntry>());
+    this(new VectorMapWritable<Integer, VectorEntry>());
   }
 
-  public DenseVector(final int row,
-      final VectorMapWritable<Integer, VectorEntry> m) {
-    int key = row;
-    this.row = key;
+  public DenseVector(VectorMapWritable<Integer, VectorEntry> m) {
     this.entries = m;
   }
 
@@ -54,16 +51,8 @@
     }
   }
 
-  /**
-   * Get the row for this Vector
-   */
-  public int getRow() {
-    int key = row;
-    return key;
-  }
-
   public VectorMapWritable<Integer, VectorEntry> getEntries() {
-    return entries;
+    return this.entries;
   }
 
   public void add(int index, double value) {
@@ -104,7 +93,7 @@
   }
 
   public Vector scale(double alpha) {
-    Set<Integer> keySet = entries.keySet();
+    Set<Integer> keySet = this.entries.keySet();
     Iterator<Integer> it = keySet.iterator();
 
     int i = 0;
@@ -121,7 +110,7 @@
   }
 
   public double get(int index) {
-    return entries.get(index).getValue();
+    return this.entries.get(index).getValue();
   }
 
   public double norm(Norm type) {
@@ -140,14 +129,13 @@
   }
 
   public DenseVector set(Vector v) {
-    return new DenseVector(((DenseVector) v).getRow(), ((DenseVector) v)
-        .getEntries());
+    return new DenseVector(((DenseVector) v).getEntries());
   }
 
   public double getNorm1() {
     double sum = 0.0;
 
-    Set<Integer> keySet = entries.keySet();
+    Set<Integer> keySet = this.entries.keySet();
     Iterator<Integer> it = keySet.iterator();
 
     while (it.hasNext()) {



Mime
View raw message