Return-Path: Delivered-To: apmail-lucene-mahout-commits-archive@minotaur.apache.org Received: (qmail 94055 invoked from network); 28 Apr 2010 23:28:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Apr 2010 23:28:48 -0000 Received: (qmail 92445 invoked by uid 500); 28 Apr 2010 23:28:48 -0000 Delivered-To: apmail-lucene-mahout-commits-archive@lucene.apache.org Received: (qmail 92409 invoked by uid 500); 28 Apr 2010 23:28:48 -0000 Mailing-List: contact mahout-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mahout-dev@lucene.apache.org Delivered-To: mailing list mahout-commits@lucene.apache.org Received: (qmail 92402 invoked by uid 99); 28 Apr 2010 23:28:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Apr 2010 23:28:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Apr 2010 23:28:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EB495238899B; Wed, 28 Apr 2010 23:27:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: mahout-commits@lucene.apache.org From: jeastman@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100428232754.EB495238899B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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();