mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r707606 [3/4] - in /lucene/mahout/trunk: ./ core/src/main/java/org/apache/mahout/cf/taste/hadoop/ core/src/main/java/org/apache/mahout/cf/taste/impl/common/ core/src/main/java/org/apache/mahout/cf/taste/impl/model/ core/src/main/java/org/ap...
Date Fri, 24 Oct 2008 11:47:45 GMT
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/AbstractVector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/AbstractVector.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/AbstractVector.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/AbstractVector.java Fri Oct 24 04:47:42 2008
@@ -25,48 +25,18 @@
  */
 public abstract class AbstractVector implements Vector, Writable {
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#asFormatString()
-   */
   public abstract WritableComparable asWritableComparable();
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#cardinality()
-   */
   public abstract int cardinality();
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#copy()
-   */
   public abstract Vector copy();
 
   public abstract boolean haveSharedCells(Vector other);
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#getQuick(int)
-   */
   public abstract double getQuick(int index);
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#like()
-   */
   public abstract Vector like();
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#like(int)
-   */
   public abstract Vector like(int cardinality);
 
   /**
@@ -80,34 +50,13 @@
    */
   protected abstract Matrix matrixLike(int rows, int columns);
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#setQuick(int, double)
-   */
   public abstract void setQuick(int index, double value);
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#size()
-   */
   public abstract int size();
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#toArray()
-   */
   public abstract double[] toArray();
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#viewPart(int, int)
-   */
-  public abstract Vector viewPart(int offset, int length)
-      throws CardinalityException, IndexException;
+  public abstract Vector viewPart(int offset, int length);
 
   /**
    * Returns an iterator for traversing the Vector, but not in any particular
@@ -119,11 +68,6 @@
    */
   public abstract java.util.Iterator<Vector.Element> iterator();
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#getElement
-   */
   // @Override JDK 1.6
   public Vector.Element getElement(int index) {
     return new Element(index);
@@ -149,11 +93,6 @@
     }
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#normalize(double)
-   */
   public Vector divide(double x) {
     Vector result = copy();
     for (int i = 0; i < result.cardinality(); i++)
@@ -161,12 +100,7 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#dot(org.apache.mahout.matrix.Vector)
-   */
-  public double dot(Vector x) throws CardinalityException {
+  public double dot(Vector x) {
     if (cardinality() != x.cardinality())
       throw new CardinalityException();
     double result = 0;
@@ -175,24 +109,14 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#get(int)
-   */
-  public double get(int index) throws IndexException {
+  public double get(int index) {
     if (index >= 0 && index < cardinality())
       return getQuick(index);
     else
       throw new IndexException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#minus(org.apache.mahout.matrix.Vector)
-   */
-  public Vector minus(Vector x) throws CardinalityException {
+  public Vector minus(Vector x) {
     if (cardinality() != x.cardinality())
       throw new CardinalityException();
     Vector result = copy();
@@ -201,26 +125,11 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#normalize()
-   */
   public Vector normalize() {
-    double divSq = 0;
-    try {
-      divSq = Math.sqrt(dot(this));
-    } catch (CardinalityException e) {
-      // cannot occur with dot(this)
-    }
+    double divSq = Math.sqrt(dot(this));
     return divide(divSq);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#plus(double)
-   */
   public Vector plus(double x) {
     Vector result = copy();
     for (int i = 0; i < result.cardinality(); i++)
@@ -228,12 +137,7 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#plus(org.apache.mahout.matrix.Vector)
-   */
-  public Vector plus(Vector x) throws CardinalityException {
+  public Vector plus(Vector x) {
     if (cardinality() != x.cardinality())
       throw new CardinalityException();
     Vector result = copy();
@@ -242,23 +146,13 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#set(int, double)
-   */
-  public void set(int index, double value) throws IndexException {
+  public void set(int index, double value) {
     if (index >= 0 && index < cardinality())
       setQuick(index, value);
     else
       throw new IndexException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#times(double)
-   */
   public Vector times(double x) {
     Vector result = copy();
     for (int i = 0; i < result.cardinality(); i++)
@@ -266,12 +160,7 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#times(org.apache.mahout.matrix.Vector)
-   */
-  public Vector times(Vector x) throws CardinalityException {
+  public Vector times(Vector x) {
     if (cardinality() != x.cardinality())
       throw new CardinalityException();
     Vector result = copy();
@@ -280,11 +169,6 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#zSum()
-   */
   public double zSum() {
     double result = 0;
     for (int i = 0; i < cardinality(); i++)
@@ -292,23 +176,13 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#assign(double)
-   */
   public Vector assign(double value) {
     for (int i = 0; i < cardinality(); i++)
       setQuick(i, value);
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#assign(double[])
-   */
-  public Vector assign(double[] values) throws CardinalityException {
+  public Vector assign(double[] values) {
     if (values.length != cardinality())
       throw new CardinalityException();
     for (int i = 0; i < cardinality(); i++)
@@ -316,12 +190,7 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#assign(org.apache.mahout.matrix.Vector)
-   */
-  public Vector assign(Vector other) throws CardinalityException {
+  public Vector assign(Vector other) {
     if (other.cardinality() != cardinality())
       throw new CardinalityException();
     for (int i = 0; i < cardinality(); i++)
@@ -329,9 +198,6 @@
     return this;
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.mahout.matrix.Vector#assign(org.apache.mahout.matrix.BinaryFunction, double)
-   */
   public Vector assign(BinaryFunction f, double y) {
     for (int i = 0; i < cardinality(); i++) {
       setQuick(i, f.apply(getQuick(i), y));
@@ -339,25 +205,13 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#assign(org.apache.mahout.utils.matrix.DoubleFunction)
-   */
   public Vector assign(UnaryFunction function) {
     for (int i = 0; i < cardinality(); i++)
       setQuick(i, function.apply(getQuick(i)));
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#assign(org.apache.mahout.matrix.Vector,
-   *      org.apache.mahout.utils.matrix.DoubleDoubleFunction)
-   */
-  public Vector assign(Vector other, BinaryFunction function)
-      throws CardinalityException {
+  public Vector assign(Vector other, BinaryFunction function) {
     if (other.cardinality() != cardinality())
       throw new CardinalityException();
     for (int i = 0; i < cardinality(); i++)
@@ -365,27 +219,13 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#cross(org.apache.mahout.matrix.Vector)
-   */
   public Matrix cross(Vector other) {
     Matrix result = matrixLike(cardinality(), other.cardinality());
     for (int row = 0; row < cardinality(); row++)
-      try {
-        result.assignRow(row, other.times(getQuick(row)));
-      } catch (CardinalityException e) {
-        // cannot happen since result is other's cardinality
-      }
+      result.assignRow(row, other.times(getQuick(row)));
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.Vector#asFormatString()
-   */
   public abstract String asFormatString();
 
   /**

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/CardinalityException.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/CardinalityException.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/CardinalityException.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/CardinalityException.java Fri Oct 24 04:47:42 2008
@@ -19,10 +19,7 @@
 
 /**
  * Exception thrown when there is a cardinality mismatch in matrix operations
- * 
  */
 public class CardinalityException extends RuntimeException {
 
-  private static final long serialVersionUID = 1L;
-
 }

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseMatrix.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseMatrix.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseMatrix.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseMatrix.java Fri Oct 24 04:47:42 2008
@@ -62,21 +62,11 @@
     this.values = new double[rows][columns];
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public WritableComparable asWritableComparable() {
     return new Text(asFormatString());
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public String asFormatString() {
     StringBuilder out = new StringBuilder();
@@ -90,11 +80,6 @@
     return out.toString();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#cardinality()
-   */
   @Override
   public int[] cardinality() {
     int[] result = new int[2];
@@ -103,31 +88,16 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#copy()
-   */
   @Override
   public Matrix copy() {
     return new DenseMatrix(values);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getQuick(int, int)
-   */
   @Override
   public double getQuick(int row, int column) {
     return values[row][column];
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#haveSharedCells(org.apache.mahout.matrix.Matrix)
-   */
   @Override
   public boolean haveSharedCells(Matrix other) {
     if (other instanceof DenseMatrix)
@@ -136,65 +106,34 @@
       return other.haveSharedCells(this);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like()
-   */
   @Override
   public Matrix like() {
     return like(rowSize(), columnSize());
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like(int, int)
-   */
   @Override
   public Matrix like(int rows, int columns) {
     return new DenseMatrix(rows, columns);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#setQuick(int, int, double)
-   */
   @Override
   public void setQuick(int row, int column, double value) {
     values[row][column] = value;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#size()
-   */
   @Override
   public int[] size() {
     return cardinality();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#toArray()
-   */
   @Override
   public double[][] toArray() {
     DenseMatrix result = new DenseMatrix(values);
     return result.values;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#viewPart(int[], int[])
-   */
   @Override
-  public Matrix viewPart(int[] offset, int[] size) throws CardinalityException,
-      IndexException {
+  public Matrix viewPart(int[] offset, int[] size) {
     if (size[ROW] > rowSize() || size[COL] > columnSize())
       throw new CardinalityException();
     if (offset[ROW] < 0 || offset[ROW] + size[ROW] > rowSize()
@@ -203,15 +142,8 @@
     return new MatrixView(this, offset, size);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignColumn(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignColumn(int column, Vector other)
-      throws CardinalityException {
+  public Matrix assignColumn(int column, Vector other) {
     if (other.cardinality() != rowSize() || column >= columnSize())
       throw new CardinalityException();
     for (int row = 0; row < rowSize(); row++)
@@ -219,27 +151,16 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignRow(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignRow(int row, Vector other) throws CardinalityException {
+  public Matrix assignRow(int row, Vector other) {
     if (row >= rowSize() || other.cardinality() != columnSize())
       throw new CardinalityException();
     values[row] = other.toArray();
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getColumn(int)
-   */
   @Override
-  public Vector getColumn(int column) throws IndexException {
+  public Vector getColumn(int column) {
     if (column < 0 || column >= columnSize())
       throw new IndexException();
     double[] col = new double[rowSize()];
@@ -248,13 +169,8 @@
     return new DenseVector(col);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getRow(int)
-   */
   @Override
-  public Vector getRow(int row) throws IndexException {
+  public Vector getRow(int row) {
     if (row < 0 || row >= rowSize())
       throw new IndexException();
     return new DenseVector(values[row]);

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseVector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseVector.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseVector.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/DenseVector.java Fri Oct 24 04:47:42 2008
@@ -142,8 +142,7 @@
   }
 
   @Override
-  public Vector viewPart(int offset, int length) throws CardinalityException,
-      IndexException {
+  public Vector viewPart(int offset, int length) {
     if (length > values.length)
       throw new CardinalityException();
     if (offset < 0 || offset + length > values.length)

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/IndexException.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/IndexException.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/IndexException.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/IndexException.java Fri Oct 24 04:47:42 2008
@@ -19,10 +19,7 @@
 
 /**
  * Exception thrown when there is an index outside of [0, cardinality)
- * 
  */
 public class IndexException extends RuntimeException {
 
-  private static final long serialVersionUID = 1L;
-
 }

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Matrix.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Matrix.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Matrix.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Matrix.java Fri Oct 24 04:47:42 2008
@@ -52,7 +52,7 @@
    * @return the modified receiver
    * @throws CardinalityException if the cardinalities differ
    */
-  Matrix assign(double[][] values) throws CardinalityException;
+  Matrix assign(double[][] values);
 
   /**
    * Assign the other vector values to the receiver
@@ -61,7 +61,7 @@
    * @return the modified receiver
    * @throws CardinalityException if the cardinalities differ
    */
-  Matrix assign(Matrix other) throws CardinalityException;
+  Matrix assign(Matrix other);
 
   /**
    * Apply the function to each element of the receiver
@@ -80,8 +80,7 @@
    * @return the modified receiver
    * @throws CardinalityException if the cardinalities differ
    */
-  Matrix assign(Matrix other, BinaryFunction function)
-      throws CardinalityException;
+  Matrix assign(Matrix other, BinaryFunction function);
 
   /**
    * Assign the other vector values to the column of the receiver
@@ -92,7 +91,7 @@
    * @return the modified receiver
    * @throws CardinalityException if the cardinalities differ
    */
-  Matrix assignColumn(int column, Vector other) throws CardinalityException;
+  Matrix assignColumn(int column, Vector other);
 
   /**
    * Assign the other vector values to the row of the receiver
@@ -103,7 +102,7 @@
    * @return the modified receiver
    * @throws CardinalityException if the cardinalities differ
    */
-  Matrix assignRow(int row, Vector other) throws CardinalityException;
+  Matrix assignRow(int row, Vector other);
 
   /**
    * Return the cardinality of the recipient (the maximum number of values)
@@ -143,7 +142,7 @@
    * @return the double at the index
    * @throws IndexException if the index is out of bounds
    */
-  double get(int row, int column) throws IndexException;
+  double get(int row, int column);
 
   /**
    * Return the column at the given index
@@ -152,7 +151,7 @@
    * @return a Vector at the index
    * @throws IndexException if the index is out of bounds
    */
-  Vector getColumn(int column) throws IndexException;
+  Vector getColumn(int column);
 
   /**
    * Return the row at the given index
@@ -161,7 +160,7 @@
    * @return a Vector at the index
    * @throws IndexException if the index is out of bounds
    */
-  Vector getRow(int row) throws IndexException;
+  Vector getRow(int row);
 
   /**
    * Return the value at the given indexes, without checking bounds
@@ -205,7 +204,7 @@
    * @return a new Matrix
    * @throws CardinalityException if the cardinalities differ
    */
-  Matrix minus(Matrix x) throws CardinalityException;
+  Matrix minus(Matrix x);
 
   /**
    * Return a new matrix containing the sum of each value of the recipient and
@@ -224,7 +223,7 @@
    * @return a new Matrix
    * @throws CardinalityException if the cardinalities differ
    */
-  Matrix plus(Matrix x) throws CardinalityException;
+  Matrix plus(Matrix x);
 
   /**
    * Set the value at the given index
@@ -234,9 +233,9 @@
    * @param value a double value to set
    * @throws IndexException if the index is out of bounds
    */
-  void set(int row, int column, double value) throws IndexException;
+  void set(int row, int column, double value);
 
-  void set(int row, double[] data) throws IndexException,CardinalityException; 
+  void set(int row, double[] data);
 
   /**
    * Set the value at the given index, without checking bounds
@@ -271,7 +270,7 @@
    * @return a new Matrix
    * @throws CardinalityException if the cardinalities are incompatible
    */
-  Matrix times(Matrix x) throws CardinalityException;
+  Matrix times(Matrix x);
 
   /**
    * Return a new matrix that is the transpose of the receiver
@@ -298,8 +297,7 @@
    * @throws IndexException if the offset is negative or the offset+length is
    *         outside of the receiver
    */
-  Matrix viewPart(int[] offset, int[] size) throws CardinalityException,
-      IndexException;
+  Matrix viewPart(int[] offset, int[] size);
 
   /**
    * Return the sum of all the elements of the receiver

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/MatrixView.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/MatrixView.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/MatrixView.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/MatrixView.java Fri Oct 24 04:47:42 2008
@@ -50,22 +50,12 @@
     this.cardinality = cardinality;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public WritableComparable asWritableComparable() {
     String out = asFormatString();
     return new Text(out);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public String asFormatString() {
     StringBuilder out = new StringBuilder();
@@ -80,82 +70,42 @@
     return out.toString();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#cardinality()
-   */
   @Override
   public int[] cardinality() {
     return cardinality;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#copy()
-   */
   @Override
   public Matrix copy() {
     return new MatrixView(matrix.copy(), offset, cardinality);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getQuick(int, int)
-   */
   @Override
   public double getQuick(int row, int column) {
     return matrix.getQuick(offset[ROW] + row, offset[COL] + column);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like()
-   */
   @Override
   public Matrix like() {
     return matrix.like(cardinality[ROW], cardinality[COL]);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like(int, int)
-   */
   @Override
   public Matrix like(int rows, int columns) {
 
     return matrix.like(rows, columns);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#setQuick(int, int, double)
-   */
   @Override
   public void setQuick(int row, int column, double value) {
     matrix.setQuick(offset[ROW] + row, offset[COL] + column, value);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#size()
-   */
   @Override
   public int[] size() {
     return cardinality;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#toArray()
-   */
   @Override
   public double[][] toArray() {
     double[][] result = new double[cardinality[ROW]][cardinality[COL]];
@@ -167,8 +117,7 @@
   }
 
   @Override
-  public Matrix viewPart(int[] offset, int[] size) throws CardinalityException,
-      IndexException {
+  public Matrix viewPart(int[] offset, int[] size) {
     if (size[ROW] > cardinality[ROW] || size[COL] > cardinality[COL])
       throw new CardinalityException();
     if ((offset[ROW] < ROW || offset[ROW] + size[ROW] > cardinality[ROW])
@@ -180,11 +129,6 @@
     return new MatrixView(matrix, origin, size);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#haveSharedCells(org.apache.mahout.matrix.Matrix)
-   */
   @Override
   public boolean haveSharedCells(Matrix other) {
     if (other instanceof MatrixView)
@@ -193,15 +137,8 @@
       return other.haveSharedCells(matrix);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignColumn(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignColumn(int column, Vector other)
-      throws CardinalityException {
+  public Matrix assignColumn(int column, Vector other) {
     if (cardinality[ROW] != other.cardinality())
       throw new CardinalityException();
     for (int row = 0; row < cardinality[ROW]; row++)
@@ -210,14 +147,8 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignRow(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignRow(int row, Vector other) throws CardinalityException {
+  public Matrix assignRow(int row, Vector other) {
     if (cardinality[COL] != other.cardinality())
       throw new CardinalityException();
     for (int col = 0; col < cardinality[COL]; col++)
@@ -226,26 +157,16 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getColumn(int)
-   */
   @Override
-  public Vector getColumn(int column) throws IndexException {
+  public Vector getColumn(int column) {
     if (column < 0 || column >= cardinality[COL])
       throw new IndexException();
     return new VectorView(matrix.getColumn(column + offset[COL]), offset[ROW],
         cardinality[ROW]);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getRow(int)
-   */
   @Override
-  public Vector getRow(int row) throws IndexException {
+  public Vector getRow(int row) {
     if (row < 0 || row >= cardinality[ROW])
       throw new IndexException();
     return new VectorView(matrix.getRow(row + offset[ROW]), offset[COL],

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseColumnMatrix.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseColumnMatrix.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseColumnMatrix.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseColumnMatrix.java Fri Oct 24 04:47:42 2008
@@ -60,22 +60,12 @@
       this.columns[col] = new SparseVector(cardinality[ROW]);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public WritableComparable asWritableComparable() {
     String out = asFormatString();
     return new Text(out);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public String asFormatString() {
     StringBuilder out = new StringBuilder();
@@ -89,21 +79,11 @@
     return out.toString();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#cardinality()
-   */
   @Override
   public int[] cardinality() {
     return cardinality;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#copy()
-   */
   @Override
   public Matrix copy() {
     SparseColumnMatrix copy = new SparseColumnMatrix(cardinality);
@@ -112,11 +92,6 @@
     return copy;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getQuick(int, int)
-   */
   @Override
   public double getQuick(int row, int column) {
     if (columns[column] == null)
@@ -125,11 +100,6 @@
       return columns[column].getQuick(row);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#haveSharedCells(org.apache.mahout.matrix.Matrix)
-   */
   @Override
   public boolean haveSharedCells(Matrix other) {
     if (other instanceof SparseColumnMatrix)
@@ -137,21 +107,12 @@
     return other.haveSharedCells(this);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like()
-   */
   @Override
   public Matrix like() {
     return new SparseColumnMatrix(cardinality);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like(int, int)
-   */
+
   @Override
   public Matrix like(int rows, int columns) {
     int[] c = new int[2];
@@ -160,11 +121,6 @@
     return new SparseColumnMatrix(c);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#setQuick(int, int, double)
-   */
   @Override
   public void setQuick(int row, int column, double value) {
     if (columns[column] == null)
@@ -172,11 +128,6 @@
     columns[column].setQuick(row, value);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#size()
-   */
   @Override
   public int[] size() {
     int[] result = new int[2];
@@ -186,11 +137,6 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#toArray()
-   */
   @Override
   public double[][] toArray() {
     double[][] result = new double[cardinality[ROW]][cardinality[COL]];
@@ -200,14 +146,8 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#viewPart(int[], int[])
-   */
   @Override
-  public Matrix viewPart(int[] offset, int[] size) throws CardinalityException,
-      IndexException {
+  public Matrix viewPart(int[] offset, int[] size) {
     if (size[COL] > columns.length || size[ROW] > columns[COL].cardinality())
       throw new CardinalityException();
     if (offset[COL] < 0 || offset[COL] + size[COL] > columns.length
@@ -217,29 +157,16 @@
     return new MatrixView(this, offset, size);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignColumn(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignColumn(int column, Vector other)
-      throws CardinalityException {
+  public Matrix assignColumn(int column, Vector other) {
     if (other.cardinality() != cardinality[ROW] || column >= cardinality[COL])
       throw new CardinalityException();
     columns[column].assign(other);
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignRow(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignRow(int row, Vector other) throws CardinalityException {
+  public Matrix assignRow(int row, Vector other) {
     if (row >= cardinality[ROW] || other.cardinality() != cardinality[COL])
       throw new CardinalityException();
     for (int col = 0; col < cardinality[COL]; col++)
@@ -247,25 +174,15 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getColumn(int)
-   */
   @Override
-  public Vector getColumn(int column) throws IndexException {
+  public Vector getColumn(int column) {
     if (column < 0 || column >= cardinality[COL])
       throw new IndexException();
     return columns[column];
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getRow(int)
-   */
   @Override
-  public Vector getRow(int row) throws IndexException {
+  public Vector getRow(int row) {
     if (row < 0 || row >= cardinality[ROW])
       throw new IndexException();
     double[] d = new double[cardinality[COL]];

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseMatrix.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseMatrix.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseMatrix.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseMatrix.java Fri Oct 24 04:47:42 2008
@@ -60,22 +60,12 @@
     this.rows = new HashMap<Integer, Vector>();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public WritableComparable asWritableComparable() {
     String out = asFormatString();
     return new Text(out);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public String asFormatString() {
     StringBuilder out = new StringBuilder();
@@ -88,21 +78,11 @@
     return out.toString();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#cardinality()
-   */
   @Override
   public int[] cardinality() {
     return cardinality;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#copy()
-   */
   @Override
   public Matrix copy() {
     SparseMatrix copy = new SparseMatrix(cardinality);
@@ -111,11 +91,6 @@
     return copy;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getQuick(int, int)
-   */
   @Override
   public double getQuick(int row, int column) {
     Vector r = rows.get(row);
@@ -125,11 +100,6 @@
       return r.getQuick(column);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#haveSharedCells(org.apache.mahout.matrix.Matrix)
-   */
   @Override
   public boolean haveSharedCells(Matrix other) {
     if (other instanceof SparseMatrix)
@@ -138,34 +108,19 @@
       return other.haveSharedCells(this);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like()
-   */
   @Override
   public Matrix like() {
     return new SparseMatrix(cardinality);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like(int, int)
-   */
   @Override
   public Matrix like(int rows, int columns) {
     return new SparseMatrix(new int[] { rows, columns });
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#setQuick(int, int, double)
-   */
   @Override
   public void setQuick(int row, int column, double value) {
-    Integer rowKey = Integer.valueOf(row);
+    Integer rowKey = row;
     Vector r = rows.get(rowKey);
     if (r == null) {
       r = new SparseVector(cardinality[COL]);
@@ -174,11 +129,6 @@
     r.setQuick(column, value);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#size()
-   */
   @Override
   public int[] size() {
     int[] result = new int[2];
@@ -188,11 +138,6 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#toArray()
-   */
   @Override
   public double[][] toArray() {
     double[][] result = new double[cardinality[ROW]][cardinality[COL]];
@@ -202,14 +147,8 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#viewPart(int[], int[])
-   */
   @Override
-  public Matrix viewPart(int[] offset, int[] size) throws CardinalityException,
-      IndexException {
+  public Matrix viewPart(int[] offset, int[] size) {
     if (size[ROW] > cardinality[ROW] || size[COL] > cardinality[COL])
       throw new CardinalityException();
     if (offset[ROW] < 0 || offset[ROW] + size[ROW] > cardinality[ROW]
@@ -218,21 +157,14 @@
     return new MatrixView(this, offset, size);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignColumn(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignColumn(int column, Vector other)
-      throws CardinalityException {
+  public Matrix assignColumn(int column, Vector other) {
     if (other.cardinality() != cardinality[ROW] || column >= cardinality[COL])
       throw new CardinalityException();
     for (int row = 0; row < cardinality[ROW]; row++) {
       double val = other.getQuick(row);
       if (val != 0.0) {
-        Integer rowKey = Integer.valueOf(row);
+        Integer rowKey = row;
         Vector r = rows.get(rowKey);
         if (r == null) {
           r = new SparseVector(cardinality[ROW]);
@@ -244,27 +176,16 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignRow(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignRow(int row, Vector other) throws CardinalityException {
+  public Matrix assignRow(int row, Vector other) {
     if (row >= cardinality[ROW] || other.cardinality() != cardinality[COL])
       throw new CardinalityException();
     rows.put(row, other);
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getColumn(int)
-   */
   @Override
-  public Vector getColumn(int column) throws IndexException {
+  public Vector getColumn(int column) {
     if (column < 0 || column >= cardinality[COL])
       throw new IndexException();
     double[] d = new double[cardinality[ROW]];
@@ -273,13 +194,8 @@
     return new DenseVector(d);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getRow(int)
-   */
   @Override
-  public Vector getRow(int row) throws IndexException {
+  public Vector getRow(int row) {
     if (row < 0 || row >= cardinality[ROW])
       throw new IndexException();
     Vector res = rows.get(row);

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseRowMatrix.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseRowMatrix.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseRowMatrix.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseRowMatrix.java Fri Oct 24 04:47:42 2008
@@ -59,22 +59,12 @@
       this.rows[row] = new SparseVector(cardinality[COL]);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public WritableComparable asWritableComparable() {
     String out = asFormatString();
     return new Text(out);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#asFormatString()
-   */
   @Override
   public String asFormatString() {
     StringBuilder out = new StringBuilder();
@@ -88,21 +78,11 @@
     return out.toString();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#cardinality()
-   */
   @Override
   public int[] cardinality() {
     return cardinality;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#copy()
-   */
   @Override
   public Matrix copy() {
     SparseRowMatrix copy = new SparseRowMatrix(cardinality);
@@ -111,11 +91,6 @@
     return copy;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getQuick(int, int)
-   */
   @Override
   public double getQuick(int row, int column) {
     if (rows[row] == null)
@@ -124,11 +99,6 @@
       return rows[row].getQuick(column);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#haveSharedCells(org.apache.mahout.matrix.Matrix)
-   */
   @Override
   public boolean haveSharedCells(Matrix other) {
     if (other instanceof SparseRowMatrix)
@@ -136,21 +106,11 @@
     return other.haveSharedCells(this);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like()
-   */
   @Override
   public Matrix like() {
     return new SparseRowMatrix(cardinality);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#like(int, int)
-   */
   @Override
   public Matrix like(int rows, int columns) {
     int[] c = new int[2];
@@ -159,21 +119,11 @@
     return new SparseRowMatrix(c);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#setQuick(int, int, double)
-   */
   @Override
   public void setQuick(int row, int column, double value) {
     rows[row].setQuick(column, value);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#size()
-   */
   @Override
   public int[] size() {
     int[] result = new int[2];
@@ -183,11 +133,6 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#toArray()
-   */
   @Override
   public double[][] toArray() {
     double[][] result = new double[cardinality[ROW]][cardinality[COL]];
@@ -197,14 +142,8 @@
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#viewPart(int[], int[])
-   */
   @Override
-  public Matrix viewPart(int[] offset, int[] size) throws CardinalityException,
-      IndexException {
+  public Matrix viewPart(int[] offset, int[] size) {
     if (size[ROW] > rows.length || size[COL] > rows[ROW].cardinality())
       throw new CardinalityException();
     if (offset[ROW] < 0 || offset[ROW] + size[ROW] > rows.length
@@ -213,15 +152,8 @@
     return new MatrixView(this, offset, size);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignColumn(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignColumn(int column, Vector other)
-      throws CardinalityException {
+  public Matrix assignColumn(int column, Vector other) {
     if (other.cardinality() != cardinality[ROW] || column >= cardinality[COL])
       throw new CardinalityException();
     for (int row = 0; row < cardinality[ROW]; row++)
@@ -229,27 +161,16 @@
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#assignRow(int,
-   *      org.apache.mahout.vector.Vector)
-   */
   @Override
-  public Matrix assignRow(int row, Vector other) throws CardinalityException {
+  public Matrix assignRow(int row, Vector other) {
     if (row >= cardinality[ROW] || other.cardinality() != cardinality[COL])
       throw new CardinalityException();
     rows[row].assign(other);
     return this;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getColumn(int)
-   */
   @Override
-  public Vector getColumn(int column) throws IndexException {
+  public Vector getColumn(int column) {
     if (column < 0 || column >= cardinality[COL])
       throw new IndexException();
     double[] d = new double[cardinality[ROW]];
@@ -258,13 +179,8 @@
     return new DenseVector(d);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.matrix.AbstractMatrix#getRow(int)
-   */
   @Override
-  public Vector getRow(int row) throws IndexException {
+  public Vector getRow(int row) {
     if (row < 0 || row >= cardinality[ROW])
       throw new IndexException();
     return rows[row];

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseVector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseVector.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseVector.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/SparseVector.java Fri Oct 24 04:47:42 2008
@@ -97,11 +97,11 @@
   }
 
   @Override
-  @SuppressWarnings("unchecked")
+  @SuppressWarnings("unchecked")  
   public String asFormatString() {
     StringBuilder out = new StringBuilder();
     out.append("[s").append(cardinality).append(", ");
-    Map.Entry<Integer, Double>[] entries = values.entrySet().toArray(new Map.Entry[values.size()]);
+    Map.Entry<Integer, Double>[] entries = (Map.Entry<Integer, Double>[]) values.entrySet().toArray(new Map.Entry[values.size()]);
     Arrays.sort(entries, new Comparator<Map.Entry<Integer, Double>>(){
       public int compare(Map.Entry<Integer, Double> e1, Map.Entry<Integer, Double> e2) {
         return e1.getKey().compareTo(e2.getKey());
@@ -131,10 +131,7 @@
   @Override
   public double getQuick(int index) {
     Double value = values.get(index);
-    if (value == null)
-      return 0.0;
-    else
-      return value;
+    return value == null ? 0.0 : value;
   }
 
   @Override
@@ -160,8 +157,7 @@
   }
 
   @Override
-  public Vector viewPart(int offset, int length) throws CardinalityException,
-      IndexException {
+  public Vector viewPart(int offset, int length) {
     if (length > cardinality)
       throw new CardinalityException();
     if (offset < 0 || offset + length > cardinality)
@@ -239,7 +235,7 @@
   }
 
   @Override
-  public double dot(Vector x) throws CardinalityException {
+  public double dot(Vector x) {
     if (cardinality() != x.cardinality())
       throw new CardinalityException();
     double result = 0.0;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Vector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Vector.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Vector.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/Vector.java Fri Oct 24 04:47:42 2008
@@ -57,7 +57,7 @@
    * @throws CardinalityException
    *             if the cardinalities differ
    */
-  Vector assign(double[] values) throws CardinalityException;
+  Vector assign(double[] values);
 
   /**
    * Assign the other matrix values to the receiver
@@ -68,7 +68,7 @@
    * @throws CardinalityException
    *             if the cardinalities differ
    */
-  Vector assign(Vector other) throws CardinalityException;
+  Vector assign(Vector other);
 
   /**
    * Apply the function to each element of the receiver
@@ -91,8 +91,7 @@
    * @throws CardinalityException
    *             if the cardinalities differ
    */
-  Vector assign(Vector other, BinaryFunction function)
-      throws CardinalityException;
+  Vector assign(Vector other, BinaryFunction function);
 
   /**
    * Apply the function to each element of the receiver, using the y value as
@@ -165,7 +164,7 @@
    * @throws CardinalityException
    *             if the cardinalities differ
    */
-  double dot(Vector x) throws CardinalityException;
+  double dot(Vector x);
 
   /**
    * Return the value at the given index
@@ -176,7 +175,7 @@
    * @throws IndexException
    *             if the index is out of bounds
    */
-  double get(int index) throws IndexException;
+  double get(int index);
 
   /**
    * Return the value at the given index, without checking bounds
@@ -223,7 +222,7 @@
    * @throws CardinalityException
    *             if the cardinalities differ
    */
-  Vector minus(Vector x) throws CardinalityException;
+  Vector minus(Vector x);
 
   /**
    * Return a new matrix containing the normalized values of the recipient
@@ -252,7 +251,7 @@
    * @throws CardinalityException
    *             if the cardinalities differ
    */
-  Vector plus(Vector x) throws CardinalityException;
+  Vector plus(Vector x);
 
   /**
    * Set the value at the given index
@@ -264,7 +263,7 @@
    * @throws IndexException
    *             if the index is out of bounds
    */
-  void set(int index, double value) throws IndexException;
+  void set(int index, double value);
 
   /**
    * Set the value at the given index, without checking bounds
@@ -303,7 +302,7 @@
    * @throws CardinalityException
    *             if the cardinalities differ
    */
-  Vector times(Vector x) throws CardinalityException;
+  Vector times(Vector x);
 
   /**
    * Return the element of the recipient as a double[]
@@ -326,8 +325,7 @@
    *             if the offset is negative or the offset+length is outside of
    *             the receiver
    */
-  Vector viewPart(int offset, int length) throws CardinalityException,
-      IndexException;
+  Vector viewPart(int offset, int length);
 
   /**
    * Return the sum of all the elements of the receiver

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/VectorView.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/VectorView.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/VectorView.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/matrix/VectorView.java Fri Oct 24 04:47:42 2008
@@ -24,6 +24,7 @@
 import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Iterator;
+import java.nio.charset.Charset;
 
 /**
  * Implements subset view of a Vector
@@ -114,8 +115,7 @@
   }
 
   @Override
-  public Vector viewPart(int offset, int length) throws CardinalityException,
-      IndexException {
+  public Vector viewPart(int offset, int length) {
     if (length > cardinality)
       throw new CardinalityException();
     if (offset < 0 || offset + length > cardinality)
@@ -131,9 +131,8 @@
       return other.haveSharedCells(vector);
   }
 
-  /*
-   * (Non-Javadoc) Returns true if index is a valid index in the underlying
-   * Vector
+  /**
+   * @return true if index is a valid index in the underlying Vector
    */
   private boolean isInView(int index) {
     return index >= offset && index < offset + cardinality;
@@ -211,7 +210,7 @@
     int cardinality = dataInput.readInt();
     byte[] buf = new byte[dataInput.readInt()];
     dataInput.readFully(buf);
-    String vectorClassName = new String(buf);
+    String vectorClassName = new String(buf, Charset.forName("UTF-8"));
     Vector vector;
     try {
       vector = Class.forName(vectorClassName).asSubclass(Vector.class).newInstance();

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/DistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/DistanceMeasure.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/DistanceMeasure.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/DistanceMeasure.java Fri Oct 24 04:47:42 2008
@@ -36,6 +36,6 @@
    * @return a scalar doubles of the distance
    * @throws CardinalityException
    */
-  public double distance(Vector v1, Vector v2) throws CardinalityException;
+  public double distance(Vector v1, Vector v2);
 
 }

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/EuclideanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/EuclideanDistanceMeasure.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/EuclideanDistanceMeasure.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/EuclideanDistanceMeasure.java Fri Oct 24 04:47:42 2008
@@ -31,16 +31,10 @@
  */
 public class EuclideanDistanceMeasure implements DistanceMeasure {
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.hadoop.mapred.JobConfigurable#configure(org.apache.hadoop.mapred.JobConf)
-   */
   public void configure(JobConf job) {
     // nothing to do
   }
 
-
   public Collection<Parameter> getParameters() {
     return Collections.emptyList();
   }
@@ -49,29 +43,16 @@
     // nothing to do
   }
 
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.clustering.canopy.DistanceMeasure#distance(java.lang.Float[],
-   *      java.lang.Float[])
-   */
-  public float distance(Float[] p1, Float[] p2) {
-    float result = 0;
+  public double distance(double[] p1, double[] p2) {
+    double result = 0.0;
     for (int i = 0; i < p1.length; i++) {
-      float delta = p2[i] - p1[i];
+      double delta = p2[i] - p1[i];
       result += delta * delta;
     }
-    return (float) Math.sqrt(result);
+    return Math.sqrt(result);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.utils.DistanceMeasure#distance(org.apache.mahout.matrix.Vector,
-   *      org.apache.mahout.matrix.Vector)
-   */
-  public double distance(Vector v1, Vector v2) throws CardinalityException {
+  public double distance(Vector v1, Vector v2) {
     if (v1.cardinality() != v2.cardinality())
       throw new CardinalityException();
     double result = 0;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/ManhattanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/ManhattanDistanceMeasure.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/ManhattanDistanceMeasure.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/ManhattanDistanceMeasure.java Fri Oct 24 04:47:42 2008
@@ -31,24 +31,13 @@
  */
 public class ManhattanDistanceMeasure implements DistanceMeasure {
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.clustering.canopy.DistanceMeasure#distance(java.lang.Float[],
-   *      java.lang.Float[])
-   */
-  public float distance(Float[] p1, Float[] p2) {
-    float result = 0;
+  public 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]);
     return result;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.hadoop.mapred.JobConfigurable#createParameters(org.apache.hadoop.mapred.JobConf)
-   */
   public void configure(JobConf job) {
     // nothing to do
   }
@@ -61,13 +50,7 @@
     // nothing to do
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.utils.DistanceMeasure#distance(org.apache.mahout.matrix.Vector,
-   *      org.apache.mahout.matrix.Vector)
-   */
- public double distance(Vector v1, Vector v2) throws CardinalityException {
+ public double distance(Vector v1, Vector v2) {
     if (v1.cardinality() != v2.cardinality())
       throw new CardinalityException();
     double result = 0;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/StringUtils.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/StringUtils.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/StringUtils.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/StringUtils.java Fri Oct 24 04:47:42 2008
@@ -27,6 +27,10 @@
 public class StringUtils {
 
   private static final XStream xstream = new XStream();
+
+  private StringUtils() {
+    // do nothing
+  }
   
   /**
    * Converts the object to a one-line string representation

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/TanimotoDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/TanimotoDistanceMeasure.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/TanimotoDistanceMeasure.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/TanimotoDistanceMeasure.java Fri Oct 24 04:47:42 2008
@@ -58,13 +58,7 @@
 
         double a = feature.get();
 
-        Double bValue = vector1.get(feature.index());
-        double b;
-        if (bValue == null) {
-          b = 0.0;
-        } else {
-          b = bValue;
-        }
+        double b = vector1.get(feature.index());
 
         Vector weights = getWeights();
         double weight = weights == null ? 1.0 : weights.get(feature.index());
@@ -79,13 +73,7 @@
     for (Vector.Element feature : vector1) {
       if (!featuresSeen.add(feature.index())) {
 
-        Double aValue = vector0.get(feature.index());
-        double a;
-        if (aValue == null) {
-          a = 0.0;
-        } else {
-          a = aValue;
-        }
+        double a = vector0.get(feature.index());
 
         double b = feature.get();
 
@@ -98,7 +86,7 @@
       }
     }
 
-    return (float)((a2 + b2 - ab) / ab) - 1;
+    return ((a2 + b2 - ab) / ab) - 1.0;
   }
 
 }

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedEuclideanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedEuclideanDistanceMeasure.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedEuclideanDistanceMeasure.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedEuclideanDistanceMeasure.java Fri Oct 24 04:47:42 2008
@@ -25,9 +25,6 @@
  */
 public class WeightedEuclideanDistanceMeasure extends WeightedDistanceMeasure {
 
-  /* (non-Javadoc)
-   * @see org.apache.mahout.utils.DistanceMeasure#distance(org.apache.mahout.matrix.Vector, org.apache.mahout.matrix.Vector)
-   */
   public double distance(Vector p1, Vector p2) {
     double result = 0;
     Vector res = p2.minus(p1);

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedManhattanDistanceMeasure.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedManhattanDistanceMeasure.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedManhattanDistanceMeasure.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/WeightedManhattanDistanceMeasure.java Fri Oct 24 04:47:42 2008
@@ -25,10 +25,6 @@
  */
 public class WeightedManhattanDistanceMeasure extends WeightedDistanceMeasure {
 
-  /* (non-Javadoc)
-   * @see org.apache.mahout.utils.DistanceMeasure#distance(org.apache.mahout.matrix.Vector,
-   * org.apache.mahout.matrix.Vector)
-   */
   public double distance(Vector p1, Vector p2) {
     double result = 0;
 

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/DoubleParameter.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/DoubleParameter.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/DoubleParameter.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/DoubleParameter.java Fri Oct 24 04:47:42 2008
@@ -21,7 +21,7 @@
 
 public class DoubleParameter extends AbstractParameter<Double> {
 
-  public DoubleParameter(String prefix, String name, JobConf jobConf, Double defaultValue, String description) {
+  public DoubleParameter(String prefix, String name, JobConf jobConf, double defaultValue, String description) {
     super(Double.class, prefix, name, jobConf, defaultValue, description);
   }
 

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/IntegerParameter.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/IntegerParameter.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/IntegerParameter.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/parameters/IntegerParameter.java Fri Oct 24 04:47:42 2008
@@ -21,7 +21,7 @@
 
 public class IntegerParameter extends AbstractParameter<Integer> {
 
-  public IntegerParameter(String prefix, String name, JobConf jobConf, Integer defaultValue, String description) {
+  public IntegerParameter(String prefix, String name, JobConf jobConf, int defaultValue, String description) {
     super(Integer.class, prefix, name, jobConf, defaultValue, description);
   }
 

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesClassifierTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesClassifierTest.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesClassifierTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesClassifierTest.java Fri Oct 24 04:47:42 2008
@@ -34,7 +34,7 @@
     //String[] labels = new String[]{"a", "b", "c", "d", "e"};
     //long[] labelCounts = new long[]{6, 20, 60, 100, 200};
     //String[] features = new String[]{"aa", "bb", "cc", "dd", "ee"};
-    model.setSigma_jSigma_k(100.0f);
+    model.setSigma_jSigma_k(100.0);
     
     model.setSumFeatureWeight("aa", 100);
     model.setSumFeatureWeight("bb", 100);

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/CBayesClassifierTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/CBayesClassifierTest.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/CBayesClassifierTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/CBayesClassifierTest.java Fri Oct 24 04:47:42 2008
@@ -34,7 +34,7 @@
     //String[] labels = new String[]{"a", "b", "c", "d", "e"};
     //long[] labelCounts = new long[]{6, 20, 60, 100, 200};
     //String[] features = new String[]{"aa", "bb", "cc", "dd", "ee"};
-    model.setSigma_jSigma_k(500.0f);
+    model.setSigma_jSigma_k(500.0);
     
     model.setSumFeatureWeight("aa", 80);
     model.setSumFeatureWeight("bb", 21);

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/fuzzykmeans/TestFuzzyKmeansClustering.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/fuzzykmeans/TestFuzzyKmeansClustering.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/fuzzykmeans/TestFuzzyKmeansClustering.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/fuzzykmeans/TestFuzzyKmeansClustering.java Fri Oct 24 04:47:42 2008
@@ -309,7 +309,7 @@
               .substring(pointInfo.indexOf(":") + 1);
 
           Double val = pointTotalProbMap.get(encodedVector);
-          double probVal = 0;
+          double probVal = 0.0;
           if (val != null) {
             probVal = val;
           }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java Fri Oct 24 04:47:42 2008
@@ -131,11 +131,6 @@
     return canopies;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see junit.framework.TestCase#setUp()
-   */
   protected void setUp() throws Exception {
     super.setUp();
     rmr("output");
@@ -161,8 +156,8 @@
    * 
    * @throws CardinalityException
    */
-  public void testReferenceImplementation() throws CardinalityException {
-    MeanShiftCanopy.config(new EuclideanDistanceMeasure(), (float) 4, 1.0, 0.5);
+  public void testReferenceImplementation() {
+    MeanShiftCanopy.config(new EuclideanDistanceMeasure(), 4.0, 1.0, 0.5);
     List<MeanShiftCanopy> canopies = new ArrayList<MeanShiftCanopy>();
     // add all points to the canopies
     for (int i = 0; i < raw.length; i++)

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/EvalMapperTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/EvalMapperTest.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/EvalMapperTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/EvalMapperTest.java Fri Oct 24 04:47:42 2008
@@ -18,9 +18,9 @@
 package org.apache.mahout.ga.watchmaker;
 
 import junit.framework.TestCase;
-import org.apache.hadoop.io.FloatWritable;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
+import org.apache.hadoop.io.DoubleWritable;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.mahout.ga.watchmaker.utils.DummyCandidate;
 import org.apache.mahout.ga.watchmaker.utils.DummyEvaluator;
@@ -45,7 +45,7 @@
 
     // Mapper
     EvalMapper mapper = new EvalMapper();
-    DummyOutputCollector<LongWritable, FloatWritable> collector = new DummyOutputCollector<LongWritable, FloatWritable>();
+    DummyOutputCollector<LongWritable,DoubleWritable> collector = new DummyOutputCollector<LongWritable,DoubleWritable>();
 
     // prepare configuration
     JobConf conf = new JobConf();
@@ -65,7 +65,7 @@
     for (String key : keys) {
       DummyCandidate candidate = population.get(Integer.parseInt(key));
       assertEquals("Values for key " + key, 1, collector.getValue(key).size());
-      Float fitness = collector.getValue(key).get(0).get();
+      double fitness = (double) collector.getValue(key).get(0).get();
       assertEquals("Evaluation of the candidate " + key, DummyEvaluator
           .getFitness(candidate.getIndex()), fitness);
     }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/MahoutEvaluatorTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/MahoutEvaluatorTest.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/MahoutEvaluatorTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/MahoutEvaluatorTest.java Fri Oct 24 04:47:42 2008
@@ -45,7 +45,7 @@
     DummyEvaluator evaluator = new DummyEvaluator();
 
     // run MahoutEvaluator
-    List<Float> results = new ArrayList<Float>();
+    List<Double> results = new ArrayList<Double>();
     MahoutEvaluator.evaluate(evaluator, population, results);
 
     // check results

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java Fri Oct 24 04:47:42 2008
@@ -29,9 +29,9 @@
   private class STFitnessEvaluatorMock<T> extends STFitnessEvaluator<T> {
     private int nbcalls;
 
-    private List<Float> evaluations;
+    private List<Double> evaluations;
 
-    public void shouldReturn(List<Float> evaluations) {
+    public void shouldReturn(List<Double> evaluations) {
       this.evaluations = evaluations;
     }
 
@@ -41,7 +41,7 @@
 
     @Override
     protected void evaluate(List<? extends T> population,
-        List<Float> evaluations) {
+        List<Double> evaluations) {
       nbcalls++;
       evaluations.addAll(this.evaluations);
     }
@@ -67,13 +67,12 @@
     int size = 100;
     List<Integer> population = randomInts(size, rng);
 
-    List<Float> evaluations = randomFloats(size, rng);
+    List<Double> evaluations = randomFloats(size, rng);
     mock.shouldReturn(evaluations);
 
     for (int index = 0; index < size; index++) {
       Integer candidate = population.get(index);
-      assertEquals(evaluations.get(index), (float) mock.getFitness(candidate,
-          population));
+      assertEquals(evaluations.get(index), mock.getFitness(candidate, population));
     }
 
     // getFitness() should be called once
@@ -95,7 +94,7 @@
     int size = 100;
     List<Integer> population = randomInts(size, rng);
 
-    List<Float> evaluations = randomFloats(size, rng);
+    List<Double> evaluations = randomFloats(size, rng);
     mock.shouldReturn(evaluations);
 
     // call with population A
@@ -119,10 +118,10 @@
     return population;
   }
 
-  private List<Float> randomFloats(int size, Random rng) {
-    List<Float> population = new ArrayList<Float>();
+  private List<Double> randomFloats(int size, Random rng) {
+    List<Double> population = new ArrayList<Double>();
     for (int index = 0; index < size; index++)
-      population.add(rng.nextFloat());
+      population.add(rng.nextDouble());
 
     return population;
   }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java Fri Oct 24 04:47:42 2008
@@ -33,9 +33,9 @@
 
   private final Random rng = new Random();
 
-  private static final Map<Integer, Float> evaluations = new HashMap<Integer, Float>();
+  private static final Map<Integer,Double> evaluations = new HashMap<Integer,Double>();
 
-  public static Float getFitness(Integer key) {
+  public static double getFitness(Integer key) {
     if (!evaluations.containsKey(key))
       throw new RuntimeException("Fitness not found");
     return evaluations.get(key);
@@ -51,7 +51,7 @@
       throw new RuntimeException("Duplicate Fitness");
     
     double fitness = rng.nextDouble();
-    evaluations.put(candidate.getIndex(), (float) fitness);
+    evaluations.put(candidate.getIndex(), fitness);
     
     return fitness;
   }

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=707606&r1=707605&r2=707606&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 Fri Oct 24 04:47:42 2008
@@ -40,7 +40,7 @@
 
   }
 
-  private void testVectors(Vector left, Vector right) throws CardinalityException, IndexException {
+  private void testVectors(Vector left, Vector right) {
     left.setQuick(0, 1);
     left.setQuick(1, 2);
     left.setQuick(2, 3);

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/XmlInputFormat.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/XmlInputFormat.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/XmlInputFormat.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/XmlInputFormat.java Fri Oct 24 04:47:42 2008
@@ -22,8 +22,7 @@
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.DataOutputBuffer;
 import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
+import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.mapred.FileSplit;
 import org.apache.hadoop.mapred.InputSplit;
 import org.apache.hadoop.mapred.JobConf;
@@ -37,93 +36,91 @@
  * Reads records that are delimited by a specifc begin/end tag.
  */
 public class XmlInputFormat extends TextInputFormat {
-    public static final String START_TAG_KEY = "xmlinput.start";
-    public static final String END_TAG_KEY = "xmlinput.end";
 
-    @SuppressWarnings("unchecked")
-    public RecordReader getRecordReader(InputSplit inputSplit, JobConf jobConf, Reporter reporter) throws IOException {
-        return new XmlRecordReader((FileSplit) inputSplit, jobConf);
-    }
-
-    public static class XmlRecordReader implements RecordReader<WritableComparable,Writable> {
-        private byte[] startTag;
-        private byte[] endTag;
-        private long start;
-        private long end;
-        private FSDataInputStream fsin;
-        private final DataOutputBuffer buffer = new DataOutputBuffer();
-
-        public XmlRecordReader(FileSplit split, JobConf jobConf) throws IOException {
-            startTag = jobConf.get("xmlinput.start").getBytes("utf-8");
-            endTag = jobConf.get("xmlinput.end").getBytes("utf-8");
-
-            // open the file and seek to the start of the split
-            start = split.getStart();
-            end = start + split.getLength();
-            Path file = split.getPath();
-            FileSystem fs = file.getFileSystem(jobConf);
-            fsin = fs.open(split.getPath());
-            fsin.seek(start);
-        }
+  public static final String START_TAG_KEY = "xmlinput.start";
+  public static final String END_TAG_KEY = "xmlinput.end";
 
-        public boolean next(WritableComparable key, Writable value) throws IOException {
-            if (fsin.getPos() < end) {
-                if (readUntilMatch(startTag, false)) {
-                    try {
-                        buffer.write(startTag);
-                        if (readUntilMatch(endTag, true)) {
-                            ((Text) key).set(Long.toString(fsin.getPos()));
-                            ((Text) value).set(buffer.getData(), 0, buffer.getLength());
-                            return true;
-                        }
-                    }
-                    finally {
-                        buffer.reset();
-                    }
-                }
-            }
-            return false;
-        }
+  public RecordReader<LongWritable, Text> getRecordReader(InputSplit inputSplit, JobConf jobConf, Reporter reporter)
+      throws IOException {
+    return new XmlRecordReader((FileSplit) inputSplit, jobConf);
+  }
+
+  public static class XmlRecordReader implements RecordReader<LongWritable, Text> {
+    private byte[] startTag;
+    private byte[] endTag;
+    private long start;
+    private long end;
+    private FSDataInputStream fsin;
+    private final DataOutputBuffer buffer = new DataOutputBuffer();
+
+    public XmlRecordReader(FileSplit split, JobConf jobConf) throws IOException {
+      startTag = jobConf.get("xmlinput.start").getBytes("utf-8");
+      endTag = jobConf.get("xmlinput.end").getBytes("utf-8");
+
+      // open the file and seek to the start of the split
+      start = split.getStart();
+      end = start + split.getLength();
+      Path file = split.getPath();
+      FileSystem fs = file.getFileSystem(jobConf);
+      fsin = fs.open(split.getPath());
+      fsin.seek(start);
+    }
 
-        public WritableComparable createKey() {
-            return new Text();
+    public boolean next(LongWritable key, Text value) throws IOException {
+      if (fsin.getPos() < end) {
+        if (readUntilMatch(startTag, false)) {
+          try {
+            buffer.write(startTag);
+            if (readUntilMatch(endTag, true)) {
+              key.set(fsin.getPos());
+              value.set(buffer.getData(), 0, buffer.getLength());
+              return true;
+            }
+          } finally {
+            buffer.reset();
+          }
         }
+      }
+      return false;
+    }
 
-        public Writable createValue() {
-            return new Text();
-        }
+    public LongWritable createKey() {
+      return new LongWritable();
+    }
 
-        public long getPos() throws IOException {
-            return fsin.getPos();
-        }
+    public Text createValue() {
+      return new Text();
+    }
 
-        public void close() throws IOException {
-            fsin.close();
-        }
+    public long getPos() throws IOException {
+      return fsin.getPos();
+    }
 
-        public float getProgress() throws IOException {
-            return ((float) (fsin.getPos() - start)) / ((float) (end - start));
-        }
+    public void close() throws IOException {
+      fsin.close();
+    }
 
-        /////////////////////////////////////////////////
+    public float getProgress() throws IOException {
+      return (float) ((fsin.getPos() - start) / (end - start));
+    }
 
-        private boolean readUntilMatch(byte[] match, boolean withinBlock) throws IOException {
-            int i = 0;
-            while (true) {
-                int b = fsin.read();
-                // end of file:
-                if (b == -1) return false;
-                // save to buffer:
-                if (withinBlock) buffer.write(b);
-
-                // check if we're matching:
-                if (b == match[i]) {
-                    i++;
-                    if (i >= match.length) return true;
-                } else i = 0;
-                // see if we've passed the stop point:
-                if(!withinBlock && i == 0 && fsin.getPos() >= end) return false;
-            }
-        }
+    private boolean readUntilMatch(byte[] match, boolean withinBlock) throws IOException {
+      int i = 0;
+      while (true) {
+        int b = fsin.read();
+        // end of file:
+        if (b == -1) return false;
+        // save to buffer:
+        if (withinBlock) buffer.write(b);
+
+        // check if we're matching:
+        if (b == match[i]) {
+          i++;
+          if (i >= match.length) return true;
+        } else i = 0;
+        // see if we've passed the stop point:
+        if (!withinBlock && i == 0 && fsin.getPos() >= end) return false;
+      }
     }
+  }
 } 
\ No newline at end of file

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/canopy/InputMapper.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/canopy/InputMapper.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/canopy/InputMapper.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/canopy/InputMapper.java Fri Oct 24 04:47:42 2008
@@ -41,7 +41,7 @@
     for (int i = 0; i < numbers.length; i++) {
       String value = numbers[i];
       if (value.length() > 0)
-        doubles.add(new Double(value));
+        doubles.add(Double.valueOf(value));
     }
     Vector result = new DenseVector(doubles.size());
     int index = 0;

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/InputMapper.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/InputMapper.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/InputMapper.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/InputMapper.java Fri Oct 24 04:47:42 2008
@@ -42,7 +42,7 @@
     for (int i = 0; i < numbers.length; i++) {
       String value = numbers[i];
       if (value.length() > 0)
-        doubles.add(new Double(value));
+        doubles.add(Double.valueOf(value));
     }
     Vector point = new DenseVector(doubles.size());
     int index = 0;

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDCrossover.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDCrossover.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDCrossover.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDCrossover.java Fri Oct 24 04:47:42 2008
@@ -28,16 +28,10 @@
  */
 public class CDCrossover extends AbstractCrossover<CDRule> {
 
-  /**
-   * {@inheritDoc}
-   */
   public CDCrossover(int crossoverPoints) {
     super(crossoverPoints);
   }
 
-  /**
-   * {@inheritDoc}
-   */
   public CDCrossover(int crossoverPoints, double crossoverProbability) {
     super(crossoverPoints, crossoverProbability);
   }

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitness.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitness.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitness.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitness.java Fri Oct 24 04:47:42 2008
@@ -104,12 +104,12 @@
   }
 
   /**
-   * Calculates the float fitness corresponding to this evaluation.
+   * Calculates the fitness corresponding to this evaluation.
    * @return
    */
-  public float get() {
-    float se = (float)tp / (tp + fn); // sensitivity
-    float sp = (float)tn / (tn + fp); // specificity
+  public double get() {
+    double se = ((double) tp) / (tp + fn); // sensitivity
+    double sp = ((double) tn) / (tn + fp); // specificity
     
     return se * sp;
   }

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessEvaluator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessEvaluator.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessEvaluator.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessEvaluator.java Fri Oct 24 04:47:42 2008
@@ -58,7 +58,7 @@
 
   @Override
   protected void evaluate(List<? extends Rule> population,
-      List<Float> evaluations) {
+      List<Double> evaluations) {
     evals.clear();
 
     try {

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java Fri Oct 24 04:47:42 2008
@@ -26,10 +26,10 @@
 public class DescriptionUtils {
 
   public static class Range {
-    public final float min;
-    public final float max;
+    public final double min;
+    public final double max;
     
-    public Range(float min, float max) {
+    public Range(double min, double max) {
       this.max = max;
       this.min = min;
     }
@@ -42,7 +42,7 @@
    * @param max
    * @return
    */
-  public static String createNumericalDescription(float min, float max) {
+  public static String createNumericalDescription(double min, double max) {
     return min + "," + max;
   }
 
@@ -67,8 +67,8 @@
 
   public static Range extractNumericalRange(String description) {
     StringTokenizer tokenizer = new StringTokenizer(description, ",");
-    float min = Float.parseFloat(tokenizer.nextToken());
-    float max = Float.parseFloat(tokenizer.nextToken());
+    double min = Double.parseDouble(tokenizer.nextToken());
+    double max = Double.parseDouble(tokenizer.nextToken());
     
     return new Range(min, max);
   }

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolCombiner.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolCombiner.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolCombiner.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolCombiner.java Fri Oct 24 04:47:42 2008
@@ -102,11 +102,11 @@
   }
 
   String numericalDescription(Iterator<Text> values) {
-    float min = Float.MAX_VALUE;
-    float max = Float.MIN_VALUE;
+    double min = Double.POSITIVE_INFINITY;
+    double max = Double.NEGATIVE_INFINITY;
 
     while (values.hasNext()) {
-      float value = Float.parseFloat(values.next().toString());
+      double value = Double.parseDouble(values.next().toString());
       if (value < min)
         min = value;
       else if (value > max)

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducer.java?rev=707606&r1=707605&r2=707606&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducer.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducer.java Fri Oct 24 04:47:42 2008
@@ -91,8 +91,8 @@
   }
 
   String numericDescription(Iterator<Text> values) {
-    float min = Float.MAX_VALUE;
-    float max = Float.MIN_VALUE;
+    double min = Double.POSITIVE_INFINITY;
+    double max = Double.NEGATIVE_INFINITY;
 
     while (values.hasNext()) {
       Range range = DescriptionUtils.extractNumericalRange(values.next().toString());



Mime
View raw message