mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r751482 [2/2] - in /lucene/mahout/trunk: core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/ core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/jdbc/ core/src/main/java/org/apache/mahout/classifier/...
Date Sun, 08 Mar 2009 17:52:20 GMT
Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestSparseVector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestSparseVector.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestSparseVector.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestSparseVector.java
Sun Mar  8 17:52:18 2009
@@ -49,15 +49,15 @@
   public void testCopy() throws Exception {
     Vector copy = test.copy();
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("copy [" + i + "]", test.get(i), copy.get(i));
+      assertEquals("copy [" + i + ']', test.get(i), copy.get(i));
   }
 
   public void testGet() throws Exception {
     for (int i = 0; i < test.cardinality(); i++)
       if (i > 0 && i < 4)
-        assertEquals("get [" + i + "]", values[i - 1], test.get(i));
+        assertEquals("get [" + i + ']', values[i - 1], test.get(i));
       else
-        assertEquals("get [" + i + "]", 0.0, test.get(i));
+        assertEquals("get [" + i + ']', 0.0, test.get(i));
   }
 
   public void testGetOver() {
@@ -82,11 +82,11 @@
     test.set(2, 4.5);
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, test.get(i));
+        assertEquals("get [" + i + ']', 0.0, test.get(i));
       else if (i == 2)
-        assertEquals("set [" + i + "]", 4.5, test.get(i));
+        assertEquals("set [" + i + ']', 4.5, test.get(i));
       else
-        assertEquals("set [" + i + "]", values[i - 1], test.get(i));
+        assertEquals("set [" + i + ']', values[i - 1], test.get(i));
   }
 
   public void testSize() throws Exception {
@@ -96,14 +96,14 @@
   public void testToArray() throws Exception {
     double[] val = test.toArray();
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", val[i], test.get(i));
+      assertEquals("get [" + i + ']', val[i], test.get(i));
   }
 
   public void testViewPart() throws Exception {
     Vector part = test.viewPart(1, 2);
     assertEquals("part size", 2, part.size());
     for (int i = 0; i < part.cardinality(); i++)
-      assertEquals("part[" + i + "]", values[i], part.get(i));
+      assertEquals("part[" + i + ']', values[i], part.get(i));
   }
 
   public void testViewPartUnder() {
@@ -142,14 +142,14 @@
   public void testDecodeFormat() throws Exception {
     Vector val = SparseVector.decodeFormat(test.asWritableComparable());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", test.get(i), val.get(i));
+      assertEquals("get [" + i + ']', test.get(i), val.get(i));
   }
 
   public void testSparseDoubleVectorInt() throws Exception {
     Vector val = new SparseVector(4);
     assertEquals("cardinality", 4, val.cardinality());
     for (int i = 0; i < 4; i++)
-      assertEquals("get [" + i + "]", 0.0, val.get(i));
+      assertEquals("get [" + i + ']', 0.0, val.get(i));
   }
 
   public void testDot() throws Exception {
@@ -171,7 +171,7 @@
     double mag = Math.sqrt(1.1 * 1.1 + 2.2 * 2.2 + 3.3 * 3.3);
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, val.get(i));
+        assertEquals("get [" + i + ']', 0.0, val.get(i));
       else
         assertEquals("dot", values[i - 1] / mag, val.get(i));
   }
@@ -180,7 +180,7 @@
     Vector val = test.minus(test);
     assertEquals("cardinality", test.cardinality(), val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", 0.0, val.get(i));
+      assertEquals("get [" + i + ']', 0.0, val.get(i));
   }
 
   public void testPlusDouble() throws Exception {
@@ -188,9 +188,9 @@
     assertEquals("cardinality", test.cardinality(), val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 1.0, val.get(i));
+        assertEquals("get [" + i + ']', 1.0, val.get(i));
       else
-        assertEquals("get [" + i + "]", values[i - 1] + 1, val.get(i));
+        assertEquals("get [" + i + ']', values[i - 1] + 1, val.get(i));
   }
 
   public void testPlusVector() throws Exception {
@@ -198,9 +198,9 @@
     assertEquals("cardinality", test.cardinality(), val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, val.get(i));
+        assertEquals("get [" + i + ']', 0.0, val.get(i));
       else
-        assertEquals("get [" + i + "]", values[i - 1] * 2, val.get(i));
+        assertEquals("get [" + i + ']', values[i - 1] * 2, val.get(i));
   }
 
   public void testPlusVectorCardinality() {
@@ -217,9 +217,9 @@
     assertEquals("cardinality", test.cardinality(), val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, val.get(i));
+        assertEquals("get [" + i + ']', 0.0, val.get(i));
       else
-        assertEquals("get [" + i + "]", values[i - 1] * 3, val.get(i));
+        assertEquals("get [" + i + ']', values[i - 1] * 3, val.get(i));
   }
 
   public void testDivideDouble() throws Exception {
@@ -227,9 +227,9 @@
     assertEquals("cardinality", test.cardinality(), val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, val.get(i));
+        assertEquals("get [" + i + ']', 0.0, val.get(i));
       else
-        assertEquals("get [" + i + "]", values[i - 1] / 3, val.get(i));
+        assertEquals("get [" + i + ']', values[i - 1] / 3, val.get(i));
   }
 
   public void testTimesVector() throws Exception {
@@ -237,9 +237,9 @@
     assertEquals("cardinality", test.cardinality(), val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, val.get(i));
+        assertEquals("get [" + i + ']', 0.0, val.get(i));
       else
-        assertEquals("get [" + i + "]", values[i - 1] * values[i - 1], val
+        assertEquals("get [" + i + ']', values[i - 1] * values[i - 1], val
             .get(i));
   }
 
@@ -254,22 +254,23 @@
 
   public void testZSum() {
     double expected = 0;
-    for (int i = 0; i < values.length; i++)
-      expected += values[i];
+    for (double value : values) {
+      expected += value;
+    }
     assertEquals("wrong zSum", expected, test.zSum());
   }
 
   public void testAssignDouble() {
     test.assign(0);
     for (int i = 0; i < values.length; i++)
-      assertEquals("value[" + i + "]", 0.0, test.getQuick(i));
+      assertEquals("value[" + i + ']', 0.0, test.getQuick(i));
   }
 
   public void testAssignDoubleArray() throws Exception {
     double[] array = new double[test.cardinality()];
     test.assign(array);
     for (int i = 0; i < values.length; i++)
-      assertEquals("value[" + i + "]", 0.0, test.getQuick(i));
+      assertEquals("value[" + i + ']', 0.0, test.getQuick(i));
   }
 
   public void testAssignDoubleArrayCardinality() {
@@ -286,7 +287,7 @@
     Vector other = new DenseVector(test.cardinality());
     test.assign(other);
     for (int i = 0; i < values.length; i++)
-      assertEquals("value[" + i + "]", 0.0, test.getQuick(i));
+      assertEquals("value[" + i + ']', 0.0, test.getQuick(i));
   }
 
   public void testAssignVectorCardinality() {
@@ -303,36 +304,36 @@
     test.assign(new NegateFunction());
     for (int i = 0; i < values.length; i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, test.getQuick(i));
+        assertEquals("get [" + i + ']', 0.0, test.getQuick(i));
       else
-        assertEquals("value[" + i + "]", -values[i - 1], test.getQuick(i));
+        assertEquals("value[" + i + ']', -values[i - 1], test.getQuick(i));
   }
 
   public void testAssignBinaryFunction() throws Exception {
     test.assign(test, new PlusFunction());
     for (int i = 0; i < values.length; i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, test.get(i));
+        assertEquals("get [" + i + ']', 0.0, test.get(i));
       else
-        assertEquals("value[" + i + "]", 2 * values[i - 1], test.getQuick(i));
+        assertEquals("value[" + i + ']', 2 * values[i - 1], test.getQuick(i));
   }
 
   public void testAssignBinaryFunction2() throws Exception {
     test.assign(new PlusFunction(), 4);
     for (int i = 0; i < values.length; i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 4.0, test.get(i));
+        assertEquals("get [" + i + ']', 4.0, test.get(i));
       else
-        assertEquals("value[" + i + "]", values[i - 1] + 4, test.getQuick(i));
+        assertEquals("value[" + i + ']', values[i - 1] + 4, test.getQuick(i));
   }
 
   public void testAssignBinaryFunction3() throws Exception {
     test.assign(new TimesFunction(), 4);
     for (int i = 0; i < values.length; i++)
       if (i == 0 || i == 4)
-        assertEquals("get [" + i + "]", 0.0, test.get(i));
+        assertEquals("get [" + i + ']', 0.0, test.get(i));
       else
-        assertEquals("value[" + i + "]", values[i - 1] * 4, test.getQuick(i));
+        assertEquals("value[" + i + ']', values[i - 1] * 4, test.getQuick(i));
   }
 
   public void testAssignBinaryFunctionCardinality() {
@@ -379,7 +380,7 @@
     assertEquals("col cardinality", test.cardinality(), result.cardinality()[1]);
     for (int row = 0; row < result.cardinality()[0]; row++)
       for (int col = 0; col < result.cardinality()[1]; col++)
-        assertEquals("cross[" + row + "][" + col + "]", test.getQuick(row)
+        assertEquals("cross[" + row + "][" + col + ']', test.getQuick(row)
             * test.getQuick(col), result.getQuick(row, col));
   }
 }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorView.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorView.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorView.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorView.java Sun
Mar  8 17:52:18 2009
@@ -45,12 +45,12 @@
   public void testCopy() throws Exception {
     Vector copy = test.copy();
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("copy [" + i + "]", test.get(i), copy.get(i));
+      assertEquals("copy [" + i + ']', test.get(i), copy.get(i));
   }
 
   public void testGet() throws Exception {
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", values[i + offset], test.get(i));
+      assertEquals("get [" + i + ']', values[i + offset], test.get(i));
   }
 
   public void testGetOver() {
@@ -75,9 +75,9 @@
     test.set(2, 4.5);
     for (int i = 0; i < test.cardinality(); i++)
       if (i == 2)
-        assertEquals("set [" + i + "]", 4.5, test.get(i));
+        assertEquals("set [" + i + ']', 4.5, test.get(i));
       else
-        assertEquals("set [" + i + "]", values[offset + i], test.get(i));
+        assertEquals("set [" + i + ']', values[offset + i], test.get(i));
   }
 
   public void testSize() throws Exception {
@@ -87,14 +87,14 @@
   public void testToArray() throws Exception {
     double[] val = test.toArray();
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", val[i], test.get(i));
+      assertEquals("get [" + i + ']', val[i], test.get(i));
   }
 
   public void testViewPart() throws Exception {
     Vector part = test.viewPart(1, 2);
     assertEquals("part size", 2, part.size());
     for (int i = 0; i < part.cardinality(); i++)
-      assertEquals("part[" + i + "]", values[offset + i + 1], part.get(i));
+      assertEquals("part[" + i + ']', values[offset + i + 1], part.get(i));
   }
 
   public void testViewPartUnder() {
@@ -155,21 +155,21 @@
     Vector val = test.minus(test);
     assertEquals("cardinality", 3, val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", 0.0, val.get(i));
+      assertEquals("get [" + i + ']', 0.0, val.get(i));
   }
 
   public void testPlusDouble() throws Exception {
     Vector val = test.plus(1);
     assertEquals("cardinality", 3, val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", values[offset + i] + 1, val.get(i));
+      assertEquals("get [" + i + ']', values[offset + i] + 1, val.get(i));
   }
 
   public void testPlusVector() throws Exception {
     Vector val = test.plus(test);
     assertEquals("cardinality", 3, val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", values[offset + i] * 2, val.get(i));
+      assertEquals("get [" + i + ']', values[offset + i] * 2, val.get(i));
   }
 
   public void testPlusVectorCardinality() {
@@ -185,21 +185,21 @@
     Vector val = test.times(3);
     assertEquals("cardinality", 3, val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", values[offset + i] * 3, val.get(i));
+      assertEquals("get [" + i + ']', values[offset + i] * 3, val.get(i));
   }
 
   public void testDivideDouble() throws Exception {
     Vector val = test.divide(3);
     assertEquals("cardinality", 3, val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", values[offset + i] / 3, val.get(i));
+      assertEquals("get [" + i + ']', values[offset + i] / 3, val.get(i));
   }
 
   public void testTimesVector() throws Exception {
     Vector val = test.times(test);
     assertEquals("cardinality", 3, val.cardinality());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("get [" + i + "]", values[offset + i] * values[offset + i],
+      assertEquals("get [" + i + ']', values[offset + i] * values[offset + i],
               val.get(i));
   }
 
@@ -222,14 +222,14 @@
   public void testAssignDouble() {
     test.assign(0);
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("value[" + i + "]", 0.0, test.getQuick(i));
+      assertEquals("value[" + i + ']', 0.0, test.getQuick(i));
   }
 
   public void testAssignDoubleArray() throws Exception {
     double[] array = new double[test.cardinality()];
     test.assign(array);
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("value[" + i + "]", 0.0, test.getQuick(i));
+      assertEquals("value[" + i + ']', 0.0, test.getQuick(i));
   }
 
   public void testAssignDoubleArrayCardinality() {
@@ -246,7 +246,7 @@
     Vector other = new DenseVector(test.cardinality());
     test.assign(other);
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("value[" + i + "]", 0.0, test.getQuick(i));
+      assertEquals("value[" + i + ']', 0.0, test.getQuick(i));
   }
 
   public void testAssignVectorCardinality() {
@@ -262,25 +262,25 @@
   public void testAssignUnaryFunction() {
     test.assign(new NegateFunction());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("value[" + i + "]", -values[i + 1], test.getQuick(i));
+      assertEquals("value[" + i + ']', -values[i + 1], test.getQuick(i));
   }
 
   public void testAssignBinaryFunction() throws Exception {
     test.assign(test, new PlusFunction());
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("value[" + i + "]", 2 * values[i + 1], test.getQuick(i));
+      assertEquals("value[" + i + ']', 2 * values[i + 1], test.getQuick(i));
   }
 
   public void testAssignBinaryFunction2() throws Exception {
     test.assign(new PlusFunction(), 4);
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("value[" + i + "]", values[i + 1] + 4, test.getQuick(i));
+      assertEquals("value[" + i + ']', values[i + 1] + 4, test.getQuick(i));
   }
 
   public void testAssignBinaryFunction3() throws Exception {
     test.assign(new TimesFunction(), 4);
     for (int i = 0; i < test.cardinality(); i++)
-      assertEquals("value[" + i + "]", values[i + 1] * 4, test.getQuick(i));
+      assertEquals("value[" + i + ']', values[i + 1] * 4, test.getQuick(i));
   }
 
   public void testAssignBinaryFunctionCardinality() {
@@ -325,7 +325,7 @@
     assertEquals("col cardinality", test.cardinality(), result.cardinality()[1]);
     for (int row = 0; row < result.cardinality()[0]; row++)
       for (int col = 0; col < result.cardinality()[1]; col++)
-        assertEquals("cross[" + row + "][" + col + "]", test.getQuick(row)
+        assertEquals("cross[" + row + "][" + col + ']', test.getQuick(row)
                 * test.getQuick(col), result.getQuick(row, col));
   }
 }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorWritable.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorWritable.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorWritable.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/TestVectorWritable.java
Sun Mar  8 17:52:18 2009
@@ -27,7 +27,7 @@
 
   private static final int cardinality = 10;
 
-  public void test(Vector writable) throws Exception {
+  private static void doTest(Vector writable) throws Exception {
     for (int i = 0; i < cardinality; i++) {
       writable.set(i, i);
     }
@@ -44,8 +44,6 @@
       assertEquals((double)i, writable.get(i));
     }
 
-    //
-
     in = new DataInputStream(new ByteArrayInputStream(out.getData()));
     writable.readFields(in);
     in.close();
@@ -54,12 +52,10 @@
     for (int i = 0; i < cardinality; i++) {
       assertEquals((double)i, writable.get(i));
     }
-
-
   }
 
-  public void test() throws Exception {
-    test(new SparseVector(cardinality));
-    test(new DenseVector(cardinality));
+  public void testVectors() throws Exception {
+    doTest(new SparseVector(cardinality));
+    doTest(new DenseVector(cardinality));
   }
 }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java Sun Mar
 8 17:52:18 2009
@@ -21,26 +21,17 @@
 
 public class VectorTest extends TestCase {
 
-
   public VectorTest(String s) {
     super(s);
   }
 
-  protected void setUp() {
-  }
-
-  protected void tearDown() {
-
-  }
-
   public void testSparseVector() throws Exception {
     SparseVector vec1 = new SparseVector(3);
     SparseVector vec2 = new SparseVector(3);
-    testVectors(vec1, vec2);
-
+    doTestVectors(vec1, vec2);
   }
 
-  private void testVectors(Vector left, Vector right) {
+  private static void doTestVectors(Vector left, Vector right) {
     left.setQuick(0, 1);
     left.setQuick(1, 2);
     left.setQuick(2, 3);
@@ -48,14 +39,14 @@
     right.setQuick(1, 5);
     right.setQuick(2, 6);
     double result = left.dot(right);
-    assertTrue(result + " does not equal: " + 32, result == 32);
+    assertEquals(result + " does not equal: " + 32, 32.0, result);
   }
 
 
   public void testDenseVector() throws Exception {
     DenseVector vec1 = new DenseVector(3);
     DenseVector vec2 = new DenseVector(3);
-    testVectors(vec1, vec2);
+    doTestVectors(vec1, vec2);
 
   }
 
@@ -64,13 +55,13 @@
     SparseVector vec2 = new SparseVector(6);
     VectorView vecV1 = new VectorView(vec1, 0, 3);
     VectorView vecV2 = new VectorView(vec2, 2, 3);
-    testVectors(vecV1, vecV2);
+    doTestVectors(vecV1, vecV2);
   }
 
   /**
    * Asserts a vector using enumeration equals a given dense vector
    */
-  public void testEnumeration(double[] apriori, Vector vector) throws Exception {
+  private static void doTestEnumeration(double[] apriori, Vector vector) {
     double[] test = new double[apriori.length];
     for (Vector.Element e : vector) {
       test[e.index()] = e.get();
@@ -82,11 +73,11 @@
   }
 
   public void testEnumeration() throws Exception {
-    double[] apriori = new double[]{0, 1, 2, 3, 4};
+    double[] apriori = {0, 1, 2, 3, 4};
 
-    testEnumeration(apriori, new VectorView(new DenseVector(new double[]{-2, -1, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9}), 2, 5));
+    doTestEnumeration(apriori, new VectorView(new DenseVector(new double[]{-2, -1, 0, 1,
2, 3, 4, 5, 6, 7, 8, 9}), 2, 5));
     
-    testEnumeration(apriori, new DenseVector(new double[]{0, 1, 2, 3, 4}));
+    doTestEnumeration(apriori, new DenseVector(new double[]{0, 1, 2, 3, 4}));
 
     SparseVector sparse = new SparseVector(5);
     sparse.set(0, 0);
@@ -94,9 +85,7 @@
     sparse.set(2, 2);
     sparse.set(3, 3);
     sparse.set(4, 4);
-    testEnumeration(apriori, sparse);
-
-
-
+    doTestEnumeration(apriori, sparse);
   }
+
 }
\ No newline at end of file

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultDistanceMeasureTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultDistanceMeasureTest.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultDistanceMeasureTest.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultDistanceMeasureTest.java
Sun Mar  8 17:52:18 2009
@@ -30,7 +30,7 @@
 
     DistanceMeasure distanceMeasure = distanceMeasureFactory();
 
-    Vector[] vectors = new Vector[]{
+    Vector[] vectors = {
         new DenseVector(new double[]{1, 1, 1, 1, 1, 1}),
         new DenseVector(new double[]{2, 2, 2, 2, 2, 2}),
         new DenseVector(new double[]{6, 6, 6, 6, 6, 6})
@@ -44,15 +44,15 @@
       }
     }
 
-    assertEquals(0d, distanceMatrix[0][0]);
+    assertEquals(0.0, distanceMatrix[0][0]);
     assertTrue(distanceMatrix[0][0] < distanceMatrix[0][1]);
     assertTrue(distanceMatrix[0][1] < distanceMatrix[0][2]);
 
-    assertEquals(0d, distanceMatrix[1][1]);
+    assertEquals(0.0, distanceMatrix[1][1]);
     assertTrue(distanceMatrix[1][0] > distanceMatrix[1][1]);
     assertTrue(distanceMatrix[1][2] > distanceMatrix[1][0]);
 
-    assertEquals(0d, distanceMatrix[2][2]);
+    assertEquals(0.0, distanceMatrix[2][2]);
     assertTrue(distanceMatrix[2][0] > distanceMatrix[2][1]);
     assertTrue(distanceMatrix[2][1] > distanceMatrix[2][2]);
 

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultWeightedDistanceMeasureTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultWeightedDistanceMeasureTest.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultWeightedDistanceMeasureTest.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DefaultWeightedDistanceMeasureTest.java
Sun Mar  8 17:52:18 2009
@@ -22,13 +22,14 @@
 
 public abstract class DefaultWeightedDistanceMeasureTest extends DefaultDistanceMeasureTest
{
 
+  @Override
   public abstract WeightedDistanceMeasure distanceMeasureFactory();
 
   public void testMeasureWeighted() {
 
     WeightedDistanceMeasure distanceMeasure = distanceMeasureFactory();
 
-    Vector[] vectors = new Vector[]{
+    Vector[] vectors = {
         new DenseVector(new double[]{9, 9, 1}),
         new DenseVector(new double[]{1, 9, 9}),
         new DenseVector(new double[]{9, 1, 9}),
@@ -43,7 +44,7 @@
       }
     }
 
-    assertEquals(0d, distanceMatrix[0][0]);
+    assertEquals(0.0, distanceMatrix[0][0]);
     assertTrue(distanceMatrix[0][1] < distanceMatrix[0][2]);
 
 

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DummyOutputCollector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DummyOutputCollector.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DummyOutputCollector.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/DummyOutputCollector.java
Sun Mar  8 17:52:18 2009
@@ -32,6 +32,7 @@
 
   final Map<String, List<V>> data = new TreeMap<String, List<V>>();
 
+  @Override
   public void collect(K key, V values)
           throws IOException {
     List<V> points = data.get(key.toString());

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/StringUtilsTest.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/StringUtilsTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/StringUtilsTest.java Sun
Mar  8 17:52:18 2009
@@ -46,9 +46,8 @@
   }
 
   public void testStringConversion() throws Exception {
-    List<String> expected;
 
-    expected = Arrays.asList("A", "B", "C");
+    List<String> expected = Arrays.asList("A", "B", "C");
     assertEquals(expected, StringUtils.fromString(StringUtils
         .toString(expected)));
 

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestEuclideanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestEuclideanDistanceMeasure.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestEuclideanDistanceMeasure.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestEuclideanDistanceMeasure.java
Sun Mar  8 17:52:18 2009
@@ -19,6 +19,7 @@
 
 public class TestEuclideanDistanceMeasure extends DefaultDistanceMeasureTest {
 
+  @Override
   public DistanceMeasure distanceMeasureFactory() {
     return new EuclideanDistanceMeasure();
   }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestManhattanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestManhattanDistanceMeasure.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestManhattanDistanceMeasure.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestManhattanDistanceMeasure.java
Sun Mar  8 17:52:18 2009
@@ -19,6 +19,7 @@
 
 public class TestManhattanDistanceMeasure extends DefaultDistanceMeasureTest {
 
+  @Override
   public DistanceMeasure distanceMeasureFactory() {
     return new ManhattanDistanceMeasure();
   }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestTanimotoDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestTanimotoDistanceMeasure.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestTanimotoDistanceMeasure.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestTanimotoDistanceMeasure.java
Sun Mar  8 17:52:18 2009
@@ -18,6 +18,7 @@
 package org.apache.mahout.utils;
 
 public class TestTanimotoDistanceMeasure extends DefaultWeightedDistanceMeasureTest {
+  @Override
   public TanimotoDistanceMeasure distanceMeasureFactory() {
     return new TanimotoDistanceMeasure();
   }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedEuclideanDistanceMeasureTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedEuclideanDistanceMeasureTest.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedEuclideanDistanceMeasureTest.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedEuclideanDistanceMeasureTest.java
Sun Mar  8 17:52:18 2009
@@ -18,6 +18,7 @@
 package org.apache.mahout.utils;
 
 public class TestWeightedEuclideanDistanceMeasureTest extends DefaultWeightedDistanceMeasureTest
{
+  @Override
   public WeightedDistanceMeasure distanceMeasureFactory() {
     return new WeightedEuclideanDistanceMeasure();
   }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedManhattanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedManhattanDistanceMeasure.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedManhattanDistanceMeasure.java
(original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/utils/TestWeightedManhattanDistanceMeasure.java
Sun Mar  8 17:52:18 2009
@@ -20,6 +20,7 @@
 public class TestWeightedManhattanDistanceMeasure extends DefaultWeightedDistanceMeasureTest
{
 
 
+  @Override
   public WeightedManhattanDistanceMeasure distanceMeasureFactory() {
     return new WeightedManhattanDistanceMeasure();
   }

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java
(original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java
Sun Mar  8 17:52:18 2009
@@ -109,7 +109,7 @@
       int crosspnts, double mutrate, double mutrange, int mutprec, int popSize,
       int genCount) throws IOException {
     Path inpath = new Path(dataset);
-    CDMahoutEvaluator.InitializeDataSet(inpath);
+    CDMahoutEvaluator.initializeDataSet(inpath);
 
     // Candidate Factory
     CandidateFactory<CDRule> factory = new CDFactory(threshold);

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java
(original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java
Sun Mar  8 17:52:18 2009
@@ -86,7 +86,7 @@
    * @param inpath input path (the dataset)
    * @throws IOException
    */
-  public static void InitializeDataSet(Path inpath) throws IOException {
+  public static void initializeDataSet(Path inpath) throws IOException {
     JobConf conf = new JobConf(CDMahoutEvaluator.class);
     FileSystem fs = FileSystem.get(conf);
 

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java?rev=751482&r1=751481&r2=751482&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
(original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
Sun Mar  8 17:52:18 2009
@@ -44,7 +44,7 @@
 
     // dataset
     Path input = new Path("target/test-classes/wdbc");
-    CDMahoutEvaluator.InitializeDataSet(input);
+    CDMahoutEvaluator.initializeDataSet(input);
 
     // evaluate the rules
     List<CDFitness> results = new ArrayList<CDFitness>();



Mime
View raw message