mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r906516 - in /lucene/mahout/trunk/core/src: main/java/org/apache/mahout/clustering/lda/ main/java/org/apache/mahout/common/distance/ main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/ test/java/org/apache/mahout/df/mapreduce/partial/
Date Thu, 04 Feb 2010 15:07:40 GMT
Author: srowen
Date: Thu Feb  4 15:07:39 2010
New Revision: 906516

URL: http://svn.apache.org/viewvc?rev=906516&view=rev
Log:
More tiny style things

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/ManhattanDistanceMeasure.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/SquaredEuclideanDistanceMeasure.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/PartialBuilderTest.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java?rev=906516&r1=906515&r2=906516&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java
Thu Feb  4 15:07:39 2010
@@ -228,8 +228,8 @@
       }
 
     } catch (OptionException e) {
-      e.printStackTrace();
       CommandLineUtil.printHelp(group);
+      throw e;
     }
   }
 

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/ManhattanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/ManhattanDistanceMeasure.java?rev=906516&r1=906515&r2=906516&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/ManhattanDistanceMeasure.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/ManhattanDistanceMeasure.java
Thu Feb  4 15:07:39 2010
@@ -32,7 +32,7 @@
  */
 public class ManhattanDistanceMeasure implements DistanceMeasure {
 
-  public double distance(double[] p1, double[] p2) {
+  public static double distance(double[] p1, double[] p2) {
     double result = 0.0;
     for (int i = 0; i < p1.length; i++) {
       result += Math.abs(p2[i] - p1[i]);

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/SquaredEuclideanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/SquaredEuclideanDistanceMeasure.java?rev=906516&r1=906515&r2=906516&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/SquaredEuclideanDistanceMeasure.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/SquaredEuclideanDistanceMeasure.java
Thu Feb  4 15:07:39 2010
@@ -18,7 +18,6 @@
 package org.apache.mahout.common.distance;
 
 import org.apache.hadoop.mapred.JobConf;
-import org.apache.mahout.math.CardinalityException;
 import org.apache.mahout.math.Vector;
 import org.apache.mahout.common.parameters.Parameter;
 

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java?rev=906516&r1=906515&r2=906516&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
Thu Feb  4 15:07:39 2010
@@ -281,7 +281,7 @@
     return fpGrowth(tree, minSupportMutable, k, returnFeatures, topKPatternsOutputCollector,
updater);
   }
 
-  private FrequentPatternMaxHeap growth(FPTree tree, MutableLong minSupportMutable, int k,
+  private static FrequentPatternMaxHeap growth(FPTree tree, MutableLong minSupportMutable,
int k,
       FPTreeDepthCache treeCache, int level, int currentAttribute, StatusUpdater updater)
{
 
     FrequentPatternMaxHeap frequentPatterns = new FrequentPatternMaxHeap(k, true);

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/PartialBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/PartialBuilderTest.java?rev=906516&r1=906515&r2=906516&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/PartialBuilderTest.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/PartialBuilderTest.java
Thu Feb  4 15:07:39 2010
@@ -154,19 +154,19 @@
 
   static class PartialBuilderChecker extends PartialBuilder {
 
-    final Long _seed;
+    private final Long seed;
 
-    final TreeBuilder _treeBuilder;
+    private final TreeBuilder treeBuilder;
 
-    final Path _datasetPath;
+    private final Path datasetPath;
 
     PartialBuilderChecker(TreeBuilder treeBuilder, Path dataPath,
         Path datasetPath, Long seed) {
       super(treeBuilder, dataPath, datasetPath, seed);
 
-      _seed = seed;
-      _treeBuilder = treeBuilder;
-      _datasetPath = datasetPath;
+      this.seed = seed;
+      this.treeBuilder = treeBuilder;
+      this.datasetPath = datasetPath;
     }
 
     @Override
@@ -175,7 +175,7 @@
 
       Configuration conf = job.getConfiguration();
       
-      assertEquals(_seed, getRandomSeed(conf));
+      assertEquals(seed, getRandomSeed(conf));
 
       // PartialBuilder should detect the 'local' mode and overrides the number
       // of map tasks
@@ -186,9 +186,9 @@
       assertFalse(isOutput(conf));
       assertTrue(isOobEstimate(conf));
 
-      assertEquals(_treeBuilder, getTreeBuilder(conf));
+      assertEquals(treeBuilder, getTreeBuilder(conf));
 
-      assertEquals(_datasetPath, getDistributedCacheFile(conf, 0));
+      assertEquals(datasetPath, getDistributedCacheFile(conf, 0));
       
       return true;
     }
@@ -201,9 +201,9 @@
    */
   static class TestCallback implements PredictionCallback {
 
-    final TreeID[] keys;
+    private final TreeID[] keys;
 
-    final MapredOutput[] values;
+    private final MapredOutput[] values;
 
     TestCallback(TreeID[] keys, MapredOutput[] values) {
       this.keys = keys;



Mime
View raw message