mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeast...@apache.org
Subject svn commit: r939132 - in /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering: canopy/Canopy.java kmeans/Cluster.java
Date Wed, 28 Apr 2010 23:27:54 GMT
Author: jeastman
Date: Wed Apr 28 23:27:54 2010
New Revision: 939132

URL: http://svn.apache.org/viewvc?rev=939132&view=rev
Log:
reverting Canopy and Cluster to RandomAccessSparseVector centers

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/Canopy.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/Canopy.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/Canopy.java?rev=939132&r1=939131&r2=939132&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/Canopy.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/Canopy.java
Wed Apr 28 23:27:54 2010
@@ -49,8 +49,8 @@ public class Canopy extends ClusterBase 
    */
   public Canopy(Vector point, int canopyId) {
     this.setId(canopyId);
-    this.setCenter(point.clone());
-    this.setPointTotal(point.clone());
+    this.setCenter(new RandomAccessSparseVector(point.clone()));
+    this.setPointTotal(getCenter().clone());
     this.setNumPoints(1);
   }
   
@@ -65,7 +65,7 @@ public class Canopy extends ClusterBase 
     super.readFields(in);
     VectorWritable temp = new VectorWritable();
     temp.readFields(in);
-    this.setCenter(temp.get());
+    this.setCenter(new RandomAccessSparseVector(temp.get()));
     this.setPointTotal(getCenter().clone());
     this.setNumPoints(1);
   }

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java?rev=939132&r1=939131&r2=939132&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java
Wed Apr 28 23:27:54 2010
@@ -104,7 +104,7 @@ public class Cluster extends ClusterBase
     this.converged = in.readBoolean();
     VectorWritable temp = new VectorWritable();
     temp.readFields(in);
-    this.setCenter(temp.get());
+    this.setCenter(new RandomAccessSparseVector(temp.get()));
     this.setNumPoints(0);
     this.setPointTotal(getCenter().like());
     this.pointSquaredTotal = getCenter().like();
@@ -134,7 +134,7 @@ public class Cluster extends ClusterBase
    */
   public Cluster(Vector center) {
     super();
-    this.setCenter(center.clone());
+    this.setCenter(new RandomAccessSparseVector(center));
     this.setNumPoints(0);
     this.setPointTotal(getCenter().like());
     this.pointSquaredTotal = getCenter().like();
@@ -152,7 +152,7 @@ public class Cluster extends ClusterBase
   public Cluster(Vector center, int clusterId) {
     super();
     this.setId(clusterId);
-    this.setCenter(center.clone());
+    this.setCenter(new RandomAccessSparseVector(center));
     this.setNumPoints(0);
     this.setPointTotal(getCenter().like());
     this.pointSquaredTotal = getCenter().like();



Mime
View raw message